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
Add Consul Tags to labels #45
Comments
Sounds good. I'd implement this as separate metric and use joins. E.g.
|
I was more thinking along the lines of:
Relabelling could then be applied to the 'tags' label and allow for more advanced labels to be added if desired. I'd put the service_tags label wherever the service_id is present. |
No, this label shouldn't be added to all metrics:
On another note, lists of tags should start and end with the same delimiter (a comma probably), so that regular expressions become easier. As an exampple, |
I would find the addition of tags to existing service metrics useful to my use-case, although possibly I'm just not familiar enough with the query language to accomplish it with a separate metric. I'd like to alert when a health status on a particular services goes warning or critical but direct the course of the alert based on labels created from the tags ({env="live"} etc). I'm not sure how I could accomplish this without having the tags as part of the health metric. |
I am using consul exporter with source_labels: address and target_label: instance. I do see consul_health_service_status metrics but not consul_service_tags. How do I get consul tag using consul exporter ? Also , is there a way to filter tags using consul exporter similar to consul_sd_config's __meta_consul_tag relabel ? |
any updates on this one? |
@peimanja there is the consul_service_tag metric which exports the tags. |
I'm with @peimanja in the sense that in a perfect world I'd like to be able to join tags to This would allow me to define a fairly generic alert rule and then route based on tags in Alertmanager. If this is possible I would love to hear about it but I can't seem to get there with metric relabelling and/or joining with PromQL. The best I've managed to accomplish is to select series based on a single label match: Which will allow me to select services tagged 'prod' which are critical or warning: |
Any update on this? this could really simplify our queries and @ribbybibby workaround works fine but it makes it hard to write alert rules for different environments and use other tags to route alerts. |
The current setup with tags separated in metric "consul_service_tag" is not sufficient. People add multiple tags to one service, and being able to group_left on one of them does not add a lot of value.
I don't want to sound ungrateful, because this is a great tool that I can use for free, but this should be implemented as @lswith suggests. |
Telegraf handles tags exactly like I'm suggesting, so I will be moving to that solution. |
Any updates on this issue? |
Consul allows for tags to be added to a service. I'd like to be able to import these into the labels for a metric.
The text was updated successfully, but these errors were encountered: