Skip to content

Don't generate attribute keys with unknown types #208

@lmolkova

Description

@lmolkova

Semconv tooling is being expanded to support attributes with any value (on logs/events for the time being) in open-telemetry/weaver#707.

Once such attribute is defined in semconv (ETA 1-2 month from now), Java code generation here

{% if attribute is deprecated %}@Deprecated{% endif %} public static final {{ to_java_key_type(attribute) | trim }} {{ attribute.name | screaming_snake_case }} = {{ to_java_key_factory(attribute) | trim }}("{{ attribute.name }}");

will start producing invalid code since there is no mapping defined for any in java_template_key_factory and it's not trivial to add it (given incubating ExtendedAttributes and other uncertainties around this).

The recommendation is to update jinja to exclude all any (and other future unknown) attribute types from codegen for the time being.

Note: another supported variation of this would be template[any]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions