From a07f2c3676cfc76b048575f927d1bec8581ac112 Mon Sep 17 00:00:00 2001 From: Dmitrii Anoshin Date: Tue, 6 Oct 2020 15:00:54 -0700 Subject: [PATCH] k8sprocessor: Rename default attr names for label/annotation extraction (#1214) If no key_name is specified in the FieldExtractConfig, the following attributes keys are generated by default: - k8s.label. - k8s.annotation. It is not aligned with the existing conventions and not specific enough. Since the fields are extracted from pods only, we should change it to the following attribute names: - k8s.pod.labels. - k8s.pod.annotations. It'll also allow us to extract any labels/annotations from other k8s objects and won't cause conflicts --- processor/k8sprocessor/config.go | 11 ++++++----- processor/k8sprocessor/options.go | 6 +++--- processor/k8sprocessor/options_test.go | 4 ++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/processor/k8sprocessor/config.go b/processor/k8sprocessor/config.go index 46334b5c4a0f1..dbea2eaead229 100644 --- a/processor/k8sprocessor/config.go +++ b/processor/k8sprocessor/config.go @@ -70,13 +70,14 @@ type ExtractConfig struct { // FieldExtractConfig allows specifying an extraction rule to extract a value from exactly one field. // // The field accepts a list FilterExtractConfig map. The map accepts three keys -// tag-name, key and regex +// tag_name, key and regex // -// - tag-name represents the name of the tag that will be added to the span. +// - tag_name represents the name of the tag that will be added to the span. // When not specified a default tag name will be used of the format: -// k8s.. -// For example, if tag-name is not specified and the key is git_sha, -// then the span name will be `k8s.annotation.deployment.git_sha`. +// k8s.pod.annotations. +// k8s.pod.labels.