Skip to content

Providing option to disable labels in prometheus output for string fields#3765

Merged
danielnelson merged 3 commits intoinfluxdata:masterfrom
shaheed121:prometheus_output_patch
Feb 16, 2018
Merged

Providing option to disable labels in prometheus output for string fields#3765
danielnelson merged 3 commits intoinfluxdata:masterfrom
shaheed121:prometheus_output_patch

Conversation

@shaheed121
Copy link
Contributor

#3350 introduced a change where all string fields are turned to labels. However in certain cases where string value changes, it introduces a new metric due to the change in label value.

Hence this will provide an option to disable as well as enable only for certain string values. The default behavior doesn't change with this commit.

@shaheed121 shaheed121 changed the title Providing option to disable labels in prometheus output for string fi… Providing option to disable labels in prometheus output for string fields Feb 7, 2018
@danielnelson
Copy link
Contributor

danielnelson commented Feb 7, 2018

What about using the measurement filtering options to provide this using taginclude/tagexclude and fielddrop/fieldpass?

@shaheed121
Copy link
Contributor Author

@danielnelson Yes, I could do that. But I would have to know the list or patterns of tags beforehand. Instead if I disable converting string fields to labels globally, then I don't have to fiddle with all input plugins.

So what do you think about having atleast an option to disable this feature like how we had before 1.5.0 release?

@danielnelson
Copy link
Contributor

That makes sense, could you provide this in a similar way to how we we do it in the docker plugin with docker_label_include and docker_label_exclude? Maybe we call it string_label_include and string_label_exclude.

@shaheed121
Copy link
Contributor Author

shaheed121 commented Feb 12, 2018

@danielnelson To keep it consistent across output plugins, I thought of doing something like string_as_state in Riemann output plugin. So have added string_as_label and set default as true to make sure that it exhibits the current behavior. The reason I didn't go ahead with string_label_include and string_label_exclude because it would be redundant since it can also be managed by using Measurement filtering like you said.

So this change should provide options to enable/disable string metrics to labels globally and then include/exclude certain labels using measurement filtering.

@danielnelson danielnelson added this to the 1.6.0 milestone Feb 16, 2018
@danielnelson danielnelson added feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin area/prometheus labels Feb 16, 2018
@danielnelson danielnelson merged commit 53221d8 into influxdata:master Feb 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/prometheus feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants