Skip to content

Conversation

@Kielek
Copy link
Member

@Kielek Kielek commented Jul 10, 2025

Changes

Handles changes from latest semantic convention releases.
Include Obsolete attributes on classes with all obsolete attributes.

Merge requirement checklist

  • CONTRIBUTING guidelines followed (license requirements, nullable enabled, static analysis, etc.)
  • [ ] Unit tests added/updated
  • Appropriate CHANGELOG.md files updated for non-trivial changes
  • Changes in public API reviewed (if applicable)

@github-actions github-actions bot added the comp:semanticconventions Things related to OpenTelemetry.SemanticConventions label Jul 10, 2025
@Kielek
Copy link
Member Author

Kielek commented Jul 10, 2025

Build is failing, the problem is with deprecated ios.state

It can be fixed by changing our template by

diff --git a/src/OpenTelemetry.SemanticConventions/Attributes/IosAttributes.cs b/src/OpenTelemetry.SemanticConventions/Attributes/IosAttributes.cs
index f1fb18bb..30ea72c9 100644
--- a/src/OpenTelemetry.SemanticConventions/Attributes/IosAttributes.cs
+++ b/src/OpenTelemetry.SemanticConventions/Attributes/IosAttributes.cs
@@ -60,7 +60,9 @@ public static class IosAttributes
         public const string Terminate = "terminate";
     }

-
+    /// <summary>
+    /// Replaced by the <c>ios.app.state</c> event body field.
+    /// </summary>
     [Obsolete("Replaced by the <c>ios.app.state</c> event body field.")]
     public static class IosStateValues
     {
diff --git a/src/OpenTelemetry.SemanticConventions/scripts/templates/registry/SemanticConventionsAttributes.cs.j2 b/src/OpenTelemetry.SemanticConventions/scripts/templates/registry/SemanticConventionsAttributes.cs.j2
index 0f7854d8..9416c35e 100644
--- a/src/OpenTelemetry.SemanticConventions/scripts/templates/registry/SemanticConventionsAttributes.cs.j2
+++ b/src/OpenTelemetry.SemanticConventions/scripts/templates/registry/SemanticConventionsAttributes.cs.j2
@@ -36,7 +36,7 @@ public static class {{my_class_name}}
 {% set enum_class_name = attribute.name | pascal_case ~ "Values" %}
 {% set attribute_resolved_type = attribute.type | instantiated_type %}

-    {{ attribute.brief | comment(indent=4) }}
+    {{ [attribute.brief or attribute.deprecated.note] | comment(indent=4) }}
     {% if attribute is deprecated %}
     [Obsolete("{{ attribute.deprecated.note | replace("\"", "") | comment(header="", footer="", prefix="", indent=0) }}")]
     {% endif %}

Alternative solution is to bring back brief attribute to https://github.com/open-telemetry/semantic-conventions/blob/v1.36.0/model/ios/deprecated/registry-deprecated.yaml - all other deprecated have it.

diff --git a/model/ios/deprecated/registry-deprecated.yaml b/model/ios/deprecated/registry-deprecated.yaml
index f3dc1bd0..119ded84 100644
--- a/model/ios/deprecated/registry-deprecated.yaml
+++ b/model/ios/deprecated/registry-deprecated.yaml
@@ -7,6 +7,7 @@ groups:
     attributes:
       - id: ios.state
         stability: development
+        brief: Deprecated. Use `ios.app.state` body field instead.
         deprecated:
           reason: uncategorized
           note:

Problematic PR: open-telemetry/semantic-conventions#2047

@lmolkova, what is your recommendation? There is no rush to bump to this version. We can wait for the next release.

@lmolkova
Copy link
Member

interesting! If I understand correctly, we removed the brief on ios.state (I'll add a check to catch it in the future)
and now .NET build complains that there is no comment?

Falling back to the deprecated.note makes sense as a workaround.

If you're fine waiting, I'll fix the semconv, but it's unlikely we'll have another release in the next couple of weeks.

@Kielek
Copy link
Member Author

Kielek commented Jul 10, 2025

We have here strict analyzers enabled. One of the requirements is to have documentation comment on every public class and fields.

Thanks for the fixes on the sem. Conv side

@Kielek
Copy link
Member Author

Kielek commented Jul 15, 2025

Closing for now, I will reopen when next release is available.

@Kielek Kielek closed this Jul 15, 2025
@Kielek Kielek mentioned this pull request Aug 26, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp:semanticconventions Things related to OpenTelemetry.SemanticConventions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants