Use whitelisted docker env variables as metric tags #2236
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We want to group container metrics of marathon applications in our DC/OS environment.
Mesos/Marathon exposes some marathon specific metadata as environment variables (mainly MESOS_TASK_ID, MARATHON_APP_ID, MARATHON_APP_VERSION) and this allows us to create metric dashboards for specific marathon apps.
I actually copied the idea from cAdvisor, but having the same feature in telegraf could save us from maintaining a new component (cAdvisor) on all nodes. Also current cAdvisor feature not yet working with influxdb storage: google/cadvisor#1427
I'm new in go, so please comment if something seems wrong. (I also signed the CLA)
I'm not sure about how to implement tests for this particular feature. I thought it would be similar to docker label as metrics tags, but that as well doesn't seem like have tests. Adding test doesn't seem trivial.