Generate incubating metric name, unit, and description constants#483
Draft
ADITYA-CODE-SOURCE wants to merge 1 commit into
Draft
Generate incubating metric name, unit, and description constants#483ADITYA-CODE-SOURCE wants to merge 1 commit into
ADITYA-CODE-SOURCE wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add metric constant code generation to the incubating semconv artifact.
This introduces
{Namespace}IncubatingMetricsclasses that expose metric name, unit, and description constants from the semconv metric model, following the existing Java semconv codegen organization and incubating-first rollout.What this changes
IncubatingSemanticMetrics.java.j2for incubating metric constant generationbuildscripts/templates/registry/incubating_java/weaver.yamlSemanticMetrics.java.j2scaffold for follow-up workbuildscripts/templates/registry/java/weaver.yamlentry commented out*IncubatingMetrics.javaclasses undersemconv-incubatingGenerated API shape
Each metric generates three constants:
Example generated class:
Why incubating only
Per maintainer guidance, the pattern itself is being introduced experimentally first.
Even when the underlying metric semconv is stable, the generated Java metric constants are introduced in
opentelemetry-semconv-incubatingfirst so the class layout, naming, and API shape can be reviewed before promoting stable generation intoopentelemetry-semconv.Validation
Locally verified with:
./gradlew clean generateSemanticConventions --console=plain./gradlew spotlessApply:semconv-incubating:compileJava:semconv-incubating:checkstyleMain:semconv-incubating:spotlessCheck:semconv:compileJava:semconv:checkstyleMain:semconv:spotlessCheckFollow-up
Once the pattern is approved, a follow-up PR can:
semconvReferences
cc @jack-berg