Skip to content

Commit

Permalink
Semconv 1.24.0 (#46)
Browse files Browse the repository at this point in the history
* Upgrade to semconv 1.24.0

* Exclude aspnetcore, signalr root namespaces
  • Loading branch information
jack-berg authored Mar 26, 2024
1 parent ede8688 commit 24a1f85
Show file tree
Hide file tree
Showing 23 changed files with 742 additions and 106 deletions.
11 changes: 6 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ val snapshot = true
// end

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

// 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 @@ -48,8 +51,6 @@ nexusPublishing {
}

// start - define tasks to download, unzip, and generate from opentelemetry/semantic-conventions
// Using image built from feature branch: https://github.com/open-telemetry/build-tools/tree/feature/codegen-by-namespace
// TODO: upgrade to official release when features are incorporated into main
var generatorVersion = "0.24.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 @@ -99,7 +100,7 @@ fun generateTask(taskName: String, incubating: Boolean) {
"--output", "/output/{{pascal_prefix}}${classPrefix}Attributes.java",
"--file-per-group", "root_namespace",
// Space delimited list of root namespaces to excluded (i.e. "foo bar")
"-Dexcluded_namespaces=\"ios\"",
"-Dexcluded_namespaces=\"ios aspnetcore signalr\"",
"-Dfilter=${filter}",
"-DclassPrefix=${classPrefix}",
"-Dpkg=$packageNameArg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,11 @@ public final class CodeIncubatingAttributes {
*/
public static final AttributeKey<String> CODE_NAMESPACE = stringKey("code.namespace");

/**
* A stacktrace as a string in the natural representation for the language runtime. The
* representation is to be determined and documented by each language SIG.
*/
public static final AttributeKey<String> CODE_STACKTRACE = stringKey("code.stacktrace");

private CodeIncubatingAttributes() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public final class DbIncubatingAttributes {
longKey("db.cassandra.speculative_execution_count");

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

/**
* An identifier (address, unique name, or any other identifier) of the database instance that is
* executing queries or mutations on the current connection. This is useful in cases where the
* database is running in a clustered environment and the instrumentation is able to record the
* node executing the query. The client may obtain this value in databases like MySQL using
* queries like {@code select @@hostname}.
*/
public static final AttributeKey<String> DB_INSTANCE_ID = stringKey("db.instance.id");

/**
* The fully-qualified class name of the <a
* href="https://docs.oracle.com/javase/8/docs/technotes/guides/jdbc/">Java Database Connectivity
Expand All @@ -136,7 +145,7 @@ public final class DbIncubatingAttributes {
public static final AttributeKey<String> DB_JDBC_DRIVER_CLASSNAME =
stringKey("db.jdbc.driver_classname");

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ public final class DeploymentIncubatingAttributes {
/**
* Name of the <a href="https://wikipedia.org/wiki/Deployment_environment">deployment
* environment</a> (aka deployment tier).
*
* <p>Notes:
*
* <ul>
* <li>{@code deployment.environment} does not affect the uniqueness constraints defined through
* the {@code service.namespace}, {@code service.name} and {@code service.instance.id}
* resource attributes. This implies that resources carrying the following attribute
* combinations MUST be considered to be identifying the same service:
* <li>{@code service.name=frontend}, {@code deployment.environment=production}
* <li>{@code service.name=frontend}, {@code deployment.environment=staging}.
* </ul>
*/
public static final AttributeKey<String> DEPLOYMENT_ENVIRONMENT =
stringKey("deployment.environment");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public final class DeviceIncubatingAttributes {
* <p>Notes:
*
* <ul>
* <li>It's recommended this value represents a machine readable version of the model identifier
* <li>It's recommended this value represents a machine-readable version of the model identifier
* rather than the market or consumer-friendly name of the device.
* </ul>
*/
Expand All @@ -67,8 +67,8 @@ public final class DeviceIncubatingAttributes {
* <p>Notes:
*
* <ul>
* <li>It's recommended this value represents a human readable version of the device model
* rather than a machine readable alternative.
* <li>It's recommended this value represents a human-readable version of the device model
* rather than a machine-readable alternative.
* </ul>
*/
public static final AttributeKey<String> DEVICE_MODEL_NAME = stringKey("device.model.name");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.semconv.incubating;

import static io.opentelemetry.api.common.AttributeKey.stringKey;

import io.opentelemetry.api.common.AttributeKey;

// DO NOT EDIT, this is an Auto-generated file from
// buildscripts/templates/SemanticAttributes.java.j2
@SuppressWarnings("unused")
public final class DiskIncubatingAttributes {

/** The disk IO operation direction. */
public static final AttributeKey<String> DISK_IO_DIRECTION = stringKey("disk.io.direction");

// Enum definitions
/** Values for {@link #DISK_IO_DIRECTION}. */
public static final class DiskIoDirectionValues {
/** read. */
public static final String READ = "read";

/** write. */
public static final String WRITE = "write";

private DiskIoDirectionValues() {}
}

private DiskIncubatingAttributes() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/

package io.opentelemetry.semconv.incubating;

import static io.opentelemetry.api.common.AttributeKey.stringKey;

import io.opentelemetry.api.common.AttributeKey;

// DO NOT EDIT, this is an Auto-generated file from
// buildscripts/templates/SemanticAttributes.java.j2
@SuppressWarnings("unused")
public final class DnsIncubatingAttributes {

/**
* The name being queried.
*
* <p>Notes:
*
* <ul>
* <li>The name being queried. If the name field contains non-printable characters (below 32 or
* above 126), those characters should be represented as escaped base 10 integers (\DDD).
* Back slashes and quotes should be escaped. Tabs, carriage returns, and line feeds should
* be converted to \t, \r, and \n respectively.
* </ul>
*/
public static final AttributeKey<String> DNS_QUESTION_NAME = stringKey("dns.question.name");

private DnsIncubatingAttributes() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,19 @@
public final class EventIncubatingAttributes {

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

/** The name identifies the event. */
public static final AttributeKey<String> EVENT_NAME = stringKey("event.name");

// Enum definitions
/** Values for {@link #EVENT_DOMAIN}. */
public static final class EventDomainValues {
/** Events from browser apps. */
public static final String BROWSER = "browser";

/** Events from mobile apps. */
public static final String DEVICE = "device";

/** Events from Kubernetes. */
public static final String K8S = "k8s";

private EventDomainValues() {}
}

private EventIncubatingAttributes() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class ExceptionIncubatingAttributes {
* <li>It is usually not possible to determine at the point where an exception is thrown whether
* it will escape the scope of a span. However, it is trivial to know that an exception will
* escape, if one checks for an active exception just before ending the span, as done in the
* <a href="#recording-an-exception">example above</a>.
* <a href="#recording-an-exception">example for recording span exceptions</a>.
* <li>It follows that an exception may still escape the scope of the span even if the {@code
* exception.escaped} attribute was not set or set to false, since the event might have been
* recorded at a time where it was not clear whether the exception will escape.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ public final class HostIncubatingAttributes {
/** The amount of level 2 memory cache available to the processor (in Bytes). */
public static final AttributeKey<Long> HOST_CPU_CACHE_L2_SIZE = longKey("host.cpu.cache.l2.size");

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

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

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

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

Expand Down
Loading

0 comments on commit 24a1f85

Please sign in to comment.