Skip to content

Stackdriver logs have high cardinality logName fields #9897

@ensonic

Description

@ensonic

Bug Report

Describe the bug
The generated entries have logName fields like projects/exampleproject/logs/kube.var.log.containers.podname-5c9f6998f8-8sx9v_more-info-9b4cee7c11d8c2b1f8b8f168a9a71f546762ce3be9fa2a5b8a05b97c193287e9.log.

When creating logs-based metrics this causes high cardinality time-series.
https://cloud.google.com/logging/docs/logs-based-metrics/troubleshooting?_gl=1*yngloj*_ga*MjAwMzQwMDA4LjE3Mzc2MjQ0Nzk.*_ga_WH2QY8WWF5*MTczNzcwNTI2OS42LjEuMTczNzcwODY2OC4xNy4wLjA.#too-many-time-series

For quite a few services we just see logName: "projects/intrinsic-integration-tests/logs/stdout".

Documentaiton for log_key_name (https://docs.fluentbit.io/manual/pipeline/outputs/stackdriver) links to
https://github.com/fluent/fluent-bit-docs/blob/master/pipeline/outputs/stackdriver_special_fields.md#log-entry-fields, but that does not explain how the value for logNam is determined nor how it can be configured.

Your Environment

Additional context
We're defining logs-based metrics to understand which container log how much. Having variance in the logName causes the metric to fail.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions