Skip to content

Update semconv scripts to support extended stability levels #823

Open
@lmolkova

Description

@lmolkova

Erlang uses exact match for stability

weaver registry generate --registry=semtmp/model --templates=templates --param output=lib/incubating/ --param stability=experimental elixir .

It works great for stable level, but we're adopting other levels (open-telemetry/semantic-conventions#1096) in semconv and starting to use development, rc.

You can either leverage new semconv_grouped_attributes helper in weaver

(e.g. here's how Java uses it)

  - pattern: SemanticAttributes.java.j2
    filter: >
      semconv_grouped_attributes({
        "exclude_root_namespace": $excluded_namespaces,
        "exclude_stability": ["experimental"] # experimental here is fine, weaver matches all non-stable things to it
      }) | map({
          root_namespace: .root_namespace,
          attributes: .attributes,
          excluded_attributes: $excluded_attributes
      })

or replace logic inside

{%- if params.stability == "experimental" and (ctx.all_attributes | length) > (ctx.attributes | length) %}
to cover other stability levels.

E.g. you might find weaver experimental and other similar helpers useful.

{% if attribute is experimental %}
...
{% if attribute is stable%}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestsemconvSemantic Convetions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions