Skip to content

Generated telemetry metrics always includes context import #10883

@MikeGoldsmith

Description

@MikeGoldsmith

Describe the bug
Generated telemetry files always includes the context import when there are metrics. However, this is only needed when generating async metrics. It has to be removed to make the file valid (eg manually or gofmt).

Steps to reproduce
Generate telemetry for a component with a non-async metric. The output go file will have the unused imports.

What did you expect to see?
Imports are only the context import when generating async metrics.

What did you see instead?
Context import are always included when generating any metrics.

What version did you use?
Latest

What config did you use?
N/A

Environment
N/A

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions