Skip to content

Commit

Permalink
Semconv 1.23.1 (#36)
Browse files Browse the repository at this point in the history
* Remove unused generator arg

* Use generator 0.23.0

* Upgrade to semconv 1.23.1

* Include metric attributes in SemanticAttributes
  • Loading branch information
jack-berg authored Nov 21, 2023
1 parent f78c32b commit 9c93cf2
Show file tree
Hide file tree
Showing 4 changed files with 1,620 additions and 1,378 deletions.
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" %}

/**
* 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

0 comments on commit 9c93cf2

Please sign in to comment.