Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/opentelemetry_semantic_conventions/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
mix test
Original file line number Diff line number Diff line change
Expand Up @@ -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 -%}
Expand All @@ -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 }}
Expand All @@ -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) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
})
Expand All @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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") %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
})
Expand All @@ -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({
Expand Down