-
Notifications
You must be signed in to change notification settings - Fork 798
multi server exporter is introduced #215
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 server exporter is introduced #215
Conversation
103c12c
to
dcbf7b2
Compare
This is good work. I'll need to give this a careful review - the need to disable the settings metrics makes me a bit wary of this type of change. There's some tension here against the idea that multi-server scraping should instead be driven by the Prometheus server and this exporter should act as a proxy for it. EDIT: I'm thinking I may merge this onto a branch (since the CI builds and publishes docker images for those) and add a README.md comment about where people can try it out (as my responsiveness may indicate, I haven't had the most time to review PRs lately). |
dcbf7b2
to
d9acb54
Compare
Hey @wrouesnel |
d9acb54
to
0e33dfe
Compare
0e33dfe
to
2c47952
Compare
@regeda Thanks very much for the PR! You are right, it's an in-demand feature and passing test-suites make me happy. Merging this PR to master now. I'll hold off on creating a new explicit release till I get more of a chance to play with it, but it'll go out under the |
Thank you for good work! Can you add custom label or cluster_name from pg_settings for every metric by DSN? |
@uspen Pls, open the issue. I will support it. |
@regeda
instead of |
@karnatinaresh Unfortunately, multiple endpoints might be configured using |
@regeda Thanks |
@regeda I tried multiple servers via URI and looks like it has problem with splitting a string:
Also, doesn't hide password in second database string Here are my settings:
|
@mlushpenko Unfortunately, v0.4.7 doesn't contain that feature. Use |
Thanks you @regeda, no more problems with connection string. Now, with multiple databases I can't use simple queries, getting:
It's probably a newbie question, but do you have idea how shall I reference tables with multiple connections? I tried: And when tried
I am getting this error in pgadmin if I am trying to run query on database A from database B. So, wondering how do you map SQL queries from |
The exporter establishes a separate connection for each data source. If a driver configured to connect with a database "XXX" then you can read relations existed in "XXX" database only. |
HI @regeda separate connection sounds good. Could please clarify about driver? or give example of querying multiple databases with different tables from |
@mlushpenko I'm not sure what do you want. A driver follows the database rules. You need to understand how Postgres works before diving into Go driver. |
I think he means how to specify the connection to use in queries.yml. For example if i define two queries but they are meant to different databases, how i restrict one query for one of the configured connections? |
Thanks @codestation - exactly what I mean. Also, same thing here #224 (comment). @regeda are we all missing something or can I give another example? If functionality for multiple databases was added, I don't understand why some example of queries weren't added. Maybe it's as simple as missing documentation or maybe I (and other people here) don't understand what was the purpose of separate connections if queries can work only for single connection. |
@mlushpenko As I understand you want to restrict queries by a specific database. Do not scrape all available schemas. Is it? |
Yes, correct, thank you |
@regeda |
@karnatinaresh I think you could build a docker image with any version of linux dist. |
Hi Everyone!
I've added an ability to define different data sources for one exporter setup.
Changes:
DATA_SOURCE_NAME
separated by the comma.disable-settings-metrics
flag to the command line in order to avoid panics in Prometheus client when different Postgres versions return different descriptions for settings.