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

Use snake_case in metrics from win_perf_counters #5196

Closed
danielnelson opened this issue Dec 27, 2018 · 2 comments
Closed

Use snake_case in metrics from win_perf_counters #5196

danielnelson opened this issue Dec 27, 2018 · 2 comments
Labels
area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) breaking change Improvement to Telegraf that requires changes to the plugin or agent; for minor/major releases feature request Requests for new plugin and for new features to existing plugins

Comments

@danielnelson
Copy link
Contributor

Feature Request

Proposal:

Update the win_perf_counters plugin to output metrics in snake_case as is the style in the rest of Telegraf.

Current behavior:

win_disk,instance=C:,objectname=LogicalDisk Avg._Disk_sec/Read=0,Avg._Disk_sec/Transfer=0.0017691525863483548 1545384198000000000

Desired behavior:

win_disk,instance=C:,object_name=logical_disk avg_disk_sec_read=0,avg_disk_sec_transfer=0.0017691525863483548 1545384198000000000
@danielnelson danielnelson added feature request Requests for new plugin and for new features to existing plugins area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) labels Dec 27, 2018
@Erikov-K
Copy link

When i analyzed my instance objects during measuring "SMB Client Shares" and "SMB Server Shares" metrics,
I viewed that they come to me in different text case styles:
Example:

"\SERVERNAME.DOMAINNAME\SHARENAME"
"\SERVERNAME.DOMAINNAME\ShareName"
"\SERVERNAME.DomainName\SHARENAME"
"\SERVERNAME.DomainName\ShareName"
"\ServerName.DomainName\SHARENAME"
"\SERVERNAME.DomainName\ShareName"

and etc...

First, I normalized text of instance objects using

[[processors.strings]]
namepass = ["smb_client_shares"]

[[processors.strings.lowercase]]
tag = "instance"

Telegraf (by default) replace . (dots) in FQDN on _ (bottom dash).

Also I wrote rename rules for each of perfcounters.
I needed it later to filter using keywords in grafana variables.
Example for Latency:

[[processors.rename]]
namepass = ["smb_client_shares"]

[[processors.rename.replace]]
field = "Avg._sec/Write"
dest = "Avg_sec_per_Write"

[[processors.rename.replace]]
field = "Avg._sec/Read"
dest = "Avg_sec_per_Read"

[[processors.rename.replace]]
field = "Avg._sec/Data_Request"
dest = "Avg_sec_per_Data_Request"

In my opinion, using snake_case everywhere not a good idea. :-)
But I also think having optional key for this feature in configuration file will one of the solution for this.

@ssoroka ssoroka added the breaking change Improvement to Telegraf that requires changes to the plugin or agent; for minor/major releases label Mar 8, 2021
@powersj
Copy link
Contributor

powersj commented Sep 20, 2022

There appears to be some previous changing of keys in the windows perf counters plugin. Based on the lack of additional comments and the above comment I am going to close this for now.

@powersj powersj closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) breaking change Improvement to Telegraf that requires changes to the plugin or agent; for minor/major releases feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

4 participants