Skip to content

Commit 862def8

Browse files
authored
Bump to semantic-conventions v1.31.0 (#189)
* Bump to semantic-conventions v1.31.0 * Prepare changelog for 1.31.0 release
1 parent 820dd9d commit 862def8

21 files changed

+366
-42
lines changed

CHANGELOG.md

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

33
## Unreleased
44

5+
* Bump to semantic-conventions v1.31.0
6+
([#189](https://github.com/open-telemetry/semantic-conventions-java/pull/189)))
7+
* Harden GitHub Actions
8+
([#152](https://github.com/open-telemetry/semantic-conventions-java/pull/152),
9+
[#153](https://github.com/open-telemetry/semantic-conventions-java/pull/153),
10+
[#155](https://github.com/open-telemetry/semantic-conventions-java/pull/155))
11+
* Add OSSF scorecard workflow
12+
([#156](https://github.com/open-telemetry/semantic-conventions-java/pull/156))
13+
* Add codeql
14+
([#157](https://github.com/open-telemetry/semantic-conventions-java/pull/157))
15+
* Restrict token permissions
16+
([#161](https://github.com/open-telemetry/semantic-conventions-java/pull/161))
17+
* Run gradle wrapper check all the time
18+
([#159](https://github.com/open-telemetry/semantic-conventions-java/pull/159))
19+
* Add FOSSA license scanning
20+
([#163](https://github.com/open-telemetry/semantic-conventions-java/pull/163))
21+
* Update to weaver 0.13.2 and enable javadoc validation
22+
([#174](https://github.com/open-telemetry/semantic-conventions-java/pull/174))
23+
524
## Version 1.30.0 (2025-02-18)
625

726
See [1.30.0-rc.1](#version-1300-rc1-2025-01-27). No additional changes.

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.30.0"
14+
var semanticConventionsVersion = "1.31.0"
1515
val schemaUrlVersions = listOf(
1616
semanticConventionsVersion,
17+
"1.30.0",
1718
"1.29.0",
1819
"1.28.0",
1920
"1.27.0",

docs/apidiffs/current_vs_latest/opentelemetry-semconv.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Comparing source compatibility of opentelemetry-semconv-1.30.0-SNAPSHOT.jar against
1+
Comparing source compatibility of opentelemetry-semconv-1.31.0-SNAPSHOT.jar against
22
+++ NEW CLASS: PUBLIC(+) FINAL(+) io.opentelemetry.semconv.AttributeKeyTemplate (not serializable)
33
+++ CLASS FILE FORMAT VERSION: 52.0 <- n.a.
44
GENERIC TEMPLATES: +++ T:java.lang.Object
@@ -118,6 +118,7 @@ Comparing source compatibility of opentelemetry-semconv-1.30.0-SNAPSHOT.jar agai
118118
+++ NEW SUPERCLASS: java.lang.Object
119119
+++ NEW FIELD: PUBLIC(+) STATIC(+) FINAL(+) java.lang.String V1_24_0
120120
+++ NEW FIELD: PUBLIC(+) STATIC(+) FINAL(+) java.lang.String V1_30_0
121+
+++ NEW FIELD: PUBLIC(+) STATIC(+) FINAL(+) java.lang.String V1_31_0
121122
+++ NEW FIELD: PUBLIC(+) STATIC(+) FINAL(+) java.lang.String V1_29_0
122123
+++ NEW FIELD: PUBLIC(+) STATIC(+) FINAL(+) java.lang.String V1_28_0
123124
+++ NEW FIELD: PUBLIC(+) STATIC(+) FINAL(+) java.lang.String V1_27_0

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

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@
1313
// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2
1414
@SuppressWarnings("unused")
1515
public final class AndroidIncubatingAttributes {
16+
/**
17+
* This attribute represents the state of the application.
18+
*
19+
* <p>Notes:
20+
*
21+
* <p>The Android lifecycle states are defined in <a
22+
* href="https://developer.android.com/guide/components/activities/activity-lifecycle#lc">Activity
23+
* lifecycle callbacks</a>, and from which the {@code OS identifiers} are derived.
24+
*/
25+
public static final AttributeKey<String> ANDROID_APP_STATE = stringKey("android.app.state");
26+
1627
/**
1728
* Uniquely identifies the framework API revision offered by a version ({@code os.version}) of the
1829
* android operating system. More information can be found <a
@@ -21,24 +32,46 @@ public final class AndroidIncubatingAttributes {
2132
public static final AttributeKey<String> ANDROID_OS_API_LEVEL = stringKey("android.os.api_level");
2233

2334
/**
24-
* Deprecated use the {@code device.app.lifecycle} event definition including {@code
25-
* android.state} as a payload field instead.
35+
* Deprecated. Use {@code android.app.state} instead.
2636
*
2737
* <p>Notes:
2838
*
2939
* <p>The Android lifecycle states are defined in <a
3040
* href="https://developer.android.com/guide/components/activities/activity-lifecycle#lc">Activity
3141
* lifecycle callbacks</a>, and from which the {@code OS identifiers} are derived.
3242
*
33-
* @deprecated Replaced by {@code device.app.lifecycle}.
43+
* @deprecated Renamed to {@code android.app.state}
3444
*/
3545
@Deprecated public static final AttributeKey<String> ANDROID_STATE = stringKey("android.state");
3646

3747
// Enum definitions
48+
/** Values for {@link #ANDROID_APP_STATE}. */
49+
public static final class AndroidAppStateIncubatingValues {
50+
/**
51+
* Any time before Activity.onResume() or, if the app has no Activity, Context.startService()
52+
* has been called in the app for the first time.
53+
*/
54+
public static final String CREATED = "created";
55+
56+
/**
57+
* Any time after Activity.onPause() or, if the app has no Activity, Context.stopService() has
58+
* been called when the app was in the foreground state.
59+
*/
60+
public static final String BACKGROUND = "background";
61+
62+
/**
63+
* Any time after Activity.onResume() or, if the app has no Activity, Context.startService() has
64+
* been called when the app was in either the created or background states.
65+
*/
66+
public static final String FOREGROUND = "foreground";
67+
68+
private AndroidAppStateIncubatingValues() {}
69+
}
70+
3871
/**
3972
* Values for {@link #ANDROID_STATE}
4073
*
41-
* @deprecated Replaced by {@code device.app.lifecycle}.
74+
* @deprecated Renamed to {@code android.app.state}
4275
*/
4376
@Deprecated
4477
public static final class AndroidStateIncubatingValues {

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ public final class CicdIncubatingAttributes {
2626
public static final AttributeKey<String> CICD_PIPELINE_RUN_STATE =
2727
stringKey("cicd.pipeline.run.state");
2828

29+
/**
30+
* The <a href="https://wikipedia.org/wiki/URL">URL</a> of the pipeline run, providing the
31+
* complete address in order to locate and identify the pipeline run.
32+
*/
33+
public static final AttributeKey<String> CICD_PIPELINE_RUN_URL_FULL =
34+
stringKey("cicd.pipeline.run.url.full");
35+
2936
/**
3037
* The human readable name of a task within a pipeline. Task here most closely aligns with a <a
3138
* href="https://wikipedia.org/wiki/Pipeline_(computing)">computing process</a> in a pipeline.
@@ -39,8 +46,8 @@ public final class CicdIncubatingAttributes {
3946
stringKey("cicd.pipeline.task.run.id");
4047

4148
/**
42-
* The <a href="https://wikipedia.org/wiki/URL">URL</a> of the pipeline run providing the complete
43-
* address in order to locate and identify the pipeline run.
49+
* The <a href="https://wikipedia.org/wiki/URL">URL</a> of the pipeline task run, providing the
50+
* complete address in order to locate and identify the pipeline task run.
4451
*/
4552
public static final AttributeKey<String> CICD_PIPELINE_TASK_RUN_URL_FULL =
4653
stringKey("cicd.pipeline.task.run.url.full");

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ public final class CloudIncubatingAttributes {
5858
* href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> on
5959
* AWS, a <a href="https://learn.microsoft.com/rest/api/resources/resources/get-by-id">fully
6060
* qualified resource ID</a> on Azure, a <a
61-
* href="https://cloud.google.com/apis/design/resource_names#full_resource_name">full resource
62-
* name</a> on GCP)
61+
* href="https://google.aip.dev/122#full-resource-names">full resource name</a> on GCP)
6362
*
6463
* <p>Notes:
6564
*

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

Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ public final class CodeIncubatingAttributes {
3333
*/
3434
public static final AttributeKey<String> CODE_FILE_PATH = stringKey("code.file.path");
3535

36-
/** Deprecated, use {@code code.file.path} instead */
37-
public static final AttributeKey<String> CODE_FILEPATH = stringKey("code.filepath");
36+
/**
37+
* Deprecated, use {@code code.file.path} instead
38+
*
39+
* @deprecated Replaced by {@code code.file.path}
40+
*/
41+
@Deprecated public static final AttributeKey<String> CODE_FILEPATH = stringKey("code.filepath");
3842

3943
/**
4044
* Deprecated, use {@code code.function.name} instead
@@ -44,7 +48,30 @@ public final class CodeIncubatingAttributes {
4448
@Deprecated public static final AttributeKey<String> CODE_FUNCTION = stringKey("code.function");
4549

4650
/**
47-
* The method or function name, or equivalent (usually rightmost part of the code unit's name).
51+
* The method or function fully-qualified name without arguments. The value should fit the natural
52+
* representation of the language runtime, which is also likely the same used within {@code
53+
* code.stacktrace} attribute value.
54+
*
55+
* <p>Notes:
56+
*
57+
* <p>Values and format depends on each language runtime, thus it is impossible to provide an
58+
* exhaustive list of examples. The values are usually the same (or prefixes of) the ones found in
59+
* native stack trace representation stored in {@code code.stacktrace} without information on
60+
* arguments.
61+
*
62+
* <p>Examples:
63+
*
64+
* <ul>
65+
* <li>Java method: {@code com.example.MyHttpService.serveRequest}
66+
* <li>Java anonymous class method: {@code com.mycompany.Main$1.myMethod}
67+
* <li>Java lambda method: {@code com.mycompany.Main$$Lambda/0x0000748ae4149c00.myMethod}
68+
* <li>PHP function: `GuzzleHttp\Client::transfer
69+
* <li>Go function: {@code github.com/my/repo/pkg.foo.func5}
70+
* <li>Elixir: {@code OpenTelemetry.Ctx.new}
71+
* <li>Erlang: {@code opentelemetry_ctx:new}
72+
* <li>Rust: {@code playground::my_module::my_cool_func}
73+
* <li>C function: {@code fopen}
74+
* </ul>
4875
*/
4976
public static final AttributeKey<String> CODE_FUNCTION_NAME = stringKey("code.function.name");
5077

@@ -62,15 +89,18 @@ public final class CodeIncubatingAttributes {
6289
@Deprecated public static final AttributeKey<Long> CODE_LINENO = longKey("code.lineno");
6390

6491
/**
65-
* The "namespace" within which {@code code.function.name} is defined. Usually the qualified class
66-
* or module name, such that {@code code.namespace} + some separator + {@code code.function.name}
67-
* form a unique identifier for the code unit.
92+
* Deprecated, namespace is now included into {@code code.function.name}
93+
*
94+
* @deprecated Value should be included in {@code code.function.name} which is expected to be a
95+
* fully-qualified name.
6896
*/
69-
public static final AttributeKey<String> CODE_NAMESPACE = stringKey("code.namespace");
97+
@Deprecated public static final AttributeKey<String> CODE_NAMESPACE = stringKey("code.namespace");
7098

7199
/**
72100
* A stacktrace as a string in the natural representation for the language runtime. The
73-
* representation is to be determined and documented by each language SIG.
101+
* representation is identical to <a
102+
* href="/docs/exceptions/exceptions-spans.md#stacktrace-representation">{@code
103+
* exception.stacktrace}</a>.
74104
*/
75105
public static final AttributeKey<String> CODE_STACKTRACE = stringKey("code.stacktrace");
76106

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
package io.opentelemetry.semconv.incubating;
77

8+
import static io.opentelemetry.api.common.AttributeKey.longKey;
89
import static io.opentelemetry.api.common.AttributeKey.stringKey;
910

1011
import io.opentelemetry.api.common.AttributeKey;
@@ -13,6 +14,9 @@
1314
// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2
1415
@SuppressWarnings("unused")
1516
public final class CpuIncubatingAttributes {
17+
/** The logical CPU number [0..n-1] */
18+
public static final AttributeKey<Long> CPU_LOGICAL_NUMBER = longKey("cpu.logical_number");
19+
1620
/** The mode of the CPU */
1721
public static final AttributeKey<String> CPU_MODE = stringKey("cpu.mode");
1822

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ public final class DbIncubatingAttributes {
122122
* <p>It is RECOMMENDED to capture the value as provided by the application without attempting to
123123
* do any case normalization.
124124
*
125-
* <p>The collection name SHOULD NOT be extracted from {@code db.query.text}, unless the query
126-
* format is known to only ever have a single collection name present.
125+
* <p>The collection name SHOULD NOT be extracted from {@code db.query.text}, when the database
126+
* system supports cross-table queries in non-batch operations.
127127
*
128128
* <p>For batch operations, if the individual operations are known to have the same collection
129129
* name then that collection name SHOULD be used.
@@ -339,8 +339,8 @@ public final class DbIncubatingAttributes {
339339
* <p>It is RECOMMENDED to capture the value as provided by the application without attempting to
340340
* do any case normalization.
341341
*
342-
* <p>The operation name SHOULD NOT be extracted from {@code db.query.text}, unless the query
343-
* format is known to only ever have a single operation name present.
342+
* <p>The operation name SHOULD NOT be extracted from {@code db.query.text}, when the database
343+
* system supports cross-table queries in non-batch operations.
344344
*
345345
* <p>For batch operations, if the individual operations are known to have the same operation name
346346
* then that operation name SHOULD be used prepended by {@code BATCH }, otherwise {@code
@@ -383,8 +383,8 @@ public final class DbIncubatingAttributes {
383383
* database calls involving complex queries. Summary may be available to the instrumentation
384384
* through instrumentation hooks or other means. If it is not available, instrumentations that
385385
* support query parsing SHOULD generate a summary following <a
386-
* href="../../docs/database/database-spans.md#generating-a-summary-of-the-query-text">Generating
387-
* query summary</a> section.
386+
* href="../database/database-spans.md#generating-a-summary-of-the-query-text">Generating query
387+
* summary</a> section.
388388
*/
389389
public static final AttributeKey<String> DB_QUERY_SUMMARY = stringKey("db.query.summary");
390390

@@ -394,7 +394,7 @@ public final class DbIncubatingAttributes {
394394
* <p>Notes:
395395
*
396396
* <p>For sanitization see <a
397-
* href="../../docs/database/database-spans.md#sanitization-of-dbquerytext">Sanitization of {@code
397+
* href="../database/database-spans.md#sanitization-of-dbquerytext">Sanitization of {@code
398398
* db.query.text}</a>. For batch operations, if the individual operations are known to have the
399399
* same query text then that query text SHOULD be used, otherwise all of the individual query
400400
* texts SHOULD be concatenated with separator {@code ; } or some other database system specific

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

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,36 @@
1414
@SuppressWarnings("unused")
1515
public final class EnduserIncubatingAttributes {
1616
/**
17-
* Deprecated, use {@code user.id} instead.
17+
* Unique identifier of an end user in the system. It maybe a username, email address, or other
18+
* identifier.
1819
*
19-
* @deprecated Replaced by {@code user.id} attribute.
20+
* <p>Notes:
21+
*
22+
* <p>Unique identifier of an end user in the system.
23+
*
24+
* <blockquote>
25+
*
26+
* [!Warning] This field contains sensitive (PII) information.
27+
*
28+
* </blockquote>
29+
*/
30+
public static final AttributeKey<String> ENDUSER_ID = stringKey("enduser.id");
31+
32+
/**
33+
* Pseudonymous identifier of an end user. This identifier should be a random value that is not
34+
* directly linked or associated with the end user's actual identity.
35+
*
36+
* <p>Notes:
37+
*
38+
* <p>Pseudonymous identifier of an end user.
39+
*
40+
* <blockquote>
41+
*
42+
* [!Warning] This field contains sensitive (linkable PII) information.
43+
*
44+
* </blockquote>
2045
*/
21-
@Deprecated public static final AttributeKey<String> ENDUSER_ID = stringKey("enduser.id");
46+
public static final AttributeKey<String> ENDUSER_PSEUDO_ID = stringKey("enduser.pseudo.id");
2247

2348
/**
2449
* Deprecated, use {@code user.roles} instead.

0 commit comments

Comments
 (0)