sumologic-kubernetes-collection icon indicating copy to clipboard operation
sumologic-kubernetes-collection copied to clipboard

feat(metrics): make deleting metrics source metadata optional

Open ryan-codaio opened this issue 2 years ago • 2 comments

Currently, there is no way to set the source category for metrics, as we are stripping the _sourceCategory attribute. This happens after the extraProcessors are added, so there is no way to override this behavior. This is pretty important for us, as we need to disambiguate metrics from different environments.

The comment for this delete_source_metadata processor says it's because we need to wait until we can send these attributes as headers, but the sumologic exporter has been doing this since Oct 2022. In tests on our infra with this processor removed, this has been working fine.

I added a configuration parameter defaulting to true to preserve the old behavior by default, to avoid any unexpected surprises with a sudden cardinality increase.

Checklist

  • [x] Changelog updated or skip changelog label added
  • [x] Documentation updated

ryan-codaio avatar May 30 '23 20:05 ryan-codaio

We are working on improving source metadata for metrics, as it doesn't make sense to use default template for some of them (cluster wide). Workaround for this PR is to use the following configuration:

metadata:
  metrics:
    config:
      merge:
        processors:
          resource/delete_source_metadata:
            attributes:
              # attributes list cannot be empty so using non-existing key
              - key: _
                action: delete

sumo-drosiek avatar May 31 '23 05:05 sumo-drosiek

Thank you for the workaround! This seems to have worked well for us.

ryan-codaio avatar May 31 '23 18:05 ryan-codaio