Skip to content

Commit

Permalink
Update to semantic conventions 1.29.0 and weaver 0.12.0 (#118)
Browse files Browse the repository at this point in the history
* Update to semantic conventions 1.29.0 and weaver 0.12.0

* workaround
  • Loading branch information
trask authored Dec 13, 2024
1 parent b7e599c commit de325e6
Show file tree
Hide file tree
Showing 26 changed files with 710 additions and 103 deletions.
5 changes: 3 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ val snapshot = true
// end

// The release version of https://github.com/open-telemetry/semantic-conventions used to generate classes
var semanticConventionsVersion = "1.28.0"
var semanticConventionsVersion = "1.29.0"
val schemaUrlVersions = listOf(
semanticConventionsVersion,
"1.28.0",
"1.27.0",
"1.26.0",
"1.25.0",
Expand Down Expand Up @@ -55,7 +56,7 @@ nexusPublishing {
}

// start - define tasks to download, unzip, and generate from opentelemetry/semantic-conventions
var generatorVersion = "v0.9.1"
var generatorVersion = "v0.12.0"
val semanticConventionsRepoZip = "https://github.com/open-telemetry/semantic-conventions/archive/v${semanticConventionsVersion}.zip"
val schemaUrl = "https://opentelemetry.io/schemas/$semanticConventionsVersion"

Expand Down
4 changes: 3 additions & 1 deletion buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ tasks {
breakIterator(true)

addBooleanOption("html5", true)
addBooleanOption("Xdoclint:all,-missing", true)
// TODO (trask) need to disable html validation until next semconv release
// see https://github.com/open-telemetry/semantic-conventions/pull/1664
addBooleanOption("Xdoclint:all,-missing,-html", true)
}
}

Expand Down
26 changes: 18 additions & 8 deletions buildscripts/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,28 @@
<property name="tokens" value="VARIABLE_DEF"/>
<property name="allowSamelineMultipleAnnotations" value="true"/>
</module>
<module name="NonEmptyAtclauseDescription"/>
<module name="JavadocTagContinuationIndentation"/>
<!-- TODO (trask) commented out until next semconv release,
see https://github.com/open-telemetry/semantic-conventions/pull/1664 -->
<!--module name="NonEmptyAtclauseDescription"/-->
<!-- TODO (trask) commented out until next semconv release,
see https://github.com/open-telemetry/semantic-conventions/pull/1664 -->
<!--module name="JavadocTagContinuationIndentation"/-->
<module name="SummaryJavadoc">
<property name="forbiddenSummaryFragments"
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
</module>
<module name="JavadocParagraph">
<!-- TODO (trask) commented out until next semconv release,
see https://github.com/open-telemetry/semantic-conventions/pull/1664 -->
<!--module name="JavadocParagraph">
<property name="allowNewlineParagraph" value="false"/>
</module>
<module name="AtclauseOrder">
</module-->
<!-- TODO (trask) commented out until next semconv release,
see https://github.com/open-telemetry/semantic-conventions/pull/1664 -->
<!--module name="AtclauseOrder">
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
<property name="target"
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
</module>
</module-->
<module name="JavadocMethod">
<property name="scope" value="public"/>
<property name="allowMissingParamTags" value="true"/>
Expand All @@ -170,10 +178,12 @@
<message key="name.invalidPattern"
value="Method name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="SingleLineJavadoc">
<!-- TODO (trask) commented out until next semconv release,
see https://github.com/open-telemetry/semantic-conventions/pull/1664 -->
<!--module name="SingleLineJavadoc"-->
<!-- <!-\- Wrong interpretation of the style guide; -\-> -->
<!-- <property name="ignoreInlineTags" value="false"/ -->
</module>
<!--/module-->
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,6 @@ public final class AwsIncubatingAttributes {
* href="https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html">copy-object
* operation within the S3 API</a>. This applies in particular to the following operations:
*
* <p>
*
* <ul>
* <li><a
* href="https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html">copy-object</a>
Expand Down Expand Up @@ -266,8 +264,6 @@ public final class AwsIncubatingAttributes {
* require the object key as a mandatory parameter. This applies in particular to the following
* operations:
*
* <p>
*
* <ul>
* <li><a
* href="https://docs.aws.amazon.com/cli/latest/reference/s3api/copy-object.html">copy-object</a>
Expand Down Expand Up @@ -326,8 +322,6 @@ public final class AwsIncubatingAttributes {
* href="https://docs.aws.amazon.com/cli/latest/reference/s3api/index.html">S3 API</a> multipart
* operations. This applies in particular to the following operations:
*
* <p>
*
* <ul>
* <li><a
* href="https://docs.aws.amazon.com/cli/latest/reference/s3api/abort-multipart-upload.html">abort-multipart-upload</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public final class CicdIncubatingAttributes {

/**
* The human readable name of a task within a pipeline. Task here most closely aligns with a <a
* href="https://en.wikipedia.org/wiki/Pipeline_(computing)">computing process</a> in a pipeline.
* href="https://wikipedia.org/wiki/Pipeline_(computing)">computing process</a> in a pipeline.
* Other terms for tasks include commands, steps, and procedures.
*/
public static final AttributeKey<String> CICD_PIPELINE_TASK_NAME =
Expand All @@ -32,8 +32,8 @@ public final class CicdIncubatingAttributes {
stringKey("cicd.pipeline.task.run.id");

/**
* The <a href="https://en.wikipedia.org/wiki/URL">URL</a> of the pipeline run providing the
* complete address in order to locate and identify the pipeline run.
* The <a href="https://wikipedia.org/wiki/URL">URL</a> of the pipeline run providing the complete
* address in order to locate and identify the pipeline run.
*/
public static final AttributeKey<String> CICD_PIPELINE_TASK_RUN_URL_FULL =
stringKey("cicd.pipeline.task.run.url.full");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ public final class CloudIncubatingAttributes {
* <p>The exact value to use for {@code cloud.resource_id} depends on the cloud provider. The
* following well-known definitions MUST be used if you set this attribute and they apply:
*
* <p>
*
* <ul>
* <li><strong>AWS Lambda:</strong> The function <a
* href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class CloudfoundryIncubatingAttributes {
* <p>Notes:
*
* <p>CloudFoundry defines the {@code instance_id} in the <a
* href="https://github.com/cloudfoundry/loggregator-api#v2-envelope">Loggegator v2 envelope</a>.
* href="https://github.com/cloudfoundry/loggregator-api#v2-envelope">Loggregator v2 envelope</a>.
* It is used for logs and metrics emitted by CloudFoundry. It is supposed to contain the
* application instance index for applications deployed on the runtime.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
import static io.opentelemetry.api.common.AttributeKey.booleanKey;
import static io.opentelemetry.api.common.AttributeKey.doubleKey;
import static io.opentelemetry.api.common.AttributeKey.longKey;
import static io.opentelemetry.api.common.AttributeKey.stringArrayKey;
import static io.opentelemetry.api.common.AttributeKey.stringKey;
import static io.opentelemetry.semconv.AttributeKeyTemplate.stringKeyTemplate;

import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.semconv.AttributeKeyTemplate;
import java.util.List;

// DO NOT EDIT, this is an Auto-generated file from
// buildscripts/templates/registry/incubating_java/IncubatingSemanticAttributes.java.j2
Expand Down Expand Up @@ -100,12 +102,15 @@ public final class DbIncubatingAttributes {
* <p>Notes:
*
* <p>It is RECOMMENDED to capture the value as provided by the application without attempting to
* do any case normalization. If the collection name is parsed from the query text, it SHOULD be
* the first collection name found in the query and it SHOULD match the value provided in the
* query text including any schema and database name prefix. For batch operations, if the
* individual operations are known to have the same collection name then that collection name
* SHOULD be used, otherwise {@code db.collection.name} SHOULD NOT be captured. This attribute has
* stability level RELEASE CANDIDATE.
* do any case normalization.
*
* <p>The collection name SHOULD NOT be extracted from {@code db.query.text}, unless the query
* format is known to only ever have a single collection name present.
*
* <p>For batch operations, if the individual operations are known to have the same collection
* name then that collection name SHOULD be used.
*
* <p>This attribute has stability level RELEASE CANDIDATE.
*/
public static final AttributeKey<String> DB_COLLECTION_NAME = stringKey("db.collection.name");

Expand All @@ -127,6 +132,13 @@ public final class DbIncubatingAttributes {
public static final AttributeKey<String> DB_COSMOSDB_CONNECTION_MODE =
stringKey("db.cosmosdb.connection_mode");

/**
* Account or request <a
* href="https://learn.microsoft.com/azure/cosmos-db/consistency-levels">consistency level</a>.
*/
public static final AttributeKey<String> DB_COSMOSDB_CONSISTENCY_LEVEL =
stringKey("db.cosmosdb.consistency_level");

/**
* Deprecated, use {@code db.collection.name} instead.
*
Expand All @@ -138,15 +150,36 @@ public final class DbIncubatingAttributes {
public static final AttributeKey<String> DB_COSMOSDB_CONTAINER =
stringKey("db.cosmosdb.container");

/** Cosmos DB Operation Type. */
/**
* Deprecated, no replacement at this time.
*
* <p>
*
* @deprecated No replacement at this time.
*/
@Deprecated
public static final AttributeKey<String> DB_COSMOSDB_OPERATION_TYPE =
stringKey("db.cosmosdb.operation_type");

/** RU consumed for that operation */
/**
* List of regions contacted during operation in the order that they were contacted. If there is
* more than one region listed, it indicates that the operation was performed on multiple regions
* i.e. cross-regional call.
*
* <p>Notes:
*
* <p>Region name matches the format of {@code displayName} in <a
* href="https://learn.microsoft.com/rest/api/subscription/subscriptions/list-locations?view=rest-subscription-2021-10-01&tabs=HTTP#location">Azure
* Location API</a>
*/
public static final AttributeKey<List<String>> DB_COSMOSDB_REGIONS_CONTACTED =
stringArrayKey("db.cosmosdb.regions_contacted");

/** Request units consumed for the operation. */
public static final AttributeKey<Double> DB_COSMOSDB_REQUEST_CHARGE =
doubleKey("db.cosmosdb.request_charge");

/** Request payload size in bytes */
/** Request payload size in bytes. */
public static final AttributeKey<Long> DB_COSMOSDB_REQUEST_CONTENT_LENGTH =
longKey("db.cosmosdb.request_content_length");

Expand Down Expand Up @@ -292,28 +325,61 @@ public final class DbIncubatingAttributes {
* <p>Notes:
*
* <p>It is RECOMMENDED to capture the value as provided by the application without attempting to
* do any case normalization. If the operation name is parsed from the query text, it SHOULD be
* the first operation name found in the query. For batch operations, if the individual operations
* are known to have the same operation name then that operation name SHOULD be used prepended by
* {@code BATCH }, otherwise {@code db.operation.name} SHOULD be {@code BATCH} or some other
* database system specific term if more applicable. This attribute has stability level RELEASE
* CANDIDATE.
* do any case normalization.
*
* <p>The operation name SHOULD NOT be extracted from {@code db.query.text}, unless the query
* format is known to only ever have a single operation name present.
*
* <p>For batch operations, if the individual operations are known to have the same operation name
* then that operation name SHOULD be used prepended by {@code BATCH }, otherwise {@code
* db.operation.name} SHOULD be {@code BATCH} or some other database system specific term if more
* applicable.
*
* <p>This attribute has stability level RELEASE CANDIDATE.
*/
public static final AttributeKey<String> DB_OPERATION_NAME = stringKey("db.operation.name");

/**
* A database operation parameter, with {@code <key>} being the parameter name, and the attribute
* value being a string representation of the parameter value.
*
* <p>Notes:
*
* <p>If a parameter has no name and instead is referenced only by index, then {@code <key>}
* SHOULD be the 0-based index. If {@code db.query.text} is also captured, then {@code
* db.operation.parameter.<key>} SHOULD match up with the parameterized placeholders present in
* {@code db.query.text}. This attribute has stability level RELEASE CANDIDATE.
*/
public static final AttributeKeyTemplate<String> DB_OPERATION_PARAMETER =
stringKeyTemplate("db.operation.parameter");

/**
* A query parameter used in {@code db.query.text}, with {@code <key>} being the parameter name,
* and the attribute value being a string representation of the parameter value.
*
* <p>Notes:
* <p>
*
* <p>Query parameters should only be captured when {@code db.query.text} is parameterized with
* placeholders. If a parameter has no name and instead is referenced only by index, then {@code
* <key>} SHOULD be the 0-based index. This attribute has stability level RELEASE CANDIDATE.
* @deprecated Replaced by {@code db.operation.parameter}.
*/
@Deprecated
public static final AttributeKeyTemplate<String> DB_QUERY_PARAMETER =
stringKeyTemplate("db.query.parameter");

/**
* Low cardinality representation of a database query text.
*
* <p>Notes:
*
* <p>{@code db.query.summary} provides static summary of the query text. It describes a class of
* database queries and is useful as a grouping key, especially when analyzing telemetry for
* database calls involving complex queries. Summary may be available to the instrumentation
* through instrumentation hooks or other means. If it is not available, instrumentations that
* support query parsing SHOULD generate a summary following <a
* href="../../docs/database/database-spans.md#generating-a-summary-of-the-query-text">Generating
* query summary</a> section. This attribute has stability level RELEASE CANDIDATE.
*/
public static final AttributeKey<String> DB_QUERY_SUMMARY = stringKey("db.query.summary");

/**
* The database query being executed.
*
Expand Down Expand Up @@ -343,6 +409,10 @@ public final class DbIncubatingAttributes {
public static final AttributeKey<Long> DB_REDIS_DATABASE_INDEX =
longKey("db.redis.database_index");

/** Number of rows returned by the operation. */
public static final AttributeKey<Long> DB_RESPONSE_RETURNED_ROWS =
longKey("db.response.returned_rows");

/**
* Database response status code.
*
Expand Down Expand Up @@ -464,7 +534,7 @@ private DbClientConnectionsStateIncubatingValues() {}

/** Values for {@link #DB_COSMOSDB_CONNECTION_MODE}. */
public static final class DbCosmosdbConnectionModeIncubatingValues {
/** Gateway (HTTP) connections mode */
/** Gateway (HTTP) connection. */
public static final String GATEWAY = "gateway";

/** Direct connection. */
Expand All @@ -473,7 +543,32 @@ public static final class DbCosmosdbConnectionModeIncubatingValues {
private DbCosmosdbConnectionModeIncubatingValues() {}
}

/** Values for {@link #DB_COSMOSDB_OPERATION_TYPE}. */
/** Values for {@link #DB_COSMOSDB_CONSISTENCY_LEVEL}. */
public static final class DbCosmosdbConsistencyLevelIncubatingValues {
/** strong. */
public static final String STRONG = "Strong";

/** bounded_staleness. */
public static final String BOUNDED_STALENESS = "BoundedStaleness";

/** session. */
public static final String SESSION = "Session";

/** eventual. */
public static final String EVENTUAL = "Eventual";

/** consistent_prefix. */
public static final String CONSISTENT_PREFIX = "ConsistentPrefix";

private DbCosmosdbConsistencyLevelIncubatingValues() {}
}

/**
* Values for {@link #DB_COSMOSDB_OPERATION_TYPE}
*
* @deprecated No replacement at this time.
*/
@Deprecated
public static final class DbCosmosdbOperationTypeIncubatingValues {
/** batch. */
public static final String BATCH = "batch";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public final class DeploymentIncubatingAttributes {
* resource attributes. This implies that resources carrying the following attribute combinations
* MUST be considered to be identifying the same service:
*
* <p>
*
* <ul>
* <li>{@code service.name=frontend}, {@code deployment.environment.name=production}
* <li>{@code service.name=frontend}, {@code deployment.environment.name=staging}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public final class ErrorIncubatingAttributes {
* <p>If a specific domain defines its own set of error identifiers (such as HTTP or gRPC status
* codes), it's RECOMMENDED to:
*
* <p>
*
* <ul>
* <li>Use a domain-specific attribute
* <li>Set {@code error.type} to capture all errors, regardless of whether they are defined
* within the domain-specific set or not.
* </ul>
*
* <p>
*
* @deprecated deprecated in favor of stable {@link
* io.opentelemetry.semconv.ErrorAttributes#ERROR_TYPE} attribute.
*/
Expand Down
Loading

0 comments on commit de325e6

Please sign in to comment.