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

multi-target and custom queries #32741

Closed
lucian-vanghele opened this issue Apr 29, 2024 · 10 comments
Closed

multi-target and custom queries #32741

lucian-vanghele opened this issue Apr 29, 2024 · 10 comments

Comments

@lucian-vanghele
Copy link

Component(s)

receiver/oracledb

Is your feature request related to a problem? Please describe.

I want to be able to use use custom queries against multiple targets. having hardcoded queries is not the best ideas, sometimes there are differences between oracle versions.
I tried to add 2 receivers towards 2 different targets, I only received one set of metrics not even sure for which db.

Describe the solution you'd like

whatever solves the problem is better than current way.

Describe alternatives you've considered

No response

Additional context

No response

@lucian-vanghele lucian-vanghele added enhancement New feature or request needs triage New item requiring triage labels Apr 29, 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

Can you give more information on what custom queries would look like? Are you wanting to enable/disable different metrics from different targets, or are you wanting to write your own query that would then be used to generate custom metrics?

(Also, if you're interested in getting some help debugging your problem of only receiving one set of metrics, please include your full configuration 👍 )

@lucian-vanghele
Copy link
Author

@crobert-1 - thanks for replying.

First issue about custom queries: I want to be able to create metrics using my own queries (you know how creative DBAs could be). See for eg https://github.com/iamseth/oracledb_exporter or https://github.com/free/sql_exporter. I see sqlqueryreceiver uses this principle, I will also give it a try but then ... what is the purpose of this oracledb receiver?

Second problem: I was able to fix it by enabling the resource_to_telemetry_conversion on prometheus exporter. I'm only interested now if queries towards these multiple targets are actually performed in paralel.

@crobert-1
Copy link
Member

Thanks @lucian-vanghele, the sqlquery receiver would definitely be the better fit here for custom queries. I believe you could use it with the Oracle DB receiver to gather all the metrics you're looking for.

There is overlap between the sqlquery receiver and most (if not all) of the other SQL receivers. The benefit of the dedicated receivers is the ability to simply enable/disable metrics, without having to worry about underlying queries. There's more flexibility with the sqlquery receiver, but then it's up to the user to figure out how to query the backend DB properly, what format and naming scheme the metrics should have, etc.

@crobert-1 crobert-1 removed enhancement New feature or request needs triage New item requiring triage labels Apr 30, 2024
@lucian-vanghele
Copy link
Author

@crobert-1 - I believe most, if not all, of the Oracle users (administrators actually) would like to have full control on these queries. So, I'm not sure how many will see the benefit you mentioned.
collection_interval is also a critical aspect which is missing in oracledb receiver.

@crobert-1
Copy link
Member

I believe most, if not all, of the Oracle users (administrators actually) would like to have full control on these queries. So, I'm not sure how many will see the benefit you mentioned.

That's fair! You're welcome to try out the SQL query receiver then and let us know if that works for your use case. Also, if you have any specific metrics or queries that would be especially helpful, you'd be welcome to request them to be added to the oracle DB receiver 👍

collection_interval is also a critical aspect which is missing in oracledb receiver.

My apologies! It's available but for some reason we forgot to document it properly. I've submitted a PR to add it to the README. Thanks for bringing this up!

mx-psi pushed a commit that referenced this issue May 2, 2024
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
These options are available via the receiver's dependency on
`scraperhelper.ControllerConfig`, but weren't included in the README.

**Link to tracking Issue:** <Issue number if applicable>
[Brought up
here](#32741 (comment))
@lucian-vanghele
Copy link
Author

I already tested sqlquery receiver, it works ok for now. However, I don't see the instance.name attribute (as for oracledb receiver) so I had to add it as a static attribute for each metric in order to be able to distinguish between timeseries related to different oracle instances. Also, I don;t find what is the timeout setting as some queries can take several seconds. I assume all receivers are executed parallel each in its own thread (as there is this collection_interval setting), right?

@crobert-1
Copy link
Member

Also, I don;t find what is the timeout setting as some queries can take several seconds. I assume all receivers are executed parallel each in its own thread (as there is this collection_interval setting), right?

The timeout setting is disabled by default, so unless you've set it, it shouldn't impact any functionality here. Yes, all receivers are executed in parallel, so the collection interval for the receiver has no impact on other receivers, and other receivers' collection intervals won't impact the oracle DB receiver.

Copy link
Contributor

github-actions bot commented Jul 3, 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.

@github-actions github-actions bot added the Stale label Jul 3, 2024
Copy link
Contributor

github-actions bot commented Sep 1, 2024

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 Sep 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants