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

exclude a metric if it contains a dash #94

Merged
merged 2 commits into from Sep 1, 2017
Merged

Conversation

azr
Copy link
Contributor

@azr azr commented Aug 16, 2017

this fixed #93 for us :)

@oliver006
Copy link
Owner

That would fix it 👍

But what about instead changing the metric name and replace the - with _ ?
In that way the metric is still exposed and available to users.

@oliver006
Copy link
Owner

You could replace this line here:
https://github.com/azr/redis_exporter/blob/02859cc0fec36f8d529ccbcb9a16f8456f38d937/exporter/redis.go#L394
with something like

metricName := sanitizeMetricName(split[0])

and

func sanitizeMetricName(n string) {
    // replace "-" with "_" in n 
    // and maybe other characters?
    return n
}

@azr
Copy link
Contributor Author

azr commented Aug 16, 2017

Yup, looks better like this :)

@azr
Copy link
Contributor Author

azr commented Aug 16, 2017

But that redis_cluster_stats_messages_auth-ack_received metric is still there

@oliver006
Copy link
Owner

Hmm, no idea why that is.

@oliver006
Copy link
Owner

I just tried to reproduce that but don't see that error on Redis 3.2.8 - what redis version are you using and what's your cluster setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

invalid metric name "redis_cluster_stats_messages_auth-ack_received"
2 participants