[outputs.signalfx] Add output plugin for SignalFX#5204
[outputs.signalfx] Add output plugin for SignalFX#5204amoghe wants to merge 4 commits intoinfluxdata:masterfrom
Conversation
8eabea7 to
04b460e
Compare
|
attn: @danielnelson |
|
Thanks, I'll try to check it out soon, but will need some time to look through the new dependencies. |
|
can I get some eyes on this please ❓ |
|
@amoghe Sorry, I'll take a look this week, thanks for being patient. |
danielnelson
left a comment
There was a problem hiding this comment.
Looks very good, nice straightforward code which I love :). Here are the final bits I think are needed:
|
There is a fix for the syslog test failure in master, can you merge or rebase? |
58a928a to
ae63aa2
Compare
Done. (rebased on master) |
ae63aa2 to
effba2b
Compare
|
@danielnelson , looks like this PR is has two outstanding comments
Do we have to hold up this PR on item 2? |
|
@amoghe I think the upstream PR is stalled, do you think you could open a new one with the change and addressing the comments? |
|
@danielnelson Hi - since the PR stalled I've created a new one to get things moving again- signalfx/golib#138 |
|
@danielnelson signalfx/golib#138 has been merged into master - anything else required here? |
|
Just need to update the Gopkg.toml to resolve the conflict and set the new import path. |
This output plugin converts the `telegraf.Metrics` into signalfx `datapoint`s and then transmits them to the ingest servers using signalfx golang client lib. As of this commit, the client lib is allowed to pick sane defaults and none of its fields are overridable via telegraf config. This can be changed in the future if needed. The unit tests only test for conversion of `telegraf.Metric`s to the `datapoint` structs. All code that executes after that is assumed to be tested in the signalfx client lib itself (and not worth writing end-to-end tests for). TODO: datapoints are flushed back to the signalfx server in the batch size that is passed into the `Write` method of this plugin. However we could allow this batch size to be configurable via some plugin config knobs if desired.
1. try converting bools to int instead of dropping them 2. fix readme for this output plugin 3. prevent multiple calls to `m.Tags()` 4. add more detail to debug log line
So that we pick up all the changes to Gopkg files from master.
effba2b to
2380008
Compare
Rebased and then force-pushed. PTAL |
Gopkg.toml
Outdated
|
|
||
| [[constraint]] | ||
| name = "github.com/signalfx/golib" | ||
| version = "2.0.0" |
There was a problem hiding this comment.
Can you set this to branch = "master" with a comment that we are waiting on 2.3.5 or later for dependency changes. I'll make a note to update this before the next release.
There was a problem hiding this comment.
# Gopkg.lock is out of sync:
github.com/signalfx/golib@v2.0.0: not allowed by constraint master
There was a problem hiding this comment.
Hmmm, looks like the CI build failed. I'm not sure what is going on here (because I'm not very familiar with dep). It looks like even though I updated Gopkg.toml to specify branch = "master", and then ran make deps, the Gopkg.lock still has this:
[[projects]]
digest = "1:3d52a2ff8fabf5cb15a88e8451a524af87f203c80ad8a33209fd52e15eaa4997"
name = "github.com/signalfx/golib"
packages = [
"datapoint",
"errors",
"event",
"eventcounter",
"log",
"sfxclient",
"timekeeper",
"trace",
"trace/format",
]
pruneopts = ""
revision = "271e7b77c46c2cb201be901a302cb181a9d1645a"
version = "v2.0.0"
I suspect the version shouldn't be here any more after a successful run of dep ensure...
@danielnelson - any pointers on what to do next?
There was a problem hiding this comment.
I get a couple errors running dep ensure, first this one:
master: Could not introduce github.com/signalfx/golib@master, as it has a dependency on github.com/go-logfmt/logfmt with constraint ^0.3.0, which has no overlap with existing constraint ^0.4.0 from (root)
This can be fixed by changing Telegraf's logfmt dependency to ">=0.3.0, <0.5.0", or another fix would be to do the same on signalfx. It doesn't appear to cause an issue, tests are still passing.
After changing this I get:
master: Could not introduce github.com/signalfx/golib@master, as it has a dependency on github.com/golang/protobuf with constraint 1643683e1b54a9e88ad26d98f81400c8c9d9f4f9, which has no overlap with existing constraint ^1.1.0 from (root)
This one probably needs to be fixed in signalfx: `version = "1.0.0" or such, since they are saying only this revision of protobuf will work, which is too strict and I expect any version >= 1.0.0 (the first release) would be fine. At any rate I believe we need 1.1.0 due to an existing dependency. It looks like this revision is a bit older than 1.0.0, but maybe they would be willing to move it forward so that we can pin a release.
There was a problem hiding this comment.
This can be fixed by changing Telegraf's logfmt dependency to ">=0.3.0, <0.5.0"
I can create a commit for this
which is too strict and I expect any version >= 1.0.0 (the first release) would be fine.
@mstumpfx - since we have your eyes on this - what are your thoughts on making this change on the golib side?
There was a problem hiding this comment.
@amoghe I will talk to to a couple others about this today and figure out why we pin this revision, and if it can be updated. Will get back to you.
There was a problem hiding this comment.
Our protobuf version is tightly coupled to our client libraries so this may take a bit of work on our end, I'm still talking to a couple of the engineers who typically maintain the repo about it.
There was a problem hiding this comment.
Sorry for the delayed response - we're in the process of getting this prioritized on our end, and there's a few different teams involved. I don't have much finite information to share yet, but things are in motion.
|
@amoghe & @danielnelson This was released in v2.5.0 of golib. The log.fmt issue still may exist, we restrict to v0.3.0 |
|
I believe we can move our dependency back to 0.3.0, though it would be nice if signalfx accepted both versions. I don't see any breaking interface changes. @amoghe Would you be able update your pull request? |
|
I suppose my inexperience with |
|
I tried to update my branch using |
|
@amoghe I rebased your branch on top of the upstream master to fix the merge conflicts and changed the versions of golib and logfmt to work. I was able to get a clean build that way. The code is in the signalfx fork at https://github.com/signalfx/telegraf/tree/amoghe_signalfx_output. If you want, you can force push your branch to what is at the equivalent signalfx fork branch and it should fix this PR. Or you can close this one and I'll just open one with my version -- whatever is easiest for you. |
|
@keitwb - I can close this PR and you can create a new one with all these changes in it. |
|
@keitwb - please paste a link to the new PR in a comment , so that we can follow this one into the next |
|
Ok thanks @amoghe. I realized some enhancements that need to be made to your work such as being able to specify the datapoint url, so I'm going to add that and then make the PR. Will link it here when done. |
This output plugin converts the
telegraf.Metricsinto signalfxdatapoints and then transmits them to the ingest servers usingsignalfx golang client lib.
As of this commit, the client lib is allowed to pick sane defaults
and none of its fields are overridable via telegraf config. This
can be changed in the future if needed.
The unit tests only test for conversion of
telegraf.Metrics tothe
datapointstructs. All code that executes after that isassumed to be tested in the signalfx client lib itself (and not
worth writing end-to-end tests for).
TODO: datapoints are flushed back to the signalfx server in the
batch size that is passed into the
Writemethod of this plugin.However we could allow this batch size to be configurable via
some plugin config knobs if desired.
Required for all PRs: