diff --git a/apps/opentelemetry_semantic_conventions/makefile b/apps/opentelemetry_semantic_conventions/makefile index 27cbddfba..2234c56d7 100644 --- a/apps/opentelemetry_semantic_conventions/makefile +++ b/apps/opentelemetry_semantic_conventions/makefile @@ -35,13 +35,13 @@ generate: generate-elixir generate-erlang format-and-test generate-elixir: weaver registry generate --registry=semtmp/model --templates=templates --param output=lib/ --param stability=stable elixir . - weaver registry generate --registry=semtmp/model --templates=templates --param output=lib/incubating/ --param stability=experimental elixir . + weaver registry generate --registry=semtmp/model --templates=templates --param output=lib/incubating/ --param stability=incubating elixir . generate-erlang: weaver registry generate --registry=semtmp/model --templates=templates --param output=include/ --param stability=stable erlang . - weaver registry generate --registry=semtmp/model --templates=templates --param output=include/incubating/ --param stability=experimental erlang . + weaver registry generate --registry=semtmp/model --templates=templates --param output=include/incubating/ --param stability=incubating erlang . format-and-test: mix format mix docs - mix test \ No newline at end of file + mix test diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_attributes.ex.j2 b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_attributes.ex.j2 index 0509b4759..d85057a0b 100644 --- a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_attributes.ex.j2 +++ b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_attributes.ex.j2 @@ -6,7 +6,7 @@ {%- set module_name = ctx.id | pascal_case | acronym ~ "Attributes" -%} {%- set incubating_module_namespace = "OpenTelemetry.SemConv.Incubating" -%} {%- set stable_module_namespace = "OpenTelemetry.SemConv" -%} -{%- if params.stability == "experimental" -%} +{%- if params.stability != "stable" -%} {%- set module_namespace = incubating_module_namespace -%} {%- else -%} {%- set module_namespace = stable_module_namespace -%} @@ -16,7 +16,7 @@ defmodule {{ module_namespace }}.{{ module_name }} do @moduledoc """ OpenTelemetry Semantic Conventions for {{ ctx.id | title | acronym }} attributes. """ -{%- if params.stability == "experimental" and (ctx.all_attributes | length) > (ctx.attributes | length) %} +{%- if params.stability != "stable" and (ctx.all_attributes | length) > (ctx.attributes | length) %} {%- for attribute in ctx.all_attributes | sort(attribute="name") %} {%- if attribute is stable %} defdelegate {{ c.func_name(attribute.name) }}(), to: {{ stable_module_namespace }}.{{ module_name }} @@ -34,7 +34,7 @@ defmodule {{ module_namespace }}.{{ module_name }} do ### Enum Values {% for member in attribute.type.members -%} * `{{ c.to_atom(member.id) }}` - {%- if member is experimental %} ^[e](`m:OpenTelemetry.SemConv#experimental`)^{% endif %}{% if member.brief != none %} - {% if member is deprecated %}**deprecated** ~~{% endif %}{{ member.brief }}{% if member is deprecated %}~~{% endif %}{% endif %} + {%- if member.stability is defined and member.stability != "stable" %} ^[e](`m:OpenTelemetry.SemConv#experimental`)^{% endif %}{% if member.brief != none %} - {% if member is deprecated %}**deprecated** ~~{% endif %}{{ member.brief }}{% if member is deprecated %}~~{% endif %}{% endif %} {% endfor -%} """ @type {{ c.func_name(attribute.name) }}_values() :: {{ c.enum_to_map(attribute.type.members) }} diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_metrics.ex.j2 b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_metrics.ex.j2 index d22fc6093..224929660 100644 --- a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_metrics.ex.j2 +++ b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/semantic_metrics.ex.j2 @@ -5,7 +5,7 @@ {{ template.set_file_name(file_name) }} {%- set module_name = ctx.id | pascal_case | acronym ~ "Metrics" -%} -{%- if params.stability == "experimental" -%} +{%- if params.stability != "stable" -%} {%- set module_namespace = "OpenTelemetry.SemConv.Incubating.Metrics" -%} {%- else -%} {%- set module_namespace = "OpenTelemetry.SemConv.Metrics" -%} diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/weaver.yaml b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/weaver.yaml index 4e4370502..986acd250 100644 --- a/apps/opentelemetry_semantic_conventions/templates/registry/elixir/weaver.yaml +++ b/apps/opentelemetry_semantic_conventions/templates/registry/elixir/weaver.yaml @@ -10,11 +10,11 @@ templates: | map(select(.type == "attribute_group")) | map(select(.id | startswith("registry."))) | map({ id: .id, group_id: .id | split(".") | .[1], attributes: .attributes}) - | map(select([.attributes[] | select(.stability == $stability)] | any)) + | map(select([.attributes[] | select(($stability == "stable" and .stability == "stable") or ($stability != "stable" and .stability != "stable"))] | any)) | group_by(.group_id) | map({ id: .[0].group_id, - attributes: [.[].attributes[] | select(.stability == $stability) | (select( .name as $id | any( $excluded_attrs[]; . == $id ) | not ))] | sort_by(.id), + attributes: [.[].attributes[] | select(($stability == "stable" and .stability == "stable") or ($stability != "stable" and .stability != "stable")) | (select( .name as $id | any( $excluded_attrs[]; . == $id ) | not ))] | sort_by(.id), all_attributes: [.[].attributes[]] | sort_by(.id), output: $output + "/attributes/" }) @@ -25,7 +25,7 @@ templates: filter: > .groups | map(select(.type == "metric")) - | map(select(.stability == $stability)) + | map(select(($stability == "stable" and .stability == "stable") or ($stability != "stable" and .stability != "stable"))) | map({ id: .id, group_id: .id | split(".") | .[1], brief, unit, stability, deprecated, instrument, metric_name, note}) | group_by(.group_id) | map({ diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_attributes.hrl.j2 b/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_attributes.hrl.j2 index edc3f77d3..474ef020b 100644 --- a/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_attributes.hrl.j2 +++ b/apps/opentelemetry_semantic_conventions/templates/registry/erlang/semantic_attributes.hrl.j2 @@ -15,7 +15,7 @@ %% See the License for the specific language governing permissions and %% limitations under the License. %%%------------------------------------------------------------------------- -{%- if params.stability == "experimental" and (ctx.all_attributes | length) > (ctx.attributes | length) %} +{%- if params.stability != "stable" and (ctx.all_attributes | length) > (ctx.attributes | length) %} -include_lib("opentelemetry_semantic_conventions/include/attributes/{{ c.file_name(ctx.id) }}_attributes.hrl"). {% endif -%} {%- for attribute in ctx.attributes | sort(attribute="name") %} diff --git a/apps/opentelemetry_semantic_conventions/templates/registry/erlang/weaver.yaml b/apps/opentelemetry_semantic_conventions/templates/registry/erlang/weaver.yaml index a82e13ec2..e403dce30 100644 --- a/apps/opentelemetry_semantic_conventions/templates/registry/erlang/weaver.yaml +++ b/apps/opentelemetry_semantic_conventions/templates/registry/erlang/weaver.yaml @@ -10,11 +10,11 @@ templates: | map(select(.type == "attribute_group")) | map(select(.id | startswith("registry."))) | map({ id: .id, group_id: .id | split(".") | .[1], attributes: .attributes}) - | map(select([.attributes[] | select(.stability == $stability)] | any)) + | map(select([.attributes[] | select(($stability == "stable" and .stability == "stable") or ($stability != "stable" and .stability != "stable"))] | any)) | group_by(.group_id) | map({ id: .[0].group_id, - attributes: [.[].attributes[] | select(.stability == $stability) | (select( .name as $id | any( $excluded_attrs[]; . == $id ) | not ))] | sort_by(.id), + attributes: [.[].attributes[] | select(($stability == "stable" and .stability == "stable") or ($stability != "stable" and .stability != "stable")) | (select( .name as $id | any( $excluded_attrs[]; . == $id ) | not ))] | sort_by(.id), all_attributes: [.[].attributes[]], output: $output + "/attributes/" }) @@ -25,7 +25,7 @@ templates: filter: > .groups | map(select(.type == "metric")) - | map(select(.stability == $stability)) + | map(select(($stability == "stable" and .stability == "stable") or ($stability != "stable" and .stability != "stable"))) | map({ id: .id, group_id: .id | split(".") | .[1], brief, unit, stability, deprecated, instrument, metric_name, note}) | group_by(.group_id) | map({