Comments (3)
https://issues.newrelic.com/browse/NEWRELIC-8871
from infra-integrations-sdk.
Hello, I have tried creating a simple go binary mocking the response you comment:
package main
import (
"fmt"
)
func main() {
fmt.Println(`{"integration_version":"0.1.0","protocol_version":"2","data":[{"metrics":[{"some-data3":4000,"event_type":"CustomSample"}],"inventory":{"instance":{"version":"3.0.1"}},"events":[{"category":"status","summary":"restart"}]}],"name":"com.myorganization.svctest"}`)
}
I build it as nri-custom, and it gets correctly computed by the agent when setting it up in the integrations configuration:
integrations:
- name: nri-custom
labels:
environment: staging
The same applies when creating the binary using the SDK:
package main
import (
"github.com/newrelic/infra-integrations-sdk/data/metric"
"github.com/newrelic/infra-integrations-sdk/integration"
"github.com/newrelic/infra-integrations-sdk/log"
)
var (
integrationVersion = "0.0.0"
)
const (
integrationName = "custom"
)
func main() {
i, err := integration.New(integrationName, integrationVersion)
fatalIfErr(err)
e := i.LocalEntity()
fatalIfErr(err)
if err := e.Inventory.SetItem("instance", "version", "3.0.1"); err != nil {
log.Error("fail to set inventory item: %s", err)
}
ms := e.NewMetricSet("CustomSample")
err = ms.SetMetric("some-data", 4000, metric.GAUGE)
fatalIfErr(err)
fatalIfErr(i.Publish())
}
func fatalIfErr(err error) {
if err != nil {
log.Fatal(err)
}
}
So, the payload is a valid JSON but maybe there are some extra characters on your output that are causing the error.
from infra-integrations-sdk.
thanks for the support
from infra-integrations-sdk.
Related Issues (20)
- Downloading sdkv4 HOT 4
- Dimensions should be type: string, number or boolean
- Document integration protocol V4
- Provide default path for nrjmx when running under windows
- Storer file name not unique for multiple integration execution
- include jmx fix on v3
- Deal with inf upper buond values
- JMX: handle commented lines
- NewEntity does add the new entity to the integration HOT 1
- Tutorial specifies v3 however the sample code uses v4 HOT 1
- Jmx closed connection [possible bug]
- Implement integration tests
- Implement the go module
- Field to prevent metrics/events to be attached to the host entity HOT 2
- Document SDK v4
- Common dimension not aligned with telemetry SDK
- [v4] Integration package naming inconsistencies HOT 1
- [v3] metrics on the a storer file are not garbage collected
- Test workflow on v3 branch
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infra-integrations-sdk.