-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
sqlqueryreceiver - create one metric per row returned #32546
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Hello @philljdarmanin, thanks for filing! I believe this functionality is already available, unless I'm missing something. Does this answer your question here, or am I misunderstanding something? |
Hi @crobert-1. thanks for the reply. i understand that you can get multiple metric values from one query and assign attributes to each value. my request was to assign a unique metric name to each row. one metric name for multiple metrics doesn't make sense to me or my colleagues if the result set returns many unrelated metrics. what makes more sense is to have 'metric_name' as a column so it can be data driven by the query. i suppose one way around it would be to run multiple queries to group similar metrics together, however this could get messy if we had hundreds of metrics, and it doesn't conform to our schema when we send the data to Mimir. the basis for PromQL is to use the metric name as the basis of the query, and then use labels to filter. for example - if i had some perfmon metrics such as 'batch requests/sec', 'index searches/sec', 'full scans/sec' that are being returned via a query - i want these to be the metric names, i dont want them to be attributes that map to labels when exporting to prometheus. and if i had many of these i dont want to hard code all these queries into a config file. i want it to be dynamic - dependant on the query results. |
I think discussing the request with a specific example dataset would be really helpful. Could you provide a simple example of a database schema (columns with names and types) with a few rows for examples, and then describe what the resulting metrics would look like that you're requesting be produced by the receiver? |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
Component(s)
receiver/sqlquery
Is your feature request related to a problem? Please describe.
One metric is defined for all records returned from query. if a query returns multiple records only one metric is created. this has cardinality implications when searching for metrics using Prometheus.
Describe the solution you'd like
'metric_name' parameter to be a column. one metric should be created for each row the query returns
Describe alternatives you've considered
attribute_columns are turned into labels which could be used to search for metrics. however it undermines the whole schema. Metric Name should not relate to a group of metrics, it should be a unique representation of the metric it is recording
Additional context
No response
The text was updated successfully, but these errors were encountered: