Multiple datasource for MSSQL #682
-
Hi, I'm trying to configure the sql_exporter to support multiple MSSQL data sources. However, I am encountering issues with my YAML configuration when trying to include multiple targets under the same job. The error I get is:
Here is the configuration I have tried so far:
Despite this configuration, I am still encountering the error mentioned above. I'm unable to figure out how to properly configure multiple MSSQL data sources under a single job. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @hamedkhosrawi, the configuration provided on your end is incorrect, try this out:
The difference is as follows:
You can find a working example in the Miscellaneous section here (click on In the future, I'll try to invest some time into a proper explanation for invalid configuration on the app side. For now, we have to rely upon the docs in the README.md and available examples. Let me know if it works on your end. 👍 |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the detailed explanation and the clarification regarding the configuration differences! I really appreciate the time you took to provide the examples and the guidance on job_name, static_configs, and the structure of the targets. It all makes much more sense now, and the reference to the Miscellaneous section in the docs is incredibly helpful. 🙌 If I encounter any issues while implementing or testing further, I'll definitely reach out. Thanks again for your willingness to help and for your efforts in improving the documentation for everyone. |
Beta Was this translation helpful? Give feedback.
Hi @hamedkhosrawi, the configuration provided on your end is incorrect, try this out:
The difference is as follows:
job_name
instead ofname
for job names;static_configs
is a list oftargets
, but eachtargets
item is a map (not a list);targets
map, you may providekey=value
pairs, where the key is the name of the target (e.g.stage
), and the value is a working connection string.You can fi…