-
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: some tags have whitespaces appended up to a total length of 128 characters #7241
Comments
Update: can be reproduced with 1.14.0 release. Also observable when using file output: sql_output_json.txt In the example you can also see that it is not happening for all entries |
Is there any other data I can provide to help to narrow this issue down? |
I'm planning to take a look soon, in the meantime can you try this workaround: [[processors.strings.trim]]
namepass = ["sqlserver_performance"]
tag = "instance" |
Thanks for the great Idea! I wasn't aware of that option. I had to modify it slightly but the following seems to work flawless: [[processors.strings]]
namepass = ["sqlserver_performance"]
[[processors.strings.trim]]
tag = "instance" |
@leepfrog-ger can you provide some additional information about this issue? SQL instance:
If you are not sure just run: SELECT
SERVERPROPERTY('ProductVersion') as [FullVersion]
,SERVERPROPERTY('EngineEdition') as [EngineEdition] Telegraf/InfluxDB:
In the latest version, some queries have been edited, but the way the tag "instance" is created has not been changed. it is a simple. SELECT REPLACE(@@SERVERNAME,'\',':') AS [sql_instance] |
All servers are on prem. Issue observed on all servers we are collecting data from with telegraf (multiple 2014 Enterprise and 2016 Enterprise). It seems to be limited to the "instance" field, I've posted example output here |
I had a second look at it. Looks like the query is missing an RTRIM() for the column that becomes the tag "instance". |
@Trovalo thank you, I think Rtrim was missed in all the conditional logic to get right DB name from managed instance - aka this part needs an RTRIM and have it in a couple parts, missed it in a couple.
|
I can confirm this is now working as intended with the most recent release (1.14.2) |
Relevant telegraf.conf:
System info:
Steps to reproduce:
Expected behavior:
Tags, e.g. the
instance
tag that can contain values like the database name for a specific metric are a string that contains exactly the name of the object (e.g.tempdb
)Actual behavior:
Some tags seem to be appended with spaces to be exactly 128 characters in length (e.g.
tempdb [put 122 spaces here]
)Additional info:
tempdb
example there are NO entries with appended spaces before before the upgrade. There are NO entries without appended spaces after the time when the new version was deployed.tempdb
without any appended spaces)The text was updated successfully, but these errors were encountered: