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

sqlqueryreceiver - create one metric per row returned #32546

Closed
philljdarmanin opened this issue Apr 19, 2024 · 6 comments
Closed

sqlqueryreceiver - create one metric per row returned #32546

philljdarmanin opened this issue Apr 19, 2024 · 6 comments
Labels
closed as inactive enhancement New feature or request needs triage New item requiring triage receiver/sqlquery SQL query receiver Stale waiting for author

Comments

@philljdarmanin
Copy link

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

@philljdarmanin philljdarmanin added enhancement New feature or request needs triage New item requiring triage labels Apr 19, 2024
@github-actions github-actions bot added the receiver/sqlquery SQL query receiver label Apr 19, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member

Hello @philljdarmanin, thanks for filing! I believe this functionality is already available, unless I'm missing something.
Documentation shows how to get multiple metrics from the same query, with each metric value coming from the column specified, and the ability to choose which columns should be attributes for the metric.

Does this answer your question here, or am I misunderstanding something?

@philljdarmanin
Copy link
Author

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.

@crobert-1
Copy link
Member

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?

Copy link
Contributor

github-actions bot commented Jul 2, 2024

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 @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

Copy link
Contributor

This issue has been closed as inactive because it has been stale for 120 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed as inactive enhancement New feature or request needs triage New item requiring triage receiver/sqlquery SQL query receiver Stale waiting for author
Projects
None yet
Development

No branches or pull requests

2 participants