-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.triage/pendingIssue or PR is pending for triage and prioritization.Issue or PR is pending for triage and prioritization.
Description
Description
When calling integration.NewEntity in an integration, the entity is not added to the list of entities for the integration. This results in the integration data being missing
Expected Behavior
The entity should be added to the list of integrations and the data serialized.
Steps to Reproduce
- Install redis
- Download the redis example from https://github.com/newrelic/infra-integrations-sdk/blob/master/docs/tutorial-code/single-entity/redis.go
- Run the integration:
go run redis.go -metrics -hostname localhost
{"protocol_version":"4","integration":{"name":"com.myorg.redis","version":"0.1.0"},"data":[]}
Your Environment
MacOS 10.15.7
infra-integrations-sdk v4.1.0
Additional context
The issue is fixed by creating the entity and adding :
i.Entities = append(i.Entities,entity)
go run redis.go -metrics -hostname localhost
{"protocol_version":"4","integration":{"name":"com.myorg.redis","version":"0.1.0"},"data":[{"common":{},"entity":{"name":"redis_01","displayName":"RedisServer","type":"my-redis","metadata":{}},"metrics":[{"timestamp":1631239424,"name":"query.instantaneousOpsPerSecond","type":"gauge","attributes":{},"value":0}],"inventory":{},"events":[]}]}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.triage/pendingIssue or PR is pending for triage and prioritization.Issue or PR is pending for triage and prioritization.