Skip to content

Commit 24a1f85

Browse files
authored
Semconv 1.24.0 (#46)
* Upgrade to semconv 1.24.0 * Exclude aspnetcore, signalr root namespaces
1 parent ede8688 commit 24a1f85

23 files changed

+742
-106
lines changed

build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ val snapshot = true
1111
// end
1212

1313
// The release version of https://github.com/open-telemetry/semantic-conventions used to generate classes
14-
var semanticConventionsVersion = "1.23.1"
15-
val schemaUrlVersions = listOf(semanticConventionsVersion, "1.22.0")
14+
var semanticConventionsVersion = "1.24.0"
15+
val schemaUrlVersions = listOf(
16+
semanticConventionsVersion,
17+
"1.23.1",
18+
"1.22.0")
1619

1720
// Compute the artifact version, which includes the "-alpha" suffix and includes "-SNAPSHOT" suffix if not releasing
1821
// Release example: version=1.21.0-alpha
@@ -48,8 +51,6 @@ nexusPublishing {
4851
}
4952

5053
// start - define tasks to download, unzip, and generate from opentelemetry/semantic-conventions
51-
// Using image built from feature branch: https://github.com/open-telemetry/build-tools/tree/feature/codegen-by-namespace
52-
// TODO: upgrade to official release when features are incorporated into main
5354
var generatorVersion = "0.24.0"
5455
val semanticConventionsRepoZip = "https://github.com/open-telemetry/semantic-conventions/archive/v$semanticConventionsVersion.zip"
5556
val schemaUrl = "https://opentelemetry.io/schemas/$semanticConventionsVersion"
@@ -99,7 +100,7 @@ fun generateTask(taskName: String, incubating: Boolean) {
99100
"--output", "/output/{{pascal_prefix}}${classPrefix}Attributes.java",
100101
"--file-per-group", "root_namespace",
101102
// Space delimited list of root namespaces to excluded (i.e. "foo bar")
102-
"-Dexcluded_namespaces=\"ios\"",
103+
"-Dexcluded_namespaces=\"ios aspnetcore signalr\"",
103104
"-Dfilter=${filter}",
104105
"-DclassPrefix=${classPrefix}",
105106
"-Dpkg=$packageNameArg",

semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/CodeIncubatingAttributes.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,11 @@ public final class CodeIncubatingAttributes {
4545
*/
4646
public static final AttributeKey<String> CODE_NAMESPACE = stringKey("code.namespace");
4747

48+
/**
49+
* A stacktrace as a string in the natural representation for the language runtime. The
50+
* representation is to be determined and documented by each language SIG.
51+
*/
52+
public static final AttributeKey<String> CODE_STACKTRACE = stringKey("code.stacktrace");
53+
4854
private CodeIncubatingAttributes() {}
4955
}

semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DbIncubatingAttributes.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public final class DbIncubatingAttributes {
4949
longKey("db.cassandra.speculative_execution_count");
5050

5151
/**
52-
* The name of the primary table that the operation is acting upon, including the keyspace name
53-
* (if applicable).
52+
* The name of the primary Cassandra table that the operation is acting upon, including the
53+
* keyspace name (if applicable).
5454
*
5555
* <p>Notes:
5656
*
@@ -128,6 +128,15 @@ public final class DbIncubatingAttributes {
128128
public static final AttributeKeyTemplate<String> DB_ELASTICSEARCH_PATH_PARTS =
129129
stringKeyTemplate("db.elasticsearch.path_parts");
130130

131+
/**
132+
* An identifier (address, unique name, or any other identifier) of the database instance that is
133+
* executing queries or mutations on the current connection. This is useful in cases where the
134+
* database is running in a clustered environment and the instrumentation is able to record the
135+
* node executing the query. The client may obtain this value in databases like MySQL using
136+
* queries like {@code select @@hostname}.
137+
*/
138+
public static final AttributeKey<String> DB_INSTANCE_ID = stringKey("db.instance.id");
139+
131140
/**
132141
* The fully-qualified class name of the <a
133142
* href="https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/">Java Database Connectivity
@@ -136,7 +145,7 @@ public final class DbIncubatingAttributes {
136145
public static final AttributeKey<String> DB_JDBC_DRIVER_CLASSNAME =
137146
stringKey("db.jdbc.driver_classname");
138147

139-
/** The collection being accessed within the database stated in {@code db.name}. */
148+
/** The MongoDB collection being accessed within the database stated in {@code db.name}. */
140149
public static final AttributeKey<String> DB_MONGODB_COLLECTION =
141150
stringKey("db.mongodb.collection");
142151

semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DeploymentIncubatingAttributes.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ public final class DeploymentIncubatingAttributes {
1717
/**
1818
* Name of the <a href="https://wikipedia.org/wiki/Deployment_environment">deployment
1919
* environment</a> (aka deployment tier).
20+
*
21+
* <p>Notes:
22+
*
23+
* <ul>
24+
* <li>{@code deployment.environment} does not affect the uniqueness constraints defined through
25+
* the {@code service.namespace}, {@code service.name} and {@code service.instance.id}
26+
* resource attributes. This implies that resources carrying the following attribute
27+
* combinations MUST be considered to be identifying the same service:
28+
* <li>{@code service.name=frontend}, {@code deployment.environment=production}
29+
* <li>{@code service.name=frontend}, {@code deployment.environment=staging}.
30+
* </ul>
2031
*/
2132
public static final AttributeKey<String> DEPLOYMENT_ENVIRONMENT =
2233
stringKey("deployment.environment");

semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/DeviceIncubatingAttributes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public final class DeviceIncubatingAttributes {
5454
* <p>Notes:
5555
*
5656
* <ul>
57-
* <li>It's recommended this value represents a machine readable version of the model identifier
57+
* <li>It's recommended this value represents a machine-readable version of the model identifier
5858
* rather than the market or consumer-friendly name of the device.
5959
* </ul>
6060
*/
@@ -67,8 +67,8 @@ public final class DeviceIncubatingAttributes {
6767
* <p>Notes:
6868
*
6969
* <ul>
70-
* <li>It's recommended this value represents a human readable version of the device model
71-
* rather than a machine readable alternative.
70+
* <li>It's recommended this value represents a human-readable version of the device model
71+
* rather than a machine-readable alternative.
7272
* </ul>
7373
*/
7474
public static final AttributeKey<String> DEVICE_MODEL_NAME = stringKey("device.model.name");
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.semconv.incubating;
7+
8+
import static io.opentelemetry.api.common.AttributeKey.stringKey;
9+
10+
import io.opentelemetry.api.common.AttributeKey;
11+
12+
// DO NOT EDIT, this is an Auto-generated file from
13+
// buildscripts/templates/SemanticAttributes.java.j2
14+
@SuppressWarnings("unused")
15+
public final class DiskIncubatingAttributes {
16+
17+
/** The disk IO operation direction. */
18+
public static final AttributeKey<String> DISK_IO_DIRECTION = stringKey("disk.io.direction");
19+
20+
// Enum definitions
21+
/** Values for {@link #DISK_IO_DIRECTION}. */
22+
public static final class DiskIoDirectionValues {
23+
/** read. */
24+
public static final String READ = "read";
25+
26+
/** write. */
27+
public static final String WRITE = "write";
28+
29+
private DiskIoDirectionValues() {}
30+
}
31+
32+
private DiskIncubatingAttributes() {}
33+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.semconv.incubating;
7+
8+
import static io.opentelemetry.api.common.AttributeKey.stringKey;
9+
10+
import io.opentelemetry.api.common.AttributeKey;
11+
12+
// DO NOT EDIT, this is an Auto-generated file from
13+
// buildscripts/templates/SemanticAttributes.java.j2
14+
@SuppressWarnings("unused")
15+
public final class DnsIncubatingAttributes {
16+
17+
/**
18+
* The name being queried.
19+
*
20+
* <p>Notes:
21+
*
22+
* <ul>
23+
* <li>The name being queried. If the name field contains non-printable characters (below 32 or
24+
* above 126), those characters should be represented as escaped base 10 integers (\DDD).
25+
* Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should
26+
* be converted to \t, \r, and \n respectively.
27+
* </ul>
28+
*/
29+
public static final AttributeKey<String> DNS_QUESTION_NAME = stringKey("dns.question.name");
30+
31+
private DnsIncubatingAttributes() {}
32+
}

semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/EventIncubatingAttributes.java

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,19 @@
1515
public final class EventIncubatingAttributes {
1616

1717
/**
18-
* The domain identifies the business context for the events.
18+
* Identifies the class / type of event.
1919
*
2020
* <p>Notes:
2121
*
2222
* <ul>
23-
* <li>Events across different domains may have same {@code event.name}, yet be unrelated
24-
* events.
23+
* <li>Event names are subject to the same rules as <a
24+
* href="https://github.com/open-telemetry/opentelemetry-specification/tree/v1.26.0/specification/common/attribute-naming.md">attribute
25+
* names</a>. Notably, event names are namespaced to avoid collisions and provide a clean
26+
* separation of semantics for events in separate domains like browser, mobile, and
27+
* kubernetes.
2528
* </ul>
2629
*/
27-
public static final AttributeKey<String> EVENT_DOMAIN = stringKey("event.domain");
28-
29-
/** The name identifies the event. */
3030
public static final AttributeKey<String> EVENT_NAME = stringKey("event.name");
3131

32-
// Enum definitions
33-
/** Values for {@link #EVENT_DOMAIN}. */
34-
public static final class EventDomainValues {
35-
/** Events from browser apps. */
36-
public static final String BROWSER = "browser";
37-
38-
/** Events from mobile apps. */
39-
public static final String DEVICE = "device";
40-
41-
/** Events from Kubernetes. */
42-
public static final String K8S = "k8s";
43-
44-
private EventDomainValues() {}
45-
}
46-
4732
private EventIncubatingAttributes() {}
4833
}

semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/ExceptionIncubatingAttributes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public final class ExceptionIncubatingAttributes {
3030
* <li>It is usually not possible to determine at the point where an exception is thrown whether
3131
* it will escape the scope of a span. However, it is trivial to know that an exception will
3232
* escape, if one checks for an active exception just before ending the span, as done in the
33-
* <a href="#recording-an-exception">example above</a>.
33+
* <a href="#recording-an-exception">example for recording span exceptions</a>.
3434
* <li>It follows that an exception may still escape the scope of the span even if the {@code
3535
* exception.escaped} attribute was not set or set to false, since the event might have been
3636
* recorded at a time where it was not clear whether the exception will escape.

semconv-incubating/src/main/java/io/opentelemetry/semconv/incubating/HostIncubatingAttributes.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ public final class HostIncubatingAttributes {
2323
/** The amount of level 2 memory cache available to the processor (in Bytes). */
2424
public static final AttributeKey<Long> HOST_CPU_CACHE_L2_SIZE = longKey("host.cpu.cache.l2.size");
2525

26-
/** Numeric value specifying the family or generation of the CPU. */
27-
public static final AttributeKey<Long> HOST_CPU_FAMILY = longKey("host.cpu.family");
26+
/** Family or generation of the CPU. */
27+
public static final AttributeKey<String> HOST_CPU_FAMILY = stringKey("host.cpu.family");
2828

2929
/**
3030
* Model identifier. It provides more granular information about the CPU, distinguishing it from
3131
* other CPUs within the same family.
3232
*/
33-
public static final AttributeKey<Long> HOST_CPU_MODEL_ID = longKey("host.cpu.model.id");
33+
public static final AttributeKey<String> HOST_CPU_MODEL_ID = stringKey("host.cpu.model.id");
3434

3535
/** Model designation of the processor. */
3636
public static final AttributeKey<String> HOST_CPU_MODEL_NAME = stringKey("host.cpu.model.name");
@@ -66,7 +66,7 @@ public final class HostIncubatingAttributes {
6666

6767
/**
6868
* The version string of the VM image or host OS as defined in <a
69-
* href="README.md#version-attributes">Version Attributes</a>.
69+
* href="/docs/resource/README.md#version-attributes">Version Attributes</a>.
7070
*/
7171
public static final AttributeKey<String> HOST_IMAGE_VERSION = stringKey("host.image.version");
7272

0 commit comments

Comments
 (0)