Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semconv 1.23.1 #36

Merged
merged 5 commits into from
Nov 21, 2023
Merged
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
11 changes: 5 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ val snapshot = true
// end

// The release version of https://github.com/open-telemetry/semantic-conventions used to generate classes
var semanticConventionsVersion = "1.22.0"
var semanticConventionsVersion = "1.23.1"

// Compute the artifact version, which includes the "-alpha" suffix and includes "-SNAPSHOT" suffix if not releasing
// Release example: version=1.21.0-alpha
Expand Down Expand Up @@ -71,7 +71,7 @@ dependencies {
}

// start - define tasks to download, unzip, and generate from opentelemetry/semantic-conventions
var generatorVersion = "0.22.0"
var generatorVersion = "0.23.0"
val semanticConventionsRepoZip = "https://github.com/open-telemetry/semantic-conventions/archive/v$semanticConventionsVersion.zip"
val schemaUrl = "https://opentelemetry.io/schemas/$semanticConventionsVersion"

Expand Down Expand Up @@ -105,11 +105,10 @@ val generateSemanticAttributes by tasks.registering(Exec::class) {
"-v", "$projectDir/buildscripts/templates:/templates",
"-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output",
"otel/semconvgen:$generatorVersion",
"--only", "span,event,attribute_group,scope",
"-f", "/source", "code",
"--only", "span,event,attribute_group,scope,metric",
"--yaml-root", "/source", "code",
"--template", "/templates/SemanticAttributes.java.j2",
"--output", "/output/SemanticAttributes.java",
"-Dsemconv=trace",
"-Dclass=SemanticAttributes",
"-DschemaUrl=$schemaUrl",
"-Dpkg=io.opentelemetry.semconv"))
Expand All @@ -128,7 +127,7 @@ val generateResourceAttributes by tasks.registering(Exec::class) {
"-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output",
"otel/semconvgen:$generatorVersion",
"--only", "resource",
"-f", "/source", "code",
"--yaml-root", "/source", "code",
"--template", "/templates/SemanticAttributes.java.j2",
"--output", "/output/ResourceAttributes.java",
"-Dclass=ResourceAttributes",
Expand Down
48 changes: 48 additions & 0 deletions buildscripts/templates/SemanticAttributes.java.j2
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,30 @@ public final class {{class}} {

{%- endfor %}

{%- if class_name == "MessagingOperationValues" %}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any evidence in the template that we've accommodated the removal of values from semantic conventions enums, which manifest as static inner classes. But this seemed like the most correct thing to do. Also, we're using japicmp to ensure we don't make incompatible changes (until we resolve #6) and not fixing this causes japicmp to fail.


/**
* process.
*
* @deprecated this value has been removed as of 1.23.1 of the semantic conventions.
*/
@Deprecated
public static final String PROCESS = "process";

{% endif %}

{%- if class_name == "SystemMemoryStateValues" %}

/**
* total.
*
* @deprecated this value has been removed as of 1.23.1 of the semantic conventions.
*/
@Deprecated
public static final String TOTAL = "total";

{% endif %}

private {{ class_name }}() {}
}

Expand Down Expand Up @@ -820,6 +844,30 @@ public final class {{class}} {
private TypeValues() {}
}

/**
* Whether the thread is daemon or not.
*
* @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use {@link SemanticAttributes#JVM_THREAD_DAEMON} instead.
*/
@Deprecated
public static final AttributeKey<Boolean> THREAD_DAEMON = booleanKey("thread.daemon");

/**
* The ordinal number of request resending attempt (for any reason, including redirects).
*
* <p>Notes:
*
* <ul>
* <li>The resend count SHOULD be updated each time an HTTP request gets resent by the client,
* regardless of what was the cause of the resending (e.g. redirection, authorization
* failure, 503 Server Unavailable, network issues, or any other).
* </ul>
*
* @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use {@link SemanticAttributes#HTTP_REQUEST_RESEND_COUNT} instead.
*/
@Deprecated
public static final AttributeKey<Long> HTTP_RESEND_COUNT = longKey("http.resend_count");

{% endif %}

{%- if class == "ResourceAttributes" %}
Expand Down
Loading