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

new feature: need exemplar support #684

Open
bigfish49 opened this issue Sep 28, 2022 · 2 comments
Open

new feature: need exemplar support #684

bigfish49 opened this issue Sep 28, 2022 · 2 comments
Labels
enhancement This is considered a feature request, not currently guaranteed by the code or design today mtail-Language/VM Issues related to the mtail language, compiler, or VM

Comments

@bigfish49
Copy link

As prometheus and grafana has supported exemplar feature, can mtail support this feature?
here is some doc related:
https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md
https://grafana.com/docs/grafana/latest/basics/exemplars/
https://prometheus.io/docs/prometheus/latest/feature_flags/#exemplars-storage
thanks!

@jaqx0r
Copy link
Contributor

jaqx0r commented Sep 28, 2022 via email

@bigfish49
Copy link
Author

bigfish49 commented Oct 10, 2022

In our use case, we need to attach substrings like trace-id, as we just want to link to the log context by using grafana.
So, i think we should support this by adding a substring. I suppose we could have done this in this way:

  1. define some prefix like "exemplar_label_", "exemplar_value_", "exemplar_timestamp_",
  2. when we find such variable in a pattern, we auto update exemplar using those values
  3. e.g. the rule is written like this:
    counter my_counter
    /tid=(?P<exemplar_label_trace_id>[0-9A-Za-z]+)/ {
    my_counter++
    }
    the output metrics should be like this:
    my_counter 11 # {trace_id="KOO5S4vxi0o"} 0

in the example above, exemplar value is not define, so just default it to 0.

@jaqx0r jaqx0r added enhancement This is considered a feature request, not currently guaranteed by the code or design today mtail-Language/VM Issues related to the mtail language, compiler, or VM labels Jan 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is considered a feature request, not currently guaranteed by the code or design today mtail-Language/VM Issues related to the mtail language, compiler, or VM
Projects
None yet
Development

No branches or pull requests

2 participants