Skip to content

Graphite Tag support replaces characters that should be allowed #9248

@G-regL

Description

@G-regL

Feature Request

Opening a feature request kicks off a discussion.

Proposal:

I'd like to see Telegraf support the full power of tags when using the Graphite data format, with Tag Support turned on, by passing them almost unchanged from the inputs, only stripping out charaters that are strictly disallowed.

Current behavior:

When using any output that supports Graphite with Tag Support enabled, Telegraf was stripping out characters that should actually be allowed. THis is caused by the fact that the serializer was using the same sanitizing code for tag names/values and the fields, and measurements. In reality, the rules are different for each aspect.

Metrics like the following:

vsphere_host_datastore,cluster=PROD\ -\ SAP,datacenter=NA\ -\ CAN1,datastoreID=5f87613a-f628220e-04b2-1402ec8723bc,esxhost=can1vm32.can.na.int.corp.com,vcenter=vc.int.corp.com datastoreIops_average=0i,datastoreMaxQueueDepth_latest=64i  1620420360000000000
> vsphere_host_disk,cluster=PROD\ -\ SAP,datacenter=NA\ -\ CAN1,datastoreID=5f87613a-f628220e-04b2-1402ec8723bc,esxhost=can1vm32.can.na.int.corp.com,lunID=naa.60060e80129f6d0050409f6d00000101,vcenter=vc.int.corp.com busResets_summation=0i,commandsAborted_summation=0i 1620420360000000000

Become

vsphere_host_datastore.datastoreIops_average;cluster=PROD_-_SAP,datacenter=NA_-_CAN1,datastoreID=5f87613a-f628220e-04b2-1402ec8723bc,esxhost=can1vm32.can.na.int.corp.com,vcenter=vc.int.corp.com 0 1620420360000000
vsphere_host_datastore.datastoreMaxQueueDepth_latest;cluster=PROD_-_SAP,datacenter=NA_-_CAN1,datastoreID=5f87613a-f628220e-04b2-1402ec8723bc,esxhost=can1vm32.can.na.int.corp.com,vcenter=vc.int.corp.com 64 1620420360000000
vsphere_host_disk.busResets_summation;cluster=PROD_-_SAP,datacenter=NA_-_CAN1,datastoreID=5f87613a-f628220e-04b2-1402ec8723bc,esxhost=can1vm32.can.na.int.corp.com,lunID=naa.60060e80129f6d0050409f6d00000101,vcenter=vc.int.corp.com 0 1620420360000000
vsphere_host_disk.commandsAborted_summation;cluster=PROD_-_SAP,datacenter=NA_-_CAN1,datastoreID=5f87613a-f628220e-04b2-1402ec8723bc,esxhost=can1vm32.can.na.int.corp.com,lunID=naa.60060e80129f6d0050409f6d00000101,vcenter=vc.int.corp.com 0 1620420360000000

Desired behavior:

In reality, the Graphite spec says that the disallowed characters for tags are much simpler than currently setup for (;!^= for tag names, ; for tag values).

So the above metrics would become:

vsphere_host_datastore.datastoreIops_average;cluster=PROD - SAP,datacenter=NA - CAN1,datastoreID=5f87613a-f628220e-04b2-1402ec8723bc,esxhost=can1vm32.can.na.int.corp.com,vcenter=vc.int.corp.com 0 1620420360000000
vsphere_host_datastore.datastoreMaxQueueDepth_latest;cluster=PROD - SAP,datacenter=NA - CAN1,datastoreID=5f87613a-f628220e-04b2-1402ec8723bc,esxhost=can1vm32.can.na.int.corp.com,vcenter=vc.int.corp.com 64 1620420360000000
vsphere_host_disk.busResets_summation;cluster=PROD - SAP,datacenter=NA - CAN1,datastoreID=5f87613a-f628220e-04b2-1402ec8723bc,esxhost=can1vm32.can.na.int.corp.com,lunID=naa.60060e80129f6d0050409f6d00000101,vcenter=vc.int.corp.com 0 1620420360000000
vsphere_host_disk.commandsAborted_summation;cluster=PROD - SAP,datacenter=NA - CAN1,datastoreID=5f87613a-f628220e-04b2-1402ec8723bc,esxhost=can1vm32.can.na.int.corp.com,lunID=naa.60060e80129f6d0050409f6d00000101,vcenter=vc.int.corp.com 0 1620420360000000

The difference is subtle, but the cluster and datacenter tags no longer have had their spaces replaced with underscores. This is a very simplistic example, but there are many other characters that are being replaced needlessly.

Use case:

This is important because it makes dashboards and front-ends have cleaner looking data in the fields and drop-downs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/graphitebugunexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions