Skip to content

Commit a9dd1ae

Browse files
committed
Update the semantic conventions version to 1.40.0
1 parent e9dd703 commit a9dd1ae

25 files changed

Lines changed: 658 additions & 29 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44

5+
* Bump to semconv v1.40.0
6+
([#PRNUM](https://github.com/open-telemetry/semantic-conventions-java/pull/PRNUM))
7+
58
## Version 1.39.0 (2026-01-28)
69

710
* Bump to semconv v1.39.0

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ 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.39.0"
14+
var semanticConventionsVersion = "1.40.0"
1515
val schemaUrlVersions = listOf(
1616
semanticConventionsVersion,
17+
"1.39.0",
1718
"1.38.0",
1819
"1.37.0",
1920
"1.36.0",

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,11 @@ public final class DbIncubatingAttributes {
425425
* href="/docs/db/database-spans.md#generating-a-summary-of-the-query">Generating query
426426
* summary</a> section.
427427
*
428+
* <p>For batch operations, if the individual operations are known to have the same query summary
429+
* then that query summary SHOULD be used prepended by {@code BATCH }, otherwise {@code
430+
* db.query.summary} SHOULD be {@code BATCH} or some other database system specific term if more
431+
* applicable.
432+
*
428433
* @deprecated deprecated in favor of stable {@link
429434
* io.opentelemetry.semconv.DbAttributes#DB_QUERY_SUMMARY} attribute.
430435
*/

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,11 @@ public final class ErrorIncubatingAttributes {
2424
*
2525
* <p>{@code error.message} is NOT RECOMMENDED for metrics or spans due to its unbounded
2626
* cardinality and overlap with span status.
27+
*
28+
* @deprecated Use domain-specific error message attribute. For example, use {@code
29+
* feature_flag.error.message} for feature flag errors.
2730
*/
28-
public static final AttributeKey<String> ERROR_MESSAGE = stringKey("error.message");
31+
@Deprecated public static final AttributeKey<String> ERROR_MESSAGE = stringKey("error.message");
2932

3033
/**
3134
* Describes a class of error the operation ended with.

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ public final class ExceptionIncubatingAttributes {
1616
/**
1717
* The exception message.
1818
*
19+
* <p>Notes:
20+
*
21+
* <blockquote>
22+
*
23+
* [!WARNING]
24+
*
25+
* <p>This attribute may contain sensitive information.
26+
*
27+
* </blockquote>
28+
*
1929
* @deprecated deprecated in favor of stable {@link
2030
* io.opentelemetry.semconv.ExceptionAttributes#EXCEPTION_MESSAGE} attribute.
2131
*/

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,16 @@ public final class FeatureFlagIncubatingAttributes {
1818
stringKey("feature_flag.context.id");
1919

2020
/**
21-
* Deprecated, use {@code error.message} instead.
21+
* A message providing more detail about an error that occurred during feature flag evaluation in
22+
* human-readable form.
23+
*/
24+
public static final AttributeKey<String> FEATURE_FLAG_ERROR_MESSAGE =
25+
stringKey("feature_flag.error.message");
26+
27+
/**
28+
* Deprecated, use {@code feature_flag.error.message} instead.
2229
*
23-
* @deprecated Replaced by {@code error.message}.
30+
* @deprecated Replaced by {@code feature_flag.error.message}.
2431
*/
2532
@Deprecated
2633
public static final AttributeKey<String> FEATURE_FLAG_EVALUATION_ERROR_MESSAGE =

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,24 @@ public final class GcpIncubatingAttributes {
176176
public static final AttributeKey<String> GCP_GCE_INSTANCE_NAME =
177177
stringKey("gcp.gce.instance.name");
178178

179+
/** The name of the Instance Group Manager (IGM) that manages this VM, if any. */
180+
public static final AttributeKey<String> GCP_GCE_INSTANCE_GROUP_MANAGER_NAME =
181+
stringKey("gcp.gce.instance_group_manager.name");
182+
183+
/**
184+
* The region of a <strong>regional</strong> Instance Group Manager (e.g., {@code us-central1}).
185+
* Set this <strong>only</strong> when the IGM is regional.
186+
*/
187+
public static final AttributeKey<String> GCP_GCE_INSTANCE_GROUP_MANAGER_REGION =
188+
stringKey("gcp.gce.instance_group_manager.region");
189+
190+
/**
191+
* The zone of a <strong>zonal</strong> Instance Group Manager (e.g., {@code us-central1-a}). Set
192+
* this <strong>only</strong> when the IGM is zonal.
193+
*/
194+
public static final AttributeKey<String> GCP_GCE_INSTANCE_GROUP_MANAGER_ZONE =
195+
stringKey("gcp.gce.instance_group_manager.zone");
196+
179197
// Enum definitions
180198

181199
/** Values for {@link #GCP_APPHUB_SERVICE_CRITICALITY_TYPE}. */

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

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ public final class GenAiIncubatingAttributes {
2727
/** Human-readable name of the GenAI agent provided by the application. */
2828
public static final AttributeKey<String> GEN_AI_AGENT_NAME = stringKey("gen_ai.agent.name");
2929

30+
/** The version of the GenAI agent. */
31+
public static final AttributeKey<String> GEN_AI_AGENT_VERSION = stringKey("gen_ai.agent.version");
32+
3033
/**
3134
* Deprecated, use Event API to report completions contents.
3235
*
@@ -254,6 +257,20 @@ public final class GenAiIncubatingAttributes {
254257
public static final AttributeKey<String> GEN_AI_RESPONSE_MODEL =
255258
stringKey("gen_ai.response.model");
256259

260+
/**
261+
* The query text used for retrieval.
262+
*
263+
* <p>Notes:
264+
*
265+
* <blockquote>
266+
*
267+
* [!Warning] This attribute may contain sensitive information.
268+
*
269+
* </blockquote>
270+
*/
271+
public static final AttributeKey<String> GEN_AI_RETRIEVAL_QUERY_TEXT =
272+
stringKey("gen_ai.retrieval.query.text");
273+
257274
/**
258275
* Deprecated, use {@code gen_ai.provider.name} instead.
259276
*
@@ -290,6 +307,26 @@ public final class GenAiIncubatingAttributes {
290307
*/
291308
public static final AttributeKey<String> GEN_AI_TOOL_TYPE = stringKey("gen_ai.tool.type");
292309

310+
/**
311+
* The number of input tokens written to a provider-managed cache.
312+
*
313+
* <p>Notes:
314+
*
315+
* <p>The value SHOULD be included in {@code gen_ai.usage.input_tokens}.
316+
*/
317+
public static final AttributeKey<Long> GEN_AI_USAGE_CACHE_CREATION_INPUT_TOKENS =
318+
longKey("gen_ai.usage.cache_creation.input_tokens");
319+
320+
/**
321+
* The number of input tokens served from a provider-managed cache.
322+
*
323+
* <p>Notes:
324+
*
325+
* <p>The value SHOULD be included in {@code gen_ai.usage.input_tokens}.
326+
*/
327+
public static final AttributeKey<Long> GEN_AI_USAGE_CACHE_READ_INPUT_TOKENS =
328+
longKey("gen_ai.usage.cache_read.input_tokens");
329+
293330
/**
294331
* Deprecated, use {@code gen_ai.usage.output_tokens} instead.
295332
*
@@ -299,7 +336,16 @@ public final class GenAiIncubatingAttributes {
299336
public static final AttributeKey<Long> GEN_AI_USAGE_COMPLETION_TOKENS =
300337
longKey("gen_ai.usage.completion_tokens");
301338

302-
/** The number of tokens used in the GenAI input (prompt). */
339+
/**
340+
* The number of tokens used in the GenAI input (prompt).
341+
*
342+
* <p>Notes:
343+
*
344+
* <p>This value SHOULD include all types of input tokens, including cached tokens.
345+
* Instrumentations SHOULD make a best effort to populate this value, using a total provided by
346+
* the provider when available or, depending on the provider API, by summing different token types
347+
* parsed from the provider output.
348+
*/
303349
public static final AttributeKey<Long> GEN_AI_USAGE_INPUT_TOKENS =
304350
longKey("gen_ai.usage.input_tokens");
305351

@@ -381,6 +427,13 @@ public static final class GenAiOperationNameIncubatingValues {
381427
*/
382428
public static final String EMBEDDINGS = "embeddings";
383429

430+
/**
431+
* Retrieval operation such as <a
432+
* href="https://platform.openai.com/docs/api-reference/vector-stores/search">OpenAI Search
433+
* Vector Store API</a>
434+
*/
435+
public static final String RETRIEVAL = "retrieval";
436+
384437
/** Create GenAI agent */
385438
public static final String CREATE_AGENT = "create_agent";
386439

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,15 @@ public final class HttpIncubatingAttributes {
113113
* _OTHER}, then it MUST provide a way to override the list of known HTTP methods. If this
114114
* override is done via environment variable, then the environment variable MUST be named
115115
* OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated list of case-sensitive
116-
* known HTTP methods (this list MUST be a full override of the default known method, it is not a
117-
* list of known methods in addition to the defaults).
116+
* known HTTP methods.
117+
*
118+
* <p>If this override is done via declarative configuration, then the list MUST be configurable
119+
* via the {@code known_methods} property (an array of case-sensitive strings with minimum items
120+
* 0) under {@code .instrumentation/development.general.http.client} and/or {@code
121+
* .instrumentation/development.general.http.server}.
122+
*
123+
* <p>In either case, this list MUST be a full override of the default known methods, it is not a
124+
* list of known methods in addition to the defaults.
118125
*
119126
* <p>HTTP method names are case-sensitive and {@code http.request.method} attribute value MUST
120127
* match a known HTTP method name exactly. Instrumentations for specific web frameworks that

0 commit comments

Comments
 (0)