From b1cb781428fed53aa9637f99eb6b2365590c8151 Mon Sep 17 00:00:00 2001 From: Mark Stumpf Date: Wed, 24 Feb 2021 16:01:07 -0500 Subject: [PATCH] [exporters/signalfx] breaking change: do not convert periods to underscores in dimension keys (#2456) **Description:** **breaking change**: This PR introduces a breaking change for current users upon upgrading, unless explicitly setting the `nonalphanumeric_dimension_chars` config option on the signalfx exporter. This PR changes the config option `nonalphanumeric_dimension_chars` default from `_-` to `_-.`. The resulting behavior change is dimensions keys with periods in them will no longer be converted to underscores. For example, if the dimension `k8s.pod.uid` was currently sent, the exporter would automatically convert this to `k8s_pod-uid`. This change will allow `k8s.pod.uid` to be sent as is. Why? The SignalFx backend now allows periods in dimension keys, and much of our content will rely on this. Existing users who do not wish to break MTSs and keep current functionality can set `nonalphanumeric_dimension_chars` to `_-`. --- CHANGELOG.md | 1 + exporter/signalfxexporter/README.md | 2 +- exporter/signalfxexporter/config_test.go | 2 +- exporter/signalfxexporter/factory.go | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b88d069c905a..7a8586f5252e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ## Unreleased +- `signalfx` exporter: **breaking change** - Allow periods to be sent in dimension keys (#2456). Existing users who do not want to change this functionality can set `nonalphanumeric_dimension_chars` to `_-` ## v0.20.0 diff --git a/exporter/signalfxexporter/README.md b/exporter/signalfxexporter/README.md index 53da646cc8a5..645933fdb011 100644 --- a/exporter/signalfxexporter/README.md +++ b/exporter/signalfxexporter/README.md @@ -74,7 +74,7 @@ The following configuration options can also be configured: processor is enabled in the pipeline with one of the cloud provider detectors or environment variable detector setting a unique value to `host.name` attribute within your k8s cluster. And keep `override=true` in resourcedetection config. -- `nonalphanumeric_dimension_chars`: (default = `"_-"`) A string of characters +- `nonalphanumeric_dimension_chars`: (default = `"_-."`) A string of characters that are allowed to be used as a dimension key in addition to alphanumeric characters. Each nonalphanumeric dimension key character that isn't in this string will be replaced with a `_`. diff --git a/exporter/signalfxexporter/config_test.go b/exporter/signalfxexporter/config_test.go index 70523d543d4f..84465ab6777f 100644 --- a/exporter/signalfxexporter/config_test.go +++ b/exporter/signalfxexporter/config_test.go @@ -160,7 +160,7 @@ func TestLoadConfig(t *testing.T) { "host.name": "host", }, }, - NonAlphanumericDimensionChars: "_-", + NonAlphanumericDimensionChars: "_-.", } assert.Equal(t, &expectedCfg, e1) diff --git a/exporter/signalfxexporter/factory.go b/exporter/signalfxexporter/factory.go index e16221452803..08dfa1638dc0 100644 --- a/exporter/signalfxexporter/factory.go +++ b/exporter/signalfxexporter/factory.go @@ -68,7 +68,7 @@ func createDefaultConfig() configmodels.Exporter { }, DeltaTranslationTTL: 3600, Correlation: correlation.DefaultConfig(), - NonAlphanumericDimensionChars: "_-", + NonAlphanumericDimensionChars: "_-.", } }