-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Adding custom labels to metrics #222
Comments
Some kind of middleware like Lines 157 to 161 in f4a240f
for metrics might be reasonable? |
What is your use case exactly? 🤔 |
I was thinking about
|
Putting query and its args into the metric labels will drastically increase the cardinality of metrics. You should go with one of these alternatives:
|
To be clear, I was planning to add query without args, which I think the cardinality should be reasonable (at least in my case). Thank you for the alternatives. I'm currently using Grafana Tempo for traces and using Prometheus for metrics. |
Searching for Grafana Tempo,
maybe this can work in my use case? |
Created a sample query dashboard in Grafana that can be achieved by this feature. Also, I'm interested in implementing this if you think it's a good idea |
I think you can try that. Regarding the original question, this library isn't the right tool for building dashboards like AWS Performance Insights. You will need an exporter that gathers data directly from the database servers. Try to search for |
Thank you for you for your suggestions.
I was able to achieve something similar using this method as well, just to let you know.
Maybe I'm not understanding the concept of OpenTelemetry metrics correctly, but what is the supposed use case of the otelsql metrics then? The differences that I think collecting data from otelsql instead of prometheus is that
|
Hi, thank you for this great library.
I was wondering if there is a way to add custom labels to client metrics.
I can add default attributes with
otelsql.WithDefaultAttributes
, but is it possible to addsemconv.DBStatementKey.String
or query arguments for labels?The text was updated successfully, but these errors were encountered: