Skip to content

Commit

Permalink
Don't render deprecated enum members in semconv tables (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmolkova authored Jun 3, 2024
1 parent 6a0a75e commit c80cd1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .chloggen/1110.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
change_type: enhancement

component: other

note: "Don't render deprecated enum members in semconv tables."

issues: [1110]
2 changes: 0 additions & 2 deletions docs/system/system-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ available on the system, that is `system.memory.limit`.
| `buffers` | buffers | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `cached` | cached | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `free` | free | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `shared` | shared | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Removed, report shared memory usage with `metric.system.memory.shared` metric |
| `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) |


Expand Down Expand Up @@ -459,7 +458,6 @@ This metric is [recommended][MetricRecommended].
| `buffers` | buffers | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `cached` | cached | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `free` | free | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `shared` | shared | ![Deprecated](https://img.shields.io/badge/-deprecated-red)<br>Removed, report shared memory usage with `metric.system.memory.shared` metric |
| `used` | used | ![Experimental](https://img.shields.io/badge/-experimental-blue) |


Expand Down
5 changes: 3 additions & 2 deletions templates/registry/markdown/enum_macros.j2
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{% import 'stability.j2' as stability %}
{% macro filter(member) %}{% if snippet_type is not defined or (member.deprecated is none or member.deprecated == "") %}{{ "True" }}{% else %}{{ "False" }}{% endif %}{% endmacro %}
{% macro table(enum, notes) %}
`{{enum.name}}` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
{% for espec in enum.type.members | sort(attribute='value') %}| `{{ espec.value }}` | {{ (espec.brief or espec.id) | trim }}{{ notes.add(espec.note) }} | {{ stability.badge(espec.stability, espec.deprecated) }} |
{% endfor %}{{ notes.render() }}{% endmacro %}
{% for espec in enum.type.members | sort(attribute='value') %}{% if filter(espec) == "True" %}| `{{ espec.value }}` | {{ (espec.brief or espec.id) | trim }}{{ notes.add(espec.note) }} | {{ stability.badge(espec.stability, espec.deprecated) }} |
{% endif %}{% endfor %}{{ notes.render() }}{% endmacro %}
{% macro tables(enums, notes) %}{% for enum in enums | sort(attribute="name") %}{{ table(enum, notes) }}
{% endfor %}{% endmacro %}

0 comments on commit c80cd1f

Please sign in to comment.