Skip to content

Commit 9c93cf2

Browse files
authored
Semconv 1.23.1 (#36)
* Remove unused generator arg * Use generator 0.23.0 * Upgrade to semconv 1.23.1 * Include metric attributes in SemanticAttributes
1 parent f78c32b commit 9c93cf2

File tree

4 files changed

+1620
-1378
lines changed

4 files changed

+1620
-1378
lines changed

build.gradle.kts

+5-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ val snapshot = true
1717
// end
1818

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

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

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

@@ -105,11 +105,10 @@ val generateSemanticAttributes by tasks.registering(Exec::class) {
105105
"-v", "$projectDir/buildscripts/templates:/templates",
106106
"-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output",
107107
"otel/semconvgen:$generatorVersion",
108-
"--only", "span,event,attribute_group,scope",
109-
"-f", "/source", "code",
108+
"--only", "span,event,attribute_group,scope,metric",
109+
"--yaml-root", "/source", "code",
110110
"--template", "/templates/SemanticAttributes.java.j2",
111111
"--output", "/output/SemanticAttributes.java",
112-
"-Dsemconv=trace",
113112
"-Dclass=SemanticAttributes",
114113
"-DschemaUrl=$schemaUrl",
115114
"-Dpkg=io.opentelemetry.semconv"))
@@ -128,7 +127,7 @@ val generateResourceAttributes by tasks.registering(Exec::class) {
128127
"-v", "$projectDir/src/main/java/io/opentelemetry/semconv/:/output",
129128
"otel/semconvgen:$generatorVersion",
130129
"--only", "resource",
131-
"-f", "/source", "code",
130+
"--yaml-root", "/source", "code",
132131
"--template", "/templates/SemanticAttributes.java.j2",
133132
"--output", "/output/ResourceAttributes.java",
134133
"-Dclass=ResourceAttributes",

buildscripts/templates/SemanticAttributes.java.j2

+48
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,30 @@ public final class {{class}} {
122122

123123
{%- endfor %}
124124

125+
{%- if class_name == "MessagingOperationValues" %}
126+
127+
/**
128+
* process.
129+
*
130+
* @deprecated this value has been removed as of 1.23.1 of the semantic conventions.
131+
*/
132+
@Deprecated
133+
public static final String PROCESS = "process";
134+
135+
{% endif %}
136+
137+
{%- if class_name == "SystemMemoryStateValues" %}
138+
139+
/**
140+
* total.
141+
*
142+
* @deprecated this value has been removed as of 1.23.1 of the semantic conventions.
143+
*/
144+
@Deprecated
145+
public static final String TOTAL = "total";
146+
147+
{% endif %}
148+
125149
private {{ class_name }}() {}
126150
}
127151

@@ -820,6 +844,30 @@ public final class {{class}} {
820844
private TypeValues() {}
821845
}
822846

847+
/**
848+
* Whether the thread is daemon or not.
849+
*
850+
* @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use {@link SemanticAttributes#JVM_THREAD_DAEMON} instead.
851+
*/
852+
@Deprecated
853+
public static final AttributeKey<Boolean> THREAD_DAEMON = booleanKey("thread.daemon");
854+
855+
/**
856+
* The ordinal number of request resending attempt (for any reason, including redirects).
857+
*
858+
* <p>Notes:
859+
*
860+
* <ul>
861+
* <li>The resend count SHOULD be updated each time an HTTP request gets resent by the client,
862+
* regardless of what was the cause of the resending (e.g. redirection, authorization
863+
* failure, 503 Server Unavailable, network issues, or any other).
864+
* </ul>
865+
*
866+
* @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use {@link SemanticAttributes#HTTP_REQUEST_RESEND_COUNT} instead.
867+
*/
868+
@Deprecated
869+
public static final AttributeKey<Long> HTTP_RESEND_COUNT = longKey("http.resend_count");
870+
823871
{% endif %}
824872

825873
{%- if class == "ResourceAttributes" %}

0 commit comments

Comments
 (0)