Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON External Documentation Format is not Documented #1225

Closed
kylebrandt opened this issue Jul 31, 2015 · 3 comments
Closed

JSON External Documentation Format is not Documented #1225

kylebrandt opened this issue Jul 31, 2015 · 3 comments

Comments

@kylebrandt
Copy link
Member

http://godoc.org/bosun.org/cmd/scollector doesn't talk about how they can output json now

@kylebrandt
Copy link
Member Author

The PR that needs to be documented fced164

@gbrayut
Copy link
Contributor

gbrayut commented Aug 5, 2015

I'll add this to the resources PR today, but for now the structs used in JSON are opentsdb.DataPoint for metric data and metadata.Metasend for metadata. You send a stream of serialized JSON data over stdout, so when you run the program it should produce something like below. It starts with Metadata (only needed once, scollector will re-send as needed) and then starts sending metrics. You can also see the 4th line is a log message which was sent to stderror not stdout.

{"Metric":"exceptional.exceptions.count","Name":"rate","Value":"counter"}
{"Metric":"exceptional.exceptions.count","Name":"unit","Value":"errors"}
{"Metric":"exceptional.exceptions.count","Name":"desc","Value":"The number of exceptions thrown per second by applications and machines. Data is queried from multiple sources. See status instances for details on exceptions."}
2015/08/05 15:32:00 lookup OR-SQL03: no such host
{"metric":"exceptional.exceptions.count","timestamp":1438788720,"value":0,"tags":{"application":"AdServer","machine":"ny-web03","source":"NY_Status"}}
{"metric":"exceptional.exceptions.count","timestamp":1438788720,"value":2,"tags":{"application":"AdServer","machine":"ny-web04","source":"NY_Status"}}
{"metric":"exceptional.exceptions.count","timestamp":1438788720,"value":1,"tags":{"application":"AdServer","machine":"ny-web06","source":"NY_Status"}}

@gbrayut
Copy link
Contributor

gbrayut commented Sep 4, 2015

Update docs now at http://bosun.org/scollector/external-collectors

@gbrayut gbrayut closed this as completed Sep 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants