Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dedotting by default is not working on metricbeat Kubernetes module #13409

Closed
jsoriano opened this issue Aug 29, 2019 · 0 comments · Fixed by #13414
Closed

Dedotting by default is not working on metricbeat Kubernetes module #13409

jsoriano opened this issue Aug 29, 2019 · 0 comments · Fixed by #13414
Assignees
Labels
bug containers Related to containers use case Metricbeat Metricbeat module Team:Integrations Label for the Integrations team

Comments

@jsoriano
Copy link
Member

In Beats 6.7 we introduced dedotting options to all known places where dedotting could be needed for labels and annotations, and in 7.0 we set these options to true by default, so dedotting is done unless otherwise wanted (see #9860).

This is not working for metricbeat Kubernetes module, where at least labels collected by the container metricset are not dedotted.

I think that the problem is how we initialize the meta generator in the metadata enricher, there we do:

        metaConfig := kubernetes.MetaGeneratorConfig{}
        if err := base.Module().UnpackConfig(&metaConfig); err != nil {
                logp.Err("Error initializing Kubernetes metadata enricher: %s", err)
                return &nilEnricher{}
        }

        metaGen := kubernetes.NewMetaGeneratorFromConfig(&metaConfig)

So metaConfig has an empty configuration. We should have a kubernetes.DefaultMetaGeneratorConfig() that generates a default configuration, and use it any time we initialize configurations of this type.

func DefaultMetaGeneratorConfig() MetaGeneratorConfig {
    return MetaGeneratorConfig {
                IncludeCreatorMetadata: true,
                LabelsDedot:            true,
                AnnotationsDedot:       true,
    }
} 

Not sure if IncludeCreatorMetadata is also wanted, but it is enabled by default in kubernetes.NewMetaGenerator.

For confirmed bugs, please report:

  • Version: 7.x
  • Steps to Reproduce: Use the kubernetes module with containers with dots in their labels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug containers Related to containers use case Metricbeat Metricbeat module Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants