Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova committed Jul 27, 2024
1 parent 7c81e64 commit 1c4b978
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion scripts/semconv/templates/registry/common.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ from deprecated import deprecated

{%- macro print_value(type, value) -%}
{%- if type == "string" -%}"{{value}}"{%-else-%}{{value}}{%-endif-%}
{%- endmacro -%}
{%- endmacro -%}
2 changes: 1 addition & 1 deletion scripts/semconv/templates/registry/semantic_metrics.j2
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ CallbackT = Union[
from typing import Final
{{ import_instrument_classes(filtered_metrics) }}

{%- for metric in ctx.metrics %}
{%- for metric in ctx.metrics | sort(attribute="metric_name") %}
{% set const_name = c.to_const_name(metric.metric_name) %}
{{const_name}}: Final = "{{metric.metric_name}}"
{%- set doc_string=write_docstring(metric, const_name, "")-%}{%- if doc_string %}
Expand Down
16 changes: 9 additions & 7 deletions scripts/semconv/templates/registry/weaver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ templates:
"exclude_root_namespace": $excluded_namespaces,
"exclude_stability": if $filter == "any" then [] else ["experimental"] end,
})
| . + {
output: $output + "attributes/",
stable_package_name: $stable_package_name + ".attributes",
filter: $filter,
excluded_attributes: $excluded_attributes[]
}
| map({
root_namespace: .root_namespace,
attributes: .attributes,
output: $output + "attributes/",
stable_package_name: $stable_package_name + ".attributes",
filter: $filter,
excluded_attributes: $excluded_attributes[]
})
application_mode: each
- pattern: semantic_metrics.j2
filter: >
Expand All @@ -25,7 +27,7 @@ templates:
})
| map({
root_namespace: .root_namespace,
metrics: .metrics | sort_by(.metric_name),
metrics: .metrics,
output: $output + "metrics/",
stable_package_name: $stable_package_name + ".metrics",
filter: $filter
Expand Down

0 comments on commit 1c4b978

Please sign in to comment.