-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
sqlserver plugin should have database name as tag and not in metric name #1816
Comments
I agree that this would be better, but unfortunately it would be a breaking change. |
Ok. I tried to figure out how to change the plugin but since it's one huge (T?)SQL query I could not wrap my head around how it worked. Could you give me a hint on how to change the source code locally to shift database name to tags? Also: Could it be an option to add the same metrics with tags in addition to in metric name, to conserve backwards compatibility? |
Please do not change this. Result is as follows: The result is formatted as a pivot to get sum info and individual databases value within the same row. |
I will work on the mssqlserver_extensible plugin soon. |
I understand that it's easy with Influx but it's impossible with Prometheus. I'm also just proposing an extension of the plugin and not necessarily a breaking change. I've also tried changing the original queries in the mssqlserver plugin but it's just too complicated for me to understand. I really appreciate you taking some time to look at it! |
@zensqlmonitor I still think that the database name should be a tag, the more idiomatic way of doing this measurement would be to call the field
this would also support the use-case of @StianOvrevage, who could filter specific databases with something like this:
|
This plugin is putting all simple metrics as measurement name, resulting in hundreds of names in "select from ...." dropdown. Normally plugins export metrics so they are all grouped under one plugin name (so I have hyper_v, cpu, mem, ...), then you have all the fields, tags... Even multiple fields for one metric, not just 'value', all tagged for ease of filtering. Also, this plugin lists several groups of measurements, those are not tagged as well so it is impossible to see for example all CPU or Memory clerk metrics and nothing else (except regexp match on metric name....). Grafana for example forces me to first select measurement and then I am allowed to add WHERE clauses - in this case WHERE clauses will have single values possible (except servername) For example, there are measurements: As for your example in selecting all database names from specified hosts: Regards, |
I agree that it should be a tag, if anyone can submit a PR it would be greatly appreciated |
@StianOvrevage @Garagoth In 1.6 we are introducing a new output format for this plugin enabled by setting Relevant pull request: #3618 |
Fixed in #3618 |
Current behavior:
When using sqlserver plugin all per-database series are exported as follows:
State_OFFLINE_databaseA{host="XX",servername="XX:YY",type="Database properties"} 0
State_OFFLINE_databaseB{host="XX",servername="XX:YY",type="Database properties"} 0
State_OFFLINE_databaseB{host="XX",servername="XX:YY",type="Database properties"} 0
Desired behavior:
The database name should be exported as a tag instead:
State_OFFLINE{host="XX",servername="XX:YY", db="databaseA", type="Database properties"} 0
State_OFFLINE{host="XX",servername="XX:YY", db="databaseB", type="Database properties"} 0
State_OFFLINE{host="XX",servername="XX:YY", db="databaseB", type="Database properties"} 0
Use case:
That would allow for more dynamic queries and avoid need to hard-code metric queries including database-names.
I'm using telegraf with Prometheus at the moment and Prometheus has no way of querying State_OFFLINE_* for example. I'm guessing InfluxDB is also not built to have instance/database names etc as part of the metric name but as tags.
The text was updated successfully, but these errors were encountered: