From 3118ac5eef37b6c3954f7eddeb1da38505886aa8 Mon Sep 17 00:00:00 2001 From: Maksym Ochenashko Date: Thu, 28 Mar 2024 12:10:00 +0200 Subject: [PATCH] Update `opentelemetry-semconv` to `1.24.0-alpha` --- .github/workflows/ci.yml | 4 +- build.sbt | 61 +- .../templates/SemanticAttributes.scala.j2 | 882 +--- project/SemanticConventionsGenerator.scala | 71 +- .../otel4s/sdk/TelemetryResource.scala | 19 +- .../TelemetryResourceAutoConfigure.scala | 3 +- .../otel4s/sdk/trace/data/EventData.scala | 9 +- .../AndroidExperimentalAttributes.scala | 67 + .../AwsExperimentalAttributes.scala | 373 ++ .../BrowserExperimentalAttributes.scala | 70 + .../ClientExperimentalAttributes.scala | 52 + .../CloudExperimentalAttributes.scala | 229 ++ .../CloudeventsExperimentalAttributes.scala | 64 + .../CodeExperimentalAttributes.scala | 57 + .../ContainerExperimentalAttributes.scala | 108 + .../DbExperimentalAttributes.scala | 514 +++ .../DeploymentExperimentalAttributes.scala | 42 + .../DestinationExperimentalAttributes.scala | 40 + .../DeviceExperimentalAttributes.scala | 73 + .../DiskExperimentalAttributes.scala | 42 + .../DnsExperimentalAttributes.scala | 36 + .../EnduserExperimentalAttributes.scala | 46 + .../ErrorExperimentalAttributes.scala | 67 + .../EventExperimentalAttributes.scala | 36 + .../ExceptionExperimentalAttributes.scala | 64 + .../FaasExperimentalAttributes.scala | 220 + .../FeatureFlagExperimentalAttributes.scala | 50 + .../GcpExperimentalAttributes.scala | 60 + .../GraphqlExperimentalAttributes.scala | 60 + .../HerokuExperimentalAttributes.scala | 41 + .../HostExperimentalAttributes.scala | 141 + .../HttpExperimentalAttributes.scala | 309 ++ .../JvmExperimentalAttributes.scala | 144 + .../K8sExperimentalAttributes.scala | 150 + .../LogExperimentalAttributes.scala | 75 + .../MessageExperimentalAttributes.scala | 63 + .../MessagingExperimentalAttributes.scala | 356 ++ .../NetExperimentalAttributes.scala | 139 + .../NetworkExperimentalAttributes.scala | 300 ++ .../OciExperimentalAttributes.scala | 39 + .../OpentracingExperimentalAttributes.scala | 47 + .../OsExperimentalAttributes.scala | 88 + .../OtelExperimentalAttributes.scala | 69 + .../OtherExperimentalAttributes.scala | 42 + .../PeerExperimentalAttributes.scala | 31 + .../PoolExperimentalAttributes.scala | 33 + .../ProcessExperimentalAttributes.scala | 96 + .../RpcExperimentalAttributes.scala | 285 ++ .../ServerExperimentalAttributes.scala | 52 + .../ServiceExperimentalAttributes.scala | 75 + .../SessionExperimentalAttributes.scala | 33 + .../SourceExperimentalAttributes.scala | 40 + .../SystemExperimentalAttributes.scala | 277 ++ .../TelemetryExperimentalAttributes.scala | 115 + .../ThreadExperimentalAttributes.scala} | 23 +- .../TlsExperimentalAttributes.scala | 221 + .../UrlExperimentalAttributes.scala | 87 + .../UserAgentExperimentalAttributes.scala | 35 + .../WebengineExperimentalAttributes.scala | 40 + .../attributes/ResourceAttributes.scala | 1204 ------ .../trace/attributes/SemanticAttributes.scala | 3560 ----------------- .../otel4s/semconv/ClientAttributes.scala | 44 + .../otel4s/semconv/ErrorAttributes.scala | 58 + .../otel4s/semconv/HttpAttributes.scala | 165 + .../otel4s/semconv/JvmAttributes.scala | 102 + .../otel4s/semconv/NetworkAttributes.scala | 120 + .../otel4s/semconv/ServerAttributes.scala | 44 + .../otel4s/semconv/UrlAttributes.scala | 67 + .../otel4s/semconv/UserAgentAttributes.scala} | 23 +- 69 files changed, 6589 insertions(+), 5663 deletions(-) create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/AndroidExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/AwsExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/BrowserExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ClientExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CloudExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CloudeventsExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CodeExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ContainerExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DbExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DeploymentExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DestinationExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DeviceExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DiskExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DnsExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/EnduserExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ErrorExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/EventExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ExceptionExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/FaasExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/FeatureFlagExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/GcpExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/GraphqlExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HerokuExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HostExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HttpExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/JvmExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/K8sExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/LogExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/MessageExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/MessagingExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/NetExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/NetworkExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OciExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OpentracingExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OsExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OtelExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OtherExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/PeerExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/PoolExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ProcessExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/RpcExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ServerExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ServiceExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SessionExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SourceExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SystemExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/TelemetryExperimentalAttributes.scala rename semconv/{src/test/scala/org/typelevel/otel4s/semconv/trace/attributes/SemanticAttributesSuite.scala => experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ThreadExperimentalAttributes.scala} (52%) create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/TlsExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/UrlExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/UserAgentExperimentalAttributes.scala create mode 100644 semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/WebengineExperimentalAttributes.scala delete mode 100644 semconv/src/main/scala/org/typelevel/otel4s/semconv/resource/attributes/ResourceAttributes.scala delete mode 100644 semconv/src/main/scala/org/typelevel/otel4s/semconv/trace/attributes/SemanticAttributes.scala create mode 100644 semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ClientAttributes.scala create mode 100644 semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ErrorAttributes.scala create mode 100644 semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/HttpAttributes.scala create mode 100644 semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/JvmAttributes.scala create mode 100644 semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/NetworkAttributes.scala create mode 100644 semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ServerAttributes.scala create mode 100644 semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/UrlAttributes.scala rename semconv/{src/test/scala/org/typelevel/otel4s/semconv/resource/attributes/ResourceAttributesSuite.scala => stable/src/main/scala/org/typelevel/otel4s/semconv/UserAgentAttributes.scala} (53%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc9d03fd8..b4994450e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,11 +88,11 @@ jobs: - name: Make target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: mkdir -p oteljava/metrics/target sdk-exporter/common/.js/target sdk/common/.native/target sdk/common/.js/target core/trace/.js/target semconv/.jvm/target sdk-exporter/all/.jvm/target sdk/trace/.js/target core/common/.jvm/target sdk-exporter/common/.native/target oteljava/common-testkit/target sdk-exporter/trace/.jvm/target unidocs/target oteljava/trace-testkit/target core/metrics/.native/target core/all/.native/target sdk/trace-testkit/.jvm/target sdk/trace-testkit/.native/target core/metrics/.jvm/target core/all/.js/target sdk-exporter/proto/.jvm/target sdk-exporter/proto/.js/target sdk/all/.native/target core/metrics/.js/target core/all/.jvm/target sdk-exporter/trace/.native/target sdk/common/.jvm/target core/trace/.native/target oteljava/metrics-testkit/target sdk/trace/.native/target semconv/.js/target oteljava/common/target scalafix/rules/target sdk-exporter/proto/.native/target core/trace/.jvm/target sdk-exporter/common/.jvm/target sdk-exporter/trace/.js/target core/common/.native/target sdk/trace-testkit/.js/target core/common/.js/target oteljava/trace/target oteljava/testkit/target semconv/.native/target sdk-exporter/all/.js/target sdk/all/.js/target sdk/all/.jvm/target sdk-exporter/all/.native/target oteljava/all/target sdk/trace/.jvm/target project/target + run: mkdir -p semconv/stable/.jvm/target oteljava/metrics/target sdk-exporter/common/.js/target sdk/common/.native/target sdk/common/.js/target core/trace/.js/target sdk-exporter/all/.jvm/target semconv/experimental/.js/target sdk/trace/.js/target core/common/.jvm/target sdk-exporter/common/.native/target oteljava/common-testkit/target sdk-exporter/trace/.jvm/target unidocs/target oteljava/trace-testkit/target core/metrics/.native/target core/all/.native/target sdk/trace-testkit/.jvm/target sdk/trace-testkit/.native/target semconv/experimental/.native/target core/metrics/.jvm/target core/all/.js/target sdk-exporter/proto/.jvm/target sdk-exporter/proto/.js/target semconv/stable/.native/target sdk/all/.native/target core/metrics/.js/target core/all/.jvm/target sdk-exporter/trace/.native/target sdk/common/.jvm/target core/trace/.native/target oteljava/metrics-testkit/target sdk/trace/.native/target semconv/experimental/.jvm/target oteljava/common/target scalafix/rules/target sdk-exporter/proto/.native/target core/trace/.jvm/target sdk-exporter/common/.jvm/target sdk-exporter/trace/.js/target core/common/.native/target sdk/trace-testkit/.js/target core/common/.js/target oteljava/trace/target oteljava/testkit/target sdk-exporter/all/.js/target sdk/all/.js/target sdk/all/.jvm/target sdk-exporter/all/.native/target oteljava/all/target sdk/trace/.jvm/target semconv/stable/.js/target project/target - name: Compress target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') - run: tar cf targets.tar oteljava/metrics/target sdk-exporter/common/.js/target sdk/common/.native/target sdk/common/.js/target core/trace/.js/target semconv/.jvm/target sdk-exporter/all/.jvm/target sdk/trace/.js/target core/common/.jvm/target sdk-exporter/common/.native/target oteljava/common-testkit/target sdk-exporter/trace/.jvm/target unidocs/target oteljava/trace-testkit/target core/metrics/.native/target core/all/.native/target sdk/trace-testkit/.jvm/target sdk/trace-testkit/.native/target core/metrics/.jvm/target core/all/.js/target sdk-exporter/proto/.jvm/target sdk-exporter/proto/.js/target sdk/all/.native/target core/metrics/.js/target core/all/.jvm/target sdk-exporter/trace/.native/target sdk/common/.jvm/target core/trace/.native/target oteljava/metrics-testkit/target sdk/trace/.native/target semconv/.js/target oteljava/common/target scalafix/rules/target sdk-exporter/proto/.native/target core/trace/.jvm/target sdk-exporter/common/.jvm/target sdk-exporter/trace/.js/target core/common/.native/target sdk/trace-testkit/.js/target core/common/.js/target oteljava/trace/target oteljava/testkit/target semconv/.native/target sdk-exporter/all/.js/target sdk/all/.js/target sdk/all/.jvm/target sdk-exporter/all/.native/target oteljava/all/target sdk/trace/.jvm/target project/target + run: tar cf targets.tar semconv/stable/.jvm/target oteljava/metrics/target sdk-exporter/common/.js/target sdk/common/.native/target sdk/common/.js/target core/trace/.js/target sdk-exporter/all/.jvm/target semconv/experimental/.js/target sdk/trace/.js/target core/common/.jvm/target sdk-exporter/common/.native/target oteljava/common-testkit/target sdk-exporter/trace/.jvm/target unidocs/target oteljava/trace-testkit/target core/metrics/.native/target core/all/.native/target sdk/trace-testkit/.jvm/target sdk/trace-testkit/.native/target semconv/experimental/.native/target core/metrics/.jvm/target core/all/.js/target sdk-exporter/proto/.jvm/target sdk-exporter/proto/.js/target semconv/stable/.native/target sdk/all/.native/target core/metrics/.js/target core/all/.jvm/target sdk-exporter/trace/.native/target sdk/common/.jvm/target core/trace/.native/target oteljava/metrics-testkit/target sdk/trace/.native/target semconv/experimental/.jvm/target oteljava/common/target scalafix/rules/target sdk-exporter/proto/.native/target core/trace/.jvm/target sdk-exporter/common/.jvm/target sdk-exporter/trace/.js/target core/common/.native/target sdk/trace-testkit/.js/target core/common/.js/target oteljava/trace/target oteljava/testkit/target sdk-exporter/all/.js/target sdk/all/.js/target sdk/all/.jvm/target sdk-exporter/all/.native/target oteljava/all/target sdk/trace/.jvm/target semconv/stable/.js/target project/target - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') diff --git a/build.sbt b/build.sbt index 0d149143b..cbae2772e 100644 --- a/build.sbt +++ b/build.sbt @@ -51,7 +51,7 @@ val MUnitDisciplineVersion = "2.0.0-M3" val MUnitScalaCheckEffectVersion = "2.0.0-M2" val OpenTelemetryVersion = "1.36.0" val OpenTelemetryInstrumentationVersion = "2.2.0" -val OpenTelemetrySemConvVersion = "1.23.1-alpha" +val OpenTelemetrySemConvVersion = "1.24.0-alpha" val OpenTelemetryProtoVersion = "1.1.0-alpha" val PekkoStreamVersion = "1.0.2" val PekkoHttpVersion = "1.0.1" @@ -110,7 +110,8 @@ lazy val root = tlCrossRootProject `oteljava-trace-testkit`, `oteljava-testkit`, oteljava, - semconv, + `semconv-stable`, + `semconv-experimental`, benchmarks, examples, unidocs @@ -196,7 +197,7 @@ lazy val `sdk-common` = crossProject(JVMPlatform, JSPlatform, NativePlatform) .crossType(CrossType.Pure) .enablePlugins(BuildInfoPlugin) .in(file("sdk/common")) - .dependsOn(`core-common` % "compile->compile;test->test", semconv) + .dependsOn(`core-common` % "compile->compile;test->test", `semconv-stable`) .settings( name := "otel4s-sdk-common", startYear := Some(2023), @@ -478,24 +479,41 @@ lazy val oteljava = project .settings(munitDependencies) .settings(scalafixSettings) -lazy val semconv = crossProject(JVMPlatform, JSPlatform, NativePlatform) - .crossType(CrossType.Pure) - .enablePlugins(BuildInfoPlugin) - .in(file("semconv")) - .dependsOn(`core-common`) - .settings( - name := "otel4s-semconv", - startYear := Some(2023), - // We use opentelemetry-semconv dependency to track releases of the OpenTelemetry semantic convention spec - libraryDependencies += "io.opentelemetry.semconv" % "opentelemetry-semconv" % OpenTelemetrySemConvVersion % "compile-internal" intransitive (), - buildInfoPackage := "org.typelevel.otel4s.semconv", - buildInfoOptions += sbtbuildinfo.BuildInfoOption.PackagePrivate, - buildInfoKeys := Seq[BuildInfoKey]( - "openTelemetrySemanticConventionsVersion" -> OpenTelemetrySemConvVersion +lazy val `semconv-stable` = + crossProject(JVMPlatform, JSPlatform, NativePlatform) + .crossType(CrossType.Pure) + .enablePlugins(BuildInfoPlugin) + .in(file("semconv/stable")) + .dependsOn(`core-common`) + .settings( + name := "otel4s-semconv", + startYear := Some(2023), + description := "Stable semantic conventions.", + // We use opentelemetry-semconv dependency to track releases of the OpenTelemetry semantic convention spec + libraryDependencies += "io.opentelemetry.semconv" % "opentelemetry-semconv" % OpenTelemetrySemConvVersion % "compile-internal" intransitive (), + buildInfoPackage := "org.typelevel.otel4s.semconv", + buildInfoOptions += sbtbuildinfo.BuildInfoOption.PackagePrivate, + buildInfoKeys := Seq[BuildInfoKey]( + "openTelemetrySemanticConventionsVersion" -> OpenTelemetrySemConvVersion + ) ) - ) - .settings(munitDependencies) - .settings(scalafixSettings) + .settings(munitDependencies) + .settings(scalafixSettings) + +lazy val `semconv-experimental` = + crossProject(JVMPlatform, JSPlatform, NativePlatform) + .crossType(CrossType.Pure) + .in(file("semconv/experimental")) + .dependsOn(`core-common`) + .settings( + name := "otel4s-semconv-experimental", + description := "Experimental (incubating) semantic conventions. Breaking changes expected. Library instrumentation SHOULD NOT depend on this.", + startYear := Some(2023), + // We use opentelemetry-semconv dependency to track releases of the OpenTelemetry semantic convention spec + libraryDependencies += "io.opentelemetry.semconv" % "opentelemetry-semconv-incubating" % OpenTelemetrySemConvVersion % "compile-internal" intransitive (), + ) + .settings(munitDependencies) + .settings(scalafixSettings) lazy val scalafix = tlScalafixProject .rulesSettings( @@ -617,6 +635,7 @@ lazy val unidocs = project `oteljava-trace-testkit`, `oteljava-testkit`, oteljava, - semconv.jvm + `semconv-stable`.jvm, + `semconv-experimental`.jvm ) ) diff --git a/buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 b/buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 index f822afc3d..fb9249c52 100644 --- a/buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +++ b/buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 @@ -1,20 +1,3 @@ -/* - * Copyright 2023 Typelevel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - {%- macro to_scala_return_type(type) -%} {%- if type == "string" -%} String @@ -30,6 +13,7 @@ {{type}} {%- endif -%} {%- endmacro %} + {%- macro to_scala_key_type(type) -%} {%- if type == "string" -%} string @@ -42,829 +26,105 @@ {%- elif type == "double" -%} double {%- else -%} - {{lowerFirst(type)}} + {{type | to_camelcase(False)}} {%- endif -%} {%- endmacro %} + {%- macro print_value(type, value) -%} {{ "\"" if type == "String"}}{{value}}{{ "\"" if type == "String"}} {%- endmacro %} -{%- macro upFirst(text) -%} - {{ text[0]|upper}}{{text[1:] }} -{%- endmacro %} -{%- macro lowerFirst(text) -%} - {{ text[0]|lower}}{{text[1:] }} + +{%- macro stable_class_ref(const_name, separator) -%} +{{stablePkg}}.{{ root_namespace | to_camelcase(True) }}Attributes{{separator}}{{const_name}} {%- endmacro %} +{%- if filter != 'any' %} +{%- set filtered_attributes = attributes_and_templates | select(filter) | list %} +{%- else %} +{%- set filtered_attributes = attributes_and_templates | list %} +{%- endif %} + +{%- set filtered_enums = filtered_attributes | selectattr('is_enum', 'equalto', true) | list %} +{%- set excluded_namespaces_list = excluded_namespaces.replace("\"", "").split(' ') %} + +{%- if root_namespace not in excluded_namespaces_list and filtered_attributes | count > 0 -%} +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package {{pkg | trim}} import org.typelevel.otel4s.AttributeKey import org.typelevel.otel4s.AttributeKey._ // DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention{{template}} -object {{class}} { - /** - * The URL of the OpenTelemetry schema for these keys and values. - */ - final val SchemaUrl = "{{schemaUrl}}" - {%- for attribute in attributes if attribute.is_local and not attribute.ref %} +object {{ root_namespace | to_camelcase(True) }}{{ classPrefix }}Attributes { + + {%- for attribute in filtered_attributes %} + + {% set attribute_const_name = attribute.fqn | to_camelcase(True) -%} /** * {{ attribute.brief | regex_replace(pattern='\\$', replace='') | render_markdown(code="`{0}`", paragraph="{0}") }} {%- if attribute.note %} * - *

Notes: -

+ * @note {{attribute.note | render_markdown(code="`{0}`", paragraph="\n * - {0}", list="{0}")}} {%- endif %} */ - {%- if (attribute.stability | string()) == "StabilityLevel.DEPRECATED" %} - @deprecated("{{attribute.brief | regex_replace("Deprecated\, ", "") | capitalize | to_doc_brief}}", "0.3.0") - {%- endif %} - val {{attribute.fqn | to_camelcase(True)}}: AttributeKey[{{upFirst(to_scala_return_type(attribute.attr_type | string))}}] = {{to_scala_key_type(attribute.attr_type | string)}}("{{attribute.fqn}}") + {%- if attribute | is_deprecated %} + @deprecated("{{attribute.brief | regex_replace("Deprecated\, ", "") | capitalize | to_doc_brief}}", "0.5.0") + {%- elif attribute | is_stable and stablePkg != "" %} + @deprecated("use `{{stable_class_ref(attribute_const_name, '.')}}` instead.", "0.5.0") + {%- endif %} + {%- if attribute | is_template %} + val {{attribute_const_name}}: AttributeKey[{{to_scala_return_type(attribute.instantiated_type | string) | first_up}}] = {{to_scala_key_type(attribute.instantiated_type | string)}}("{{attribute.fqn}}") + {%- else %} + val {{attribute_const_name}}: AttributeKey[{{to_scala_return_type(attribute.attr_type | string) | first_up}}] = {{to_scala_key_type(attribute.attr_type | string)}}("{{attribute.fqn}}") + {%- endif %} {%- endfor %} + {%- if filtered_enums | count > 0 %} // Enum definitions - {%- for attribute in attributes if attribute.is_local and not attribute.ref %} - {%- if attribute.is_enum %} - {%- set class_name = attribute.fqn | to_camelcase(True) ~ "Value" %} - {%- set type = to_scala_return_type(attribute.attr_type.enum_type) %} + {% endif %} + {%- for enum_attribute in filtered_enums %} + {%- set class_name = enum_attribute.fqn | to_camelcase(True) ~ "Value" %} + {%- set type = to_scala_return_type(enum_attribute.attr_type.enum_type) %} + /** + * Values for [[{{ enum_attribute.fqn | to_camelcase(True) }}]]. + */ + {%- if enum_attribute | is_deprecated %} + @deprecated("{{enum_attribute.brief | regex_replace("Deprecated\, ", "") | capitalize | to_doc_brief}}", "0.5.0") + {%- elif enum_attribute | is_stable and stablePkg != "" %} + @deprecated("use `{{stable_class_ref(class_name, '.')}}` instead.", "0.5.0") + {%- endif %} abstract class {{ class_name }}(val value: {{ type }}) - object {{class_name}} { - {%- for member in attribute.attr_type.members %} - /** {% filter escape %}{{member.brief | to_doc_brief}}.{% endfilter %} */ - case object {{ member.member_id | to_camelcase(True) }} extends {{class_name}}({{ print_value(type, member.value) }}) - {%- endfor %} - - {%- if class_name == "NetTransportValue" %} - /** @deprecated This item has been removed as of 1.13.0 of the semantic conventions. */ - @deprecated("This item has been removed", "0.3.0") - case object Ip extends NetTransportValue("ip") - /** @deprecated This item has been removed as of 1.13.0 of the semantic conventions. */ - @deprecated("This item has been removed", "0.3.0") - case object Unix extends NetTransportValue("unix") - {%- endif %} - + {%- if (enum_attribute | is_deprecated) or (enum_attribute | is_stable and stablePkg != "") %} + @annotation.nowarn("cat=deprecation") + {%- endif %} + object {{ class_name }} { + {%- for member in enum_attribute.attr_type.members %} + /** {% filter escape %}{{member.brief | to_doc_brief}}.{% endfilter %} */ + case object {{ member.member_id | to_camelcase(True) }} extends {{class_name}}({{ print_value(type, member.value) }}) + {%- endfor %} {%- if class_name == "TelemetrySdkLanguageValue" %} /** scala. */ case object Scala extends TelemetrySdkLanguageValue("scala") {%- endif %} - - - {%- if class_name == "MessagingOperationValue" %} - /** - * process. - * - * @deprecated this value has been removed as of 1.23.1 of the semantic conventions. - */ - @deprecated("The item has been removed", "0.4.0") - case object Process extends MessagingOperationValue("process") - - {% endif %} - - {%- if class_name == "SystemMemoryStateValue" %} - - /** - * total. - * - * @deprecated this value has been removed as of 1.23.1 of the semantic conventions. - */ - @deprecated("The item has been removed", "0.4.0") - case object Total extends SystemMemoryStateValue("total") - - {% endif %} - } - {% endif %} {%- endfor %} - {%- if class == "SemanticAttributes" %} - // Manually defined and not YET in the YAML - /** - * The name of an event describing an exception. - * - *

Typically an event with that name should not be manually created. Instead - * `org.typelevel.otel4s.trace.Span#recordException(Throwable)` should be used. - */ - final val ExceptionEventName = "exception" - - /** - * The name of the keyspace being accessed. - * - * @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use [[SemanticAttributes.DbName]] instead. - */ - @deprecated("Use SemanticAttributes.DbName instead", "0.3.0") - val DbCassandraKeyspace = string("db.cassandra.keyspace") - - /** - * The HBase namespace being accessed. - * - * @deprecated this item has been removed as of 1.8.0 of the semantic conventions. Please use [[SemanticAttributes.DbName]] instead. - */ - @deprecated("Use SemanticAttributes.DbName instead", "0.3.0") - val DbHbaseNameSpace = string("db.hbase.namespace") - - /** - * The size of the uncompressed request payload body after transport decoding. Not set if - * transport encoding not used. - * - * @deprecated this item has been removed as of 1.13.0 of the semantic conventions. Please use [[SemanticAttributes.HttpRequestContentLength]] instead. - */ - @deprecated("Use SemanticAttributes.HttpRequestContentLength instead", "0.3.0") - val HttpRequestContentLengthUncompressed = long("http.request_content_length_uncompressed") - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use [[SemanticAttributes.HttpResponseContentLength]] instead. - */ - @deprecated("Use SemanticAttributes.HttpResponseContentLength instead", "0.3.0") - val HttpResponseContentLengthUncompressed = long("http.response_content_length_uncompressed") - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * [[SemanticAttributes.NetHostName]] instead. - */ - @deprecated("Use SemanticAttributes.NetHostName instead", "0.3.0") - val HttpServerName = string("http.server_name") - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use - * [[SemanticAttributes.NetHostName]] instead. - */ - @deprecated("Use SemanticAttributes.NetHostName instead", "0.3.0") - val HttpHost = string("http.host") - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use [[SemanticAttributes.NetSockPeerAddr]] instead. - */ - @deprecated("Use SemanticAttributes.NetSockPeerAddr instead", "0.3.0") - val NetPeerIp = string("net.peer.ip") - - /** - * @deprecated This item has been removed as of 1.13.0 of the semantic conventions. Please use [[SemanticAttributes.NetSockHostAddr]] instead. - */ - @deprecated("Use SemanticAttributes.NetSockHostAddr instead", "0.3.0") - val NetHostIp = string("net.host.ip") - - /** - * The ordinal number of request re-sending attempt. - * @deprecated This item has been removed as of 1.15.0 of the semantic conventions. Use [[SemanticAttributes.HttpResendCount]] instead. - */ - @deprecated("Use SemanticAttributes.HttpResendCount instead", "0.3.0") - val HttpRetryCount = long("http.retry_count") - - - /** - * A string identifying the messaging system. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use [[SemanticAttributes.MessagingDestinationName]] instead. - */ - @deprecated("Use SemanticAttributes.MessagingDestinationName instead", "0.3.0") - val MessagingDestination = string("messaging.destination") - - /** - * A boolean that is true if the message destination is temporary. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use [[SemanticAttributes.MessagingDestinationTemporary]] instead. - */ - @deprecated("Use SemanticAttributes.MessagingDestinationTemporary instead", "0.3.0") - val MessagingTempDestination = boolean("messaging.temp_destination") - - /** - * The name of the transport protocol. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use [[SemanticAttributes.NetAppProtocolName]] instead. - */ - @deprecated("Use SemanticAttributes.NetAppProtocolName instead", "0.3.0") - val MessagingProtocol = string("messaging.protocol") - - /** - * The version of the transport protocol. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use [[SemanticAttributes.NetAppProtocolVersion]] instead. - */ - @deprecated("Use SemanticAttributes.NetAppProtocolVersion instead", "0.3.0") - val MessagingProtocolVersion = string("messaging.protocol_version") - - /** - * Connection string. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. There is no replacement. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingUrl = string("messaging.url") - - /** - * The conversation ID identifying the conversation to which the - * message belongs, represented as a string. Sometimes called "Correlation ID". - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use [[SemanticAttributes.MessagingMessageConversationId]] instead. - */ - @deprecated("Use SemanticAttributes.MessagingMessageConversationId instead", "0.3.0") - val MessagingConversationId = string("messaging.conversation_id") - - /** - * RabbitMQ message routing key. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use [[SemanticAttributes.MessagingRabbitmqDestinationRoutingKey]] instead. - */ - @deprecated("Use SemanticAttributes.MessagingRabbitmqDestinationRoutingKey instead", "0.3.0") - val MessagingRabbitmqRoutingKey = string("messaging.rabbitmq.routing_key") - - /** - * Partition the message is received from. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use [[SemanticAttributes.MessagingKafkaSourcePartition]] instead. - */ - @deprecated("Use SemanticAttributes.MessagingKafkaSourcePartition instead", "0.3.0") - val MessagingKafkaPartition = long("messaging.kafka.partition") - - /** - * A boolean that is true if the message is a tombstone. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use [[SemanticAttributes.MessagingKafkaMessageTombstone]] instead. - */ - @deprecated("Use SemanticAttributes.MessagingKafkaMessageTombstone instead", "0.3.0") - val MessagingKafkaTombstone = boolean("messaging.kafka.tombstone") - - /** - * The timestamp in milliseconds that the delay message is expected to be delivered to consumer. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use [[SemanticAttributes.MessagingRocketmqMessageDeliveryTimestamp]] instead. - */ - @deprecated("Use SemanticAttributes.MessagingRocketmqMessageDeliveryTimestamp instead", "0.3.0") - val MessagingRocketmqDeliveryTimestamp = long("messaging.rocketmq.delivery_timestamp") - - /** - * The delay time level for delay message, which determines the message delay time. - * @deprecated This item has been removed as of 1.17.0 of the semantic conventions. Use [[SemanticAttributes.MessagingRocketmqMessageDelayTimeLevel]] instead. - */ - @deprecated("Use SemanticAttributes.MessagingRocketmqMessageDelayTimeLevel instead", "0.3.0") - val MessagingRocketmqDelayTimeLevel = long("messaging.rocketmq.delay_time_level") - - /** - * The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). - * @deprecated This item has been moved, use [[org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes.OtelScopeName ResourceAttributes.OtelScopeName]] instead. - */ - @deprecated("Use ResourceAttributes.OtelScopeName instead", "0.3.0") - val OtelScopeName = string("otel.scope.name") - - /** - * The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). - * @deprecated This item has been moved, use [[org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes.OtelScopeVersion ResourceAttributes.OtelScopeVersion]] instead. - */ - @deprecated("Use ResourceAttributes.OtelScopeVersion instead", "0.3.0") - val OtelScopeVersion = string("otel.scope.version") - - /** - * The execution ID of the current function execution. - * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. - * Use [[SemanticAttributes.FaasInvocationId]] instead. - */ - @deprecated("Use SemanticAttributes.FaasInvocationId instead", "0.3.0") - val FaasExecution = string("faas.execution") - - /** - * Value of the HTTP - * User-Agent header sent by the client. - * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. - * Use [[SemanticAttributes.UserAgentOriginal]] instead. - */ - @deprecated("Use SemanticAttributes.UserAgentOriginal instead", "0.3.0") - val HttpUserAgent = string("http.user_agent") - - /** - * Deprecated. - * - * @deprecated Deprecated, use the [[org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes.OtelScopeName ResourceAttributes.OtelScopeName]] attribute. - */ - @deprecated("Use ResourceAttributes.OtelScopeName instead", "0.3.0") - val OtelLibraryName = string("otel.library.name") - - /** - * Deprecated. - * - * @deprecated Deprecated, use the [[org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes.OtelScopeVersion ResourceAttributes.OtelScopeVersion]] attribute. - */ - @deprecated("Use ResourceAttributes.OtelScopeVersion instead", "0.3.0") - val OtelLibraryVersion = string("otel.library.version") - - /** - * Kind of HTTP protocol used. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val HttpFlavor = string("http.flavor") - - /** - * Values for [[SemanticAttributes.HttpFlavor]]. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - abstract class HttpFlavorValue(val value: String) - @annotation.nowarn("cat=deprecation") - object HttpFlavorValue { - /** HTTP/1.0. */ - case object Http10 extends HttpFlavorValue("1.0") - /** HTTP/1.1. */ - case object Http11 extends HttpFlavorValue("1.1") - /** HTTP/2. */ - case object Http20 extends HttpFlavorValue("2.0") - /** HTTP/3. */ - case object Http30 extends HttpFlavorValue("3.0") - /** SPDY protocol. */ - case object Spdy extends HttpFlavorValue("SPDY") - /** QUIC protocol. */ - case object Quic extends HttpFlavorValue("QUIC") - } - - /** - * Application layer protocol used. The value SHOULD be normalized to lowercase. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. Use [[SemanticAttributes.NetProtocolName]] instead. - */ - @deprecated("Use SemanticAttributes.NetProtocolName instead", "0.3.0") - val NetAppProtocolName = string("net.app.protocol.name") - - /** - * Version of the application layer protocol used. See note below. - * - *

Notes: - * - *

- * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. Use [[SemanticAttributes.NetProtocolVersion]] instead. - */ - @deprecated("Use SemanticAttributes.NetProtocolVersion instead", "0.3.0") - val NetAppProtocolVersion = string("net.app.protocol.version") - - /** - * The kind of message destination. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingDestinationKind = string("messaging.destination.kind") - - /** - * Enum values for [[SemanticAttributes.MessagingDestinationKind]]. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is not replacement", "0.3.0") - abstract class MessagingDestinationKindValue(val value: String) - @annotation.nowarn("cat=deprecation") - object MessagingDestinationKindValue { - /** A message sent to a queue. */ - case object Queue extends MessagingDestinationKindValue("queue") - /** A message sent to a topic. */ - case object Topic extends MessagingDestinationKindValue("topic") - } - - /** - * The kind of message source. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is not replacement", "0.3.0") - val MessagingSourceKind = string("messaging.source.kind") - - /** - * Values for [[SemanticAttributes.MessagingSourceKind]]. - * @deprecated This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is not replacement", "0.3.0") - abstract class MessagingSourceKindValue(val value: String) - @annotation.nowarn("cat=deprecation") - object MessagingSourceKindValue { - /** A message received from a queue. */ - case object Queue extends MessagingSourceKindValue("queue") - /** A message received from a topic. */ - case object Topic extends MessagingSourceKindValue("topic") - } - - /** - * The internet connection type currently being used by the host. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use [[SemanticAttributes.NetworkConnectionType]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkConnectionType instead", "0.3.0") - val NetHostConnectionType = string("net.host.connection.type") - - /** - * This describes more details regarding the connection.type. It may be the type of cell - * technology connection, but it could be used for describing details about a wifi connection. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use [[SemanticAttributes.NetworkConnectionSubtype]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkConnectionSubtype instead", "0.3.0") - val NetHostConnectionSubtype = string("net.host.connection.subtype") - - /** - * The name of the mobile carrier. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use [[SemanticAttributes.NetworkCarrierName]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkCarrierName instead", "0.3.0") - val NetHostCarrierName = string("net.host.carrier.name") - - /** - * The mobile carrier country code. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use [[SemanticAttributes.NetworkCarrierMcc]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkCarrierMcc instead", "0.3.0") - val NetHostCarrierMcc = string("net.host.carrier.mcc") - - /** - * The mobile carrier network code. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use [[SemanticAttributes.NetworkCarrierMnc]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkCarrierMnc instead", "0.3.0") - val NetHostCarrierMnc = string("net.host.carrier.mnc") - - /** - * The ISO 3166-1 alpha-2 2-character country code associated with the mobile carrier network. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use [[SemanticAttributes.NetworkCarrierIcc]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkCarrierIcc instead", "0.3.0") - val NetHostCarrierIcc = string("net.host.carrier.icc") - - /** - * The IP address of the original client behind all proxies, if known (e.g. from X-Forwarded-For). - * - *

Notes: - * - *

- * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. Use [[SemanticAttributes.ClientAddress]] instead. - */ - @deprecated("Use SemanticAttributes.ClientAddress instead", "0.3.0") - val HttpClientIp = string("http.client_ip") - - /** - * The message source name. - * - *

Notes: - * - *

- * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingSourceName = string("messaging.source.name") - - /** - * Low cardinality representation of the messaging source name. - * - *

Notes: - * - *

- * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingSourceTemplate = string("messaging.source.template") - - /** - * A boolean that is true if the message source is temporary and might not exist anymore after - * messages are processed. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingSourceTemporary = boolean("messaging.source.temporary") - - /** - * A boolean that is true if the message source is anonymous (could be unnamed or have - * auto-generated name). - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingSourceAnonymous = boolean("messaging.source.anonymous") - - /** - * The identifier for the consumer receiving a message. For Kafka, set it to - * `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both are present, or only - * `messaging.kafka.consumer.group`. For brokers, such as RabbitMQ and Artemis, set it to - * the `client_id` of the client consuming the message. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See [[SemanticAttributes.MessagingClientId]]. - */ - @deprecated("Use SemanticAttributes.MessagingClientId instead", "0.3.0") - val MessagingConsumerId = string("messaging.consumer.id") - - /** - * Client Id for the Consumer or Producer that is handling the message. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See [[SemanticAttributes.MessagingClientId]]. - */ - @deprecated("Use SemanticAttributes.MessagingClientId instead", "0.3.0") - val MessagingKafkaClientId = string("messaging.kafka.client_id") - - /** - * Partition the message is received from. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingKafkaSourcePartition = long("messaging.kafka.source.partition") - - /** - * The unique identifier for each client. - * @deprecated This item has been removed in 1.21.0 version of the semantic conventions. See [[SemanticAttributes.MessagingClientId]]. - */ - @deprecated("Use SemanticAttributes.MessagingClientId instead", "0.3.0") - val MessagingRocketmqClientId = string("messaging.rocketmq.client_id") - - /** - * Values for [[SemanticAttributes.NetHostConnectionType]]. - * @deprecated This item has been removed as of 1.21.0 of the semantic conventions. Use [[SemanticAttributes.NetworkConnectionTypeValue]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkConnectionTypeValue", "0.3.0") - abstract class NetHostConnectionTypeValue(val value: String) - @annotation.nowarn("cat=deprecation") - object NetHostConnectionTypeValue { - /** wifi. */ - case object Wifi extends NetHostConnectionTypeValue("wifi") - /** wired. */ - case object Wired extends NetHostConnectionTypeValue("wired") - /** cell. */ - case object Cell extends NetHostConnectionTypeValue("cell") - /** unavailable. */ - case object Unavailable extends NetHostConnectionTypeValue("unavailable") - /** unknown. */ - case object Unknown extends NetHostConnectionTypeValue("unknown") - } - - /** - * Values for [[SemanticAttributes.NetHostConnectionSubtype]]. - * @deprecated This item has been removed as of 1.21.0 of the semantic conventions. Use [[SemanticAttributes.NetworkConnectionSubtypeValue]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkConnectionSubtypeValue", "0.3.0") - abstract class NetHostConnectionSubtypeValue(val value: String) - @annotation.nowarn("cat=deprecation") - object NetHostConnectionSubtypeValue { - /** GPRS. */ - case object Gprs extends NetHostConnectionSubtypeValue("gprs") - /** EDGE. */ - case object Edge extends NetHostConnectionSubtypeValue("edge") - /** UMTS. */ - case object Umts extends NetHostConnectionSubtypeValue("umts") - /** CDMA. */ - case object Cdma extends NetHostConnectionSubtypeValue("cdma") - /** EVDO Rel. 0. */ - case object Evdo0 extends NetHostConnectionSubtypeValue("evdo_0") - /** EVDO Rev. A. */ - case object EvdoA extends NetHostConnectionSubtypeValue("evdo_a") - /** CDMA2000 1XRTT. */ - case object Cdma20001xrtt extends NetHostConnectionSubtypeValue("cdma2000_1xrtt") - /** HSDPA. */ - case object Hsdpa extends NetHostConnectionSubtypeValue("hsdpa") - /** HSUPA. */ - case object Hsupa extends NetHostConnectionSubtypeValue("hsupa") - /** HSPA. */ - case object Hspa extends NetHostConnectionSubtypeValue("hspa") - /** IDEN. */ - case object Iden extends NetHostConnectionSubtypeValue("iden") - /** EVDO Rev. B. */ - case object EvdoB extends NetHostConnectionSubtypeValue("evdo_b") - /** LTE. */ - case object Lte extends NetHostConnectionSubtypeValue("lte") - /** EHRPD. */ - case object Ehrpd extends NetHostConnectionSubtypeValue("ehrpd") - /** HSPAP. */ - case object Hspap extends NetHostConnectionSubtypeValue("hspap") - /** GSM. */ - case object Gsm extends NetHostConnectionSubtypeValue("gsm") - /** TD-SCDMA. */ - case object TdScdma extends NetHostConnectionSubtypeValue("td_scdma") - /** IWLAN. */ - case object Iwlan extends NetHostConnectionSubtypeValue("iwlan") - /** 5G NR (New Radio). */ - case object Nr extends NetHostConnectionSubtypeValue("nr") - /** 5G NRNSA (New Radio Non-Standalone). */ - case object Nrnsa extends NetHostConnectionSubtypeValue("nrnsa") - /** LTE CA. */ - case object LteCa extends NetHostConnectionSubtypeValue("lte_ca") - } - - /** - * Immediate client peer port number. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use [[SemanticAttributes.NetworkPeerPort]] on server telemetry and [[SemanticAttributes.NetworkLocalPort]] on client telemetry instead. - */ - @deprecated("Use SemanticAttributes.NetworkPeerPort or SemanticAttributes.NetworkLocalPort instead", "0.4.0") - val ClientSocketPort = long("client.socket.port") - - /** - * Name of the memory pool. - * - *

Notes: - * - *

- * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use [[SemanticAttributes.JvmMemoryPoolName]] instead. - */ - @deprecated("Use SemanticAttributes.JvmMemoryPoolName instead", "0.4.0") - val Pool = string("pool") - - /** - * The domain name of the source system. - * - *

Notes: - * - *

- * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.4.0") - val SourceDomain = string("source.domain") - - /** - * Physical server IP address or Unix socket address. If set from the client, should simply use - * the socket's peer address, and not attempt to find any actual server IP (i.e., if set from - * client, this may represent some proxy server instead of the logical server). - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use [[SemanticAttributes.NetworkLocalAddress]] on server telemetry and [[SemanticAttributes.NetworkPeerAddress]] on client telemetry instead. - */ - @deprecated("Use SemanticAttributes.NetworkLocalAddress or SemanticAttributes.NetworkPeerAddress instead", "0.4.0") - val ServerSocketAddress = string("server.socket.address") - - /** - * The (uncompressed) size of the message payload in bytes. Also use this attribute if it is - * unknown whether the compressed or uncompressed payload size is reported. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use [[SemanticAttributes.MessagingMessageBodySize]] instead. - */ - @deprecated("Use SemanticAttributes.MessagingMessageBodySize instead", "0.4.0") - val MessagingMessagePayloadSizeBytes = long("messaging.message.payload_size_bytes") - - /** - * The domain name of the destination system. - * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.4.0") - val DestinationDomain = string("destination.domain") - - /** - * The compressed size of the message payload in bytes. - * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.4.0") - val MessagingMessagePayloadCompressedSizeBytes = long("messaging.message.payload_compressed_size_bytes") - - /** - * The domain name of an immediate peer. - * - *

Notes: - * - *

- * - * @deprecated This item has been removed in 1.22.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.4.0") - val ServerSocketDomain = string("server.socket.domain") - - /** - * The type of memory. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use [[SemanticAttributes.JvmMemoryType]] instead. - */ - @deprecated("Use SemanticAttributes.JvmMemoryType instead", "0.4.0") - val Type = string("type") - - /** - * Physical server port. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use [[SemanticAttributes.NetworkLocalPort]] on server telemetry and [[SemanticAttributes.NetworkPeerPort]] on client telemetry instead. - */ - @deprecated("Use SemanticAttributes.NetworkLocalPort or SemanticAttributes.NetworkPeerPort instead", "0.4.0") - val ServerSocketPort = long("server.socket.port") - - /** - * Immediate client peer address - unix domain socket name, IPv4 or IPv6 address. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use [[SemanticAttributes.NetworkPeerAddress]] on server telemetry and [[SemanticAttributes.NetworkLocalAddress]] on client telemetry instead. - */ - @deprecated("Use SemanticAttributes.NetworkPeerAddress or SemanticAttributes.NetworkLocalAddress instead", "0.4.0") - val ClientSocketAddress = string("client.socket.address") - - /** - * @deprecated This item has been renamed as of 1.21.0 of the semantic conventions. Use [[SemanticAttributes.JvmMemoryTypeValue]] instead. - */ - @deprecated("Use SemanticAttributes.JvmMemoryTypeValue instead", "0.4.0") - abstract class TypeValue(val value: String) - @annotation.nowarn("cat=deprecation") - object TypeValue { - /** Heap memory. */ - case object Heap extends TypeValue("heap") - /** Non-heap memory. */ - case object NonHeap extends TypeValue("non_heap") - } - - - /** - * Whether the thread is daemon or not. - * - * @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use [[SemanticAttributes.JvmThreadDaemon]] instead. - */ - @deprecated("Use SemanticAttributes.JvmThreadDaemon instead", "0.4.0") - val ThreadDaemon = boolean("thread.daemon") - - /** - * The ordinal number of request resending attempt (for any reason, including redirects). - * - *

Notes: - * - *

- * - * @deprecated This item has been renamed in 1.23.1 of the semantic conventions. Use [[SemanticAttributes.HttpRequestResendCount]] instead. - */ - @deprecated("Use SemanticAttributes.HttpRequestResendCount instead", "0.4.0") - val HttpResendCount = long("http.resend_count") - - {% endif %} - - {%- if class == "ResourceAttributes" %} - - /** - * Red Hat OpenShift on Google Cloud. - * @deprecated This item has been removed as of 1.18.0 of the semantic conventions. Use [[org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes.CloudPlatform.GcpOpenshift ResourceAttributes.CloudPlatform.GcpOpenshift]] instead. - */ - @deprecated("Use ResourceAttributes.CloudPlatform.GcpOpenshift instead", "0.3.0") - val GcpOpenshift = string("gcp_openshift") - - /** - * Full user-agent string provided by the browser - * - *

Notes: - * - *

- * @deprecated This item has been renamed in 1.19.0 version of the semantic conventions. Use [[org.typelevel.otel4s.semconv.trace.attributes.SemanticAttributes.UserAgentOriginal]] instead. - */ - @deprecated("Use SemanticAttributes.UserAgentOriginal instead", "0.3.0") - val BrowserUserAgent = string("browser.user_agent") - - /** - * The unique ID of the single function that this runtime instance executes. - * - *

Notes: - * - *

- * @deprecated This item has been removed in 1.19.0 version of the semantic conventions. Use [[ResourceAttributes.CloudResourceId]] instead. - */ - @deprecated("Use ResourceAttributes.CloudResourceId instead", "0.3.0") - val FaasId = string("faas.id") - - /** - * The version string of the auto instrumentation agent, if used. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use [[ResourceAttributes.TelemetryDistroVersion]] instead. - */ - @deprecated("Use ResourceAttributes.TelemetryDistroVersion instead", "0.4.0") - val TelemetryAutoVersion = string("telemetry.auto.version") - - /** - * Container image tag. - * - * @deprecated This item has been renamed in 1.22.0 of the semantic conventions. Use [[ResourceAttributes.ContainerImageTags]] instead. - */ - @deprecated("Use ResourceAttributes.ContainerImageTags instead", "0.4.0") - val ContainerImageTag = string("container.image.tag") - - {% endif %} - -} \ No newline at end of file +} +{%- endif %} \ No newline at end of file diff --git a/project/SemanticConventionsGenerator.scala b/project/SemanticConventionsGenerator.scala index 797f79617..ecbf5057d 100644 --- a/project/SemanticConventionsGenerator.scala +++ b/project/SemanticConventionsGenerator.scala @@ -3,16 +3,41 @@ import scala.sys.process._ object SemanticConventionsGenerator { - private val generatorVersion = "0.22.0" + private val generatorVersion = "0.24.0" // generates semantic conventions by using `otel/semconvgen` in docker def generate(version: String, rootDir: File): Unit = { + generateOne(version, rootDir, experimental = false) + generateOne(version, rootDir, experimental = true) + } + + private def generateOne( + version: String, + rootDir: File, + experimental: Boolean + ): Unit = { val semanticConventionsRepoZip = s"https://github.com/open-telemetry/semantic-conventions/archive/v$version.zip" val schemaUrl = s"https://opentelemetry.io/schemas/$version" + val filter = if (experimental) "any" else "is_stable" + val classPrefix = if (experimental) "Experimental" else "" + + val outputDir = + if (experimental) + s"$rootDir/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/" + else + s"$rootDir/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/" + + val packageNameArg = + if (experimental) "org.typelevel.otel4s.semconv.experimental.attributes" + else "org.typelevel.otel4s.semconv.attributes" + + val stablePackageNameArg = + if (experimental) "org.typelevel.otel4s.semconv.attributes" else "" + val buildDir = rootDir / "buildscripts" / "semantic-convention" val zip = buildDir / "semantic-conventions.zip" val conventionsDir = buildDir / s"semantic-conventions-$version" @@ -25,46 +50,30 @@ object SemanticConventionsGenerator { IO.unzip(zip, buildDir) // format: off - val genAttributes = List( - "docker", - "run", - "--rm", - "-v", s"$conventionsDir/model:/source", - "-v", s"$buildDir/templates:/templates", - "-v", s"$rootDir/semconv/src/main/scala/org/typelevel/otel4s/semconv/trace/attributes/:/output", - "--platform", "linux/amd64", - s"otel/semconvgen:$generatorVersion", - "--only", "span,event,attribute_group,scope", - "-f", "/source", "code", - "--template", "/templates/SemanticAttributes.scala.j2", - "--output", "/output/SemanticAttributes.scala", - "-Dsemconv=trace", - "-Dclass=SemanticAttributes", - s"-DschemaUrl=$schemaUrl", - "-Dpkg=org.typelevel.otel4s.semconv.trace.attributes" - ) - - val genResources = List( + val command = List( "docker", "run", "--rm", "-v", s"$conventionsDir/model:/source", "-v", s"$buildDir/templates:/templates", - "-v", s"$rootDir/semconv/src/main/scala/org/typelevel/otel4s/semconv/resource/attributes/:/output", + "-v", s"$outputDir:/output", "--platform", "linux/amd64", s"otel/semconvgen:$generatorVersion", - "--only", "resource", - "-f", "/source", "code", + "--yaml-root", "/source", + "--continue-on-validation-errors", "compatibility", + "code", "--template", "/templates/SemanticAttributes.scala.j2", - "--output", "/output/ResourceAttributes.scala", - "-Dsemconv=trace", - "-Dclass=ResourceAttributes", - s"-DschemaUrl=$schemaUrl", - "-Dpkg=org.typelevel.otel4s.semconv.resource.attributes" + s"--output", s"/output/{{pascal_prefix}}${classPrefix}Attributes.scala", + "--file-per-group", "root_namespace", + // Space delimited list of root namespaces to excluded (i.e. "foo bar") + "-Dexcluded_namespaces=\"ios aspnetcore signalr\"", + s"-Dfilter=$filter", + s"-DclassPrefix=$classPrefix", + s"-Dpkg=$packageNameArg", + s"-DstablePkg=$stablePackageNameArg" ) // format: on - Process(genAttributes, rootDir).! - Process(genResources, rootDir).! + Process(command, rootDir).! } } diff --git a/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/TelemetryResource.scala b/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/TelemetryResource.scala index 9a72b1da7..c3efa0a1c 100644 --- a/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/TelemetryResource.scala +++ b/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/TelemetryResource.scala @@ -21,7 +21,6 @@ import cats.Hash import cats.Show import cats.syntax.all._ import org.typelevel.otel4s.sdk.TelemetryResource.ResourceInitializationError -import org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes._ /** [[TelemetryResource]] serves as a representation of a resource that captures * essential identifying information regarding the entities associated with @@ -94,13 +93,29 @@ sealed trait TelemetryResource { } object TelemetryResource { + private[otel4s] object ResourceAttributes { + val TelemetrySdkName: AttributeKey[String] = + AttributeKey("telemetry.sdk.name") + + val TelemetrySdkLanguage: AttributeKey[String] = + AttributeKey("telemetry.sdk.language") + + val TelemetrySdkVersion: AttributeKey[String] = + AttributeKey("telemetry.sdk.version") + + val ServiceName: AttributeKey[String] = + AttributeKey("service.name") + } + private val Empty: TelemetryResource = TelemetryResource(Attributes.empty, None) private val Default: TelemetryResource = { + import ResourceAttributes._ + val telemetrySdk = Attributes( Attribute(TelemetrySdkName, "otel4s"), - Attribute(TelemetrySdkLanguage, TelemetrySdkLanguageValue.Scala.value), + Attribute(TelemetrySdkLanguage, "scala"), Attribute(TelemetrySdkVersion, BuildInfo.version) ) diff --git a/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/autoconfigure/TelemetryResourceAutoConfigure.scala b/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/autoconfigure/TelemetryResourceAutoConfigure.scala index 1fea1ac2c..11a6b38cd 100644 --- a/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/autoconfigure/TelemetryResourceAutoConfigure.scala +++ b/sdk/common/src/main/scala/org/typelevel/otel4s/sdk/autoconfigure/TelemetryResourceAutoConfigure.scala @@ -22,7 +22,6 @@ import cats.MonadThrow import cats.effect.Resource import cats.syntax.either._ import cats.syntax.traverse._ -import org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes import java.net.URLDecoder import java.nio.charset.StandardCharsets @@ -79,7 +78,7 @@ private final class TelemetryResourceAutoConfigure[F[_]: MonadThrow] .get(ConfigKeys.ServiceName) .toOption .flatten - .map(value => ResourceAttributes.ServiceName(value)) + .map(value => TelemetryResource.ResourceAttributes.ServiceName(value)) val default = TelemetryResource.default val fromEnv = TelemetryResource(attributes ++ serviceName) diff --git a/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/data/EventData.scala b/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/data/EventData.scala index 78783e046..90e1e4a87 100644 --- a/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/data/EventData.scala +++ b/sdk/trace/src/main/scala/org/typelevel/otel4s/sdk/trace/data/EventData.scala @@ -21,7 +21,6 @@ package trace.data import cats.Hash import cats.Show import cats.syntax.show._ -import org.typelevel.otel4s.semconv.trace.attributes.SemanticAttributes import java.io.PrintWriter import java.io.StringWriter @@ -110,13 +109,13 @@ object EventData { val builder = Attributes.newBuilder builder.addOne( - SemanticAttributes.ExceptionType, + "exception.type", exception.getClass.getName ) val message = exception.getMessage if (message != null) { - builder.addOne(SemanticAttributes.ExceptionMessage, message) + builder.addOne("exception.message", message) } if (exception.getStackTrace.nonEmpty) { @@ -125,12 +124,12 @@ object EventData { exception.printStackTrace(printWriter) builder.addOne( - SemanticAttributes.ExceptionStacktrace, + "exception.stacktrace", stringWriter.toString ) } - builder.addOne(SemanticAttributes.ExceptionEscaped, escaped) + builder.addOne("exception.escaped", escaped) builder.addAll(attributes) builder.result() diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/AndroidExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/AndroidExperimentalAttributes.scala new file mode 100644 index 000000000..76f6b60dd --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/AndroidExperimentalAttributes.scala @@ -0,0 +1,67 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object AndroidExperimentalAttributes { + + /** Uniquely identifies the framework API revision offered by a version + * (`os.version`) of the android operating system. More information can be + * found here. + */ + val AndroidOsApiLevel: AttributeKey[String] = string("android.os.api_level") + + /** This attribute represents the state the application has transitioned into + * at the occurrence of the event. + * + * @note + * - The Android lifecycle states are defined in Activity + * lifecycle callbacks, and from which the `OS identifiers` are + * derived. + */ + val AndroidState: AttributeKey[String] = string("android.state") + // Enum definitions + + /** Values for [[AndroidState]]. + */ + abstract class AndroidStateValue(val value: String) + object AndroidStateValue { + + /** Any time before Activity.onResume() or, if the app has no Activity, + * Context.startService() has been called in the app for the first time. + */ + case object Created extends AndroidStateValue("created") + + /** Any time after Activity.onPause() or, if the app has no Activity, + * Context.stopService() has been called when the app was in the foreground + * state. + */ + case object Background extends AndroidStateValue("background") + + /** Any time after Activity.onResume() or, if the app has no Activity, + * Context.startService() has been called when the app was in either the + * created or background states. + */ + case object Foreground extends AndroidStateValue("foreground") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/AwsExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/AwsExperimentalAttributes.scala new file mode 100644 index 000000000..45d17764c --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/AwsExperimentalAttributes.scala @@ -0,0 +1,373 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object AwsExperimentalAttributes { + + /** The JSON-serialized value of each item in the `AttributeDefinitions` + * request field. + */ + val AwsDynamodbAttributeDefinitions: AttributeKey[Seq[String]] = stringSeq( + "aws.dynamodb.attribute_definitions" + ) + + /** The value of the `AttributesToGet` request parameter. + */ + val AwsDynamodbAttributesToGet: AttributeKey[Seq[String]] = stringSeq( + "aws.dynamodb.attributes_to_get" + ) + + /** The value of the `ConsistentRead` request parameter. + */ + val AwsDynamodbConsistentRead: AttributeKey[Boolean] = boolean( + "aws.dynamodb.consistent_read" + ) + + /** The JSON-serialized value of each item in the `ConsumedCapacity` response + * field. + */ + val AwsDynamodbConsumedCapacity: AttributeKey[Seq[String]] = stringSeq( + "aws.dynamodb.consumed_capacity" + ) + + /** The value of the `Count` response parameter. + */ + val AwsDynamodbCount: AttributeKey[Long] = long("aws.dynamodb.count") + + /** The value of the `ExclusiveStartTableName` request parameter. + */ + val AwsDynamodbExclusiveStartTable: AttributeKey[String] = string( + "aws.dynamodb.exclusive_start_table" + ) + + /** The JSON-serialized value of each item in the the + * `GlobalSecondaryIndexUpdates` request field. + */ + val AwsDynamodbGlobalSecondaryIndexUpdates: AttributeKey[Seq[String]] = + stringSeq("aws.dynamodb.global_secondary_index_updates") + + /** The JSON-serialized value of each item of the `GlobalSecondaryIndexes` + * request field + */ + val AwsDynamodbGlobalSecondaryIndexes: AttributeKey[Seq[String]] = stringSeq( + "aws.dynamodb.global_secondary_indexes" + ) + + /** The value of the `IndexName` request parameter. + */ + val AwsDynamodbIndexName: AttributeKey[String] = string( + "aws.dynamodb.index_name" + ) + + /** The JSON-serialized value of the `ItemCollectionMetrics` response field. + */ + val AwsDynamodbItemCollectionMetrics: AttributeKey[String] = string( + "aws.dynamodb.item_collection_metrics" + ) + + /** The value of the `Limit` request parameter. + */ + val AwsDynamodbLimit: AttributeKey[Long] = long("aws.dynamodb.limit") + + /** The JSON-serialized value of each item of the `LocalSecondaryIndexes` + * request field. + */ + val AwsDynamodbLocalSecondaryIndexes: AttributeKey[Seq[String]] = stringSeq( + "aws.dynamodb.local_secondary_indexes" + ) + + /** The value of the `ProjectionExpression` request parameter. + */ + val AwsDynamodbProjection: AttributeKey[String] = string( + "aws.dynamodb.projection" + ) + + /** The value of the `ProvisionedThroughput.ReadCapacityUnits` request + * parameter. + */ + val AwsDynamodbProvisionedReadCapacity: AttributeKey[Double] = double( + "aws.dynamodb.provisioned_read_capacity" + ) + + /** The value of the `ProvisionedThroughput.WriteCapacityUnits` request + * parameter. + */ + val AwsDynamodbProvisionedWriteCapacity: AttributeKey[Double] = double( + "aws.dynamodb.provisioned_write_capacity" + ) + + /** The value of the `ScanIndexForward` request parameter. + */ + val AwsDynamodbScanForward: AttributeKey[Boolean] = boolean( + "aws.dynamodb.scan_forward" + ) + + /** The value of the `ScannedCount` response parameter. + */ + val AwsDynamodbScannedCount: AttributeKey[Long] = long( + "aws.dynamodb.scanned_count" + ) + + /** The value of the `Segment` request parameter. + */ + val AwsDynamodbSegment: AttributeKey[Long] = long("aws.dynamodb.segment") + + /** The value of the `Select` request parameter. + */ + val AwsDynamodbSelect: AttributeKey[String] = string("aws.dynamodb.select") + + /** The the number of items in the `TableNames` response parameter. + */ + val AwsDynamodbTableCount: AttributeKey[Long] = long( + "aws.dynamodb.table_count" + ) + + /** The keys in the `RequestItems` object field. + */ + val AwsDynamodbTableNames: AttributeKey[Seq[String]] = stringSeq( + "aws.dynamodb.table_names" + ) + + /** The value of the `TotalSegments` request parameter. + */ + val AwsDynamodbTotalSegments: AttributeKey[Long] = long( + "aws.dynamodb.total_segments" + ) + + /** The ARN of an ECS + * cluster. + */ + val AwsEcsClusterArn: AttributeKey[String] = string("aws.ecs.cluster.arn") + + /** The Amazon Resource Name (ARN) of an ECS + * container instance. + */ + val AwsEcsContainerArn: AttributeKey[String] = string("aws.ecs.container.arn") + + /** The launch + * type for an ECS task. + */ + val AwsEcsLaunchtype: AttributeKey[String] = string("aws.ecs.launchtype") + + /** The ARN of an ECS + * task definition. + */ + val AwsEcsTaskArn: AttributeKey[String] = string("aws.ecs.task.arn") + + /** The task definition family this task definition is a member of. + */ + val AwsEcsTaskFamily: AttributeKey[String] = string("aws.ecs.task.family") + + /** The revision for this task definition. + */ + val AwsEcsTaskRevision: AttributeKey[String] = string("aws.ecs.task.revision") + + /** The ARN of an EKS cluster. + */ + val AwsEksClusterArn: AttributeKey[String] = string("aws.eks.cluster.arn") + + /** The full invoked ARN as provided on the `Context` passed to the function + * (`Lambda-Runtime-Invoked-Function-Arn` header on the + * `/runtime/invocation/next` applicable). + * + * @note + * - This may be different from `cloud.resource_id` if an alias is + * involved. + */ + val AwsLambdaInvokedArn: AttributeKey[String] = string( + "aws.lambda.invoked_arn" + ) + + /** The Amazon Resource Name(s) (ARN) of the AWS log group(s). + * + * @note + * - See the log + * group ARN format documentation. + */ + val AwsLogGroupArns: AttributeKey[Seq[String]] = stringSeq( + "aws.log.group.arns" + ) + + /** The name(s) of the AWS log group(s) an application is writing to. + * + * @note + * - Multiple log groups must be supported for cases like multi-container + * applications, where a single application has sidecar containers, and + * each write to their own log group. + */ + val AwsLogGroupNames: AttributeKey[Seq[String]] = stringSeq( + "aws.log.group.names" + ) + + /** The ARN(s) of the AWS log stream(s). + * + * @note + * - See the log + * stream ARN format documentation. One log group can contain several + * log streams, so these ARNs necessarily identify both a log group and a + * log stream. + */ + val AwsLogStreamArns: AttributeKey[Seq[String]] = stringSeq( + "aws.log.stream.arns" + ) + + /** The name(s) of the AWS log stream(s) an application is writing to. + */ + val AwsLogStreamNames: AttributeKey[Seq[String]] = stringSeq( + "aws.log.stream.names" + ) + + /** The AWS request ID as returned in the response headers `x-amz-request-id` + * or `x-amz-requestid`. + */ + val AwsRequestId: AttributeKey[String] = string("aws.request_id") + + /** The S3 bucket name the request refers to. Corresponds to the `--bucket` + * parameter of the S3 + * API operations. + * + * @note + * - The `bucket` attribute is applicable to all S3 operations that + * reference a bucket, i.e. that require the bucket name as a mandatory + * parameter. This applies to almost all S3 operations except + * `list-buckets`. + */ + val AwsS3Bucket: AttributeKey[String] = string("aws.s3.bucket") + + /** The source object (in the form `bucket`/`key`) for the copy operation. + * + * @note + * - The `copy_source` attribute applies to S3 copy operations and + * corresponds to the `--copy-source` parameter of the copy-object + * operation within the S3 API. This applies in particular to the + * following operations:
  • copy-object
  • + *
  • upload-part-copy
  • + */ + val AwsS3CopySource: AttributeKey[String] = string("aws.s3.copy_source") + + /** The delete request container that specifies the objects to be deleted. + * + * @note + * - The `delete` attribute is only applicable to the delete-object + * operation. The `delete` attribute corresponds to the `--delete` + * parameter of the delete-objects + * operation within the S3 API. + */ + val AwsS3Delete: AttributeKey[String] = string("aws.s3.delete") + + /** The S3 object key the request refers to. Corresponds to the `--key` + * parameter of the S3 + * API operations. + * + * @note + * - The `key` attribute is applicable to all object-related S3 operations, + * i.e. that require the object key as a mandatory parameter. This + * applies in particular to the following operations:
  • copy-object
  • + *
  • delete-object
  • + *
  • get-object
  • + *
  • head-object
  • + *
  • put-object
  • + *
  • restore-object
  • + *
  • select-object-content
  • + *
  • abort-multipart-upload
  • + *
  • complete-multipart-upload
  • + *
  • create-multipart-upload
  • + *
  • list-parts
  • + *
  • upload-part
  • + *
  • upload-part-copy
  • + */ + val AwsS3Key: AttributeKey[String] = string("aws.s3.key") + + /** The part number of the part being uploaded in a multipart-upload + * operation. This is a positive integer between 1 and 10,000. + * + * @note + * - The `part_number` attribute is only applicable to the upload-part + * and upload-part-copy + * operations. The `part_number` attribute corresponds to the + * `--part-number` parameter of the upload-part + * operation within the S3 API. + */ + val AwsS3PartNumber: AttributeKey[Long] = long("aws.s3.part_number") + + /** Upload ID that identifies the multipart upload. + * + * @note + * - The `upload_id` attribute applies to S3 multipart-upload operations + * and corresponds to the `--upload-id` parameter of the S3 + * API multipart operations. This applies in particular to the + * following operations:
  • abort-multipart-upload
  • + *
  • complete-multipart-upload
  • + *
  • list-parts
  • + *
  • upload-part
  • + *
  • upload-part-copy
  • + */ + val AwsS3UploadId: AttributeKey[String] = string("aws.s3.upload_id") + // Enum definitions + + /** Values for [[AwsEcsLaunchtype]]. + */ + abstract class AwsEcsLaunchtypeValue(val value: String) + object AwsEcsLaunchtypeValue { + + /** ec2. */ + case object Ec2 extends AwsEcsLaunchtypeValue("ec2") + + /** fargate. */ + case object Fargate extends AwsEcsLaunchtypeValue("fargate") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/BrowserExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/BrowserExperimentalAttributes.scala new file mode 100644 index 000000000..d8a715a02 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/BrowserExperimentalAttributes.scala @@ -0,0 +1,70 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object BrowserExperimentalAttributes { + + /** Array of brand name and version separated by a space + * + * @note + * - This value is intended to be taken from the UA client + * hints API (`navigator.userAgentData.brands`). + */ + val BrowserBrands: AttributeKey[Seq[String]] = stringSeq("browser.brands") + + /** Preferred language of the user using the browser + * + * @note + * - This value is intended to be taken from the Navigator API + * `navigator.language`. + */ + val BrowserLanguage: AttributeKey[String] = string("browser.language") + + /** A boolean that is true if the browser is running on a mobile device + * + * @note + * - This value is intended to be taken from the UA client + * hints API (`navigator.userAgentData.mobile`). If unavailable, this + * attribute SHOULD be left unset. + */ + val BrowserMobile: AttributeKey[Boolean] = boolean("browser.mobile") + + /** The platform on which the browser is running + * + * @note + * - This value is intended to be taken from the UA client + * hints API (`navigator.userAgentData.platform`). If unavailable, + * the legacy `navigator.platform` API SHOULD NOT be used instead and + * this attribute SHOULD be left unset in order for the values to be + * consistent. The list of possible values is defined in the W3C + * User-Agent Client Hints specification. Note that some (but not + * all) of these values can overlap with values in the `os.type` and `os.name` attributes. However, for + * consistency, the values in the `browser.platform` attribute should + * capture the exact value that the user agent provides. + */ + val BrowserPlatform: AttributeKey[String] = string("browser.platform") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ClientExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ClientExperimentalAttributes.scala new file mode 100644 index 000000000..8ce248d78 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ClientExperimentalAttributes.scala @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ClientExperimentalAttributes { + + /** Client address - domain name if available without reverse DNS lookup; + * otherwise, IP address or Unix domain socket name. + * + * @note + * - When observed from the server side, and when communicating through an + * intermediary, `client.address` SHOULD represent the client address + * behind any intermediaries, for example proxies, if it's available. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.ClientAttributes.ClientAddress` instead.", + "0.5.0" + ) + val ClientAddress: AttributeKey[String] = string("client.address") + + /** Client port number. + * + * @note + * - When observed from the server side, and when communicating through an + * intermediary, `client.port` SHOULD represent the client port behind + * any intermediaries, for example proxies, if it's available. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.ClientAttributes.ClientPort` instead.", + "0.5.0" + ) + val ClientPort: AttributeKey[Long] = long("client.port") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CloudExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CloudExperimentalAttributes.scala new file mode 100644 index 000000000..e6e7ab2b0 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CloudExperimentalAttributes.scala @@ -0,0 +1,229 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object CloudExperimentalAttributes { + + /** The cloud account ID the resource is assigned to. + */ + val CloudAccountId: AttributeKey[String] = string("cloud.account.id") + + /** Cloud regions often have multiple, isolated locations known as zones to + * increase availability. Availability zone represents the zone where the + * resource is running. + * + * @note + * - Availability zones are called "zones" on Alibaba Cloud and + * Google Cloud. + */ + val CloudAvailabilityZone: AttributeKey[String] = string( + "cloud.availability_zone" + ) + + /** The cloud platform in use. + * + * @note + * - The prefix of the service SHOULD match the one specified in + * `cloud.provider`. + */ + val CloudPlatform: AttributeKey[String] = string("cloud.platform") + + /** Name of the cloud provider. + */ + val CloudProvider: AttributeKey[String] = string("cloud.provider") + + /** The geographical region the resource is running. + * + * @note + * - Refer to your provider's docs to see the available regions, for + * example Alibaba + * Cloud regions, AWS + * regions, Azure + * regions, Google + * Cloud regions, or Tencent + * Cloud regions. + */ + val CloudRegion: AttributeKey[String] = string("cloud.region") + + /** Cloud provider-specific native identifier of the monitored cloud resource + * (e.g. an ARN + * on AWS, a fully + * qualified resource ID on Azure, a full + * resource name on GCP) + * + * @note + * - On some cloud providers, it may not be possible to determine the full + * ID at startup, so it may be necessary to set `cloud.resource_id` as a + * span attribute instead. + * - The exact value to use for `cloud.resource_id` depends on the cloud + * provider. The following well-known definitions MUST be used if you set + * this attribute and they apply:
  • AWS Lambda: The + * function ARN. + * Take care not to use the "invoked ARN" directly but replace + * any alias + * suffix with the resolved function version, as the same runtime + * instance may be invokable with multiple different aliases.
  • + *
  • GCP: The URI of + * the resource
  • Azure: The Fully + * Qualified Resource ID of the invoked function, not the + * function app, having the form + * `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. + * This means that a span attribute MUST be used, as an Azure function + * app can host multiple functions that would usually share a + * TracerProvider.
  • + */ + val CloudResourceId: AttributeKey[String] = string("cloud.resource_id") + // Enum definitions + + /** Values for [[CloudPlatform]]. + */ + abstract class CloudPlatformValue(val value: String) + object CloudPlatformValue { + + /** Alibaba Cloud Elastic Compute Service. */ + case object AlibabaCloudEcs extends CloudPlatformValue("alibaba_cloud_ecs") + + /** Alibaba Cloud Function Compute. */ + case object AlibabaCloudFc extends CloudPlatformValue("alibaba_cloud_fc") + + /** Red Hat OpenShift on Alibaba Cloud. */ + case object AlibabaCloudOpenshift + extends CloudPlatformValue("alibaba_cloud_openshift") + + /** AWS Elastic Compute Cloud. */ + case object AwsEc2 extends CloudPlatformValue("aws_ec2") + + /** AWS Elastic Container Service. */ + case object AwsEcs extends CloudPlatformValue("aws_ecs") + + /** AWS Elastic Kubernetes Service. */ + case object AwsEks extends CloudPlatformValue("aws_eks") + + /** AWS Lambda. */ + case object AwsLambda extends CloudPlatformValue("aws_lambda") + + /** AWS Elastic Beanstalk. */ + case object AwsElasticBeanstalk + extends CloudPlatformValue("aws_elastic_beanstalk") + + /** AWS App Runner. */ + case object AwsAppRunner extends CloudPlatformValue("aws_app_runner") + + /** Red Hat OpenShift on AWS (ROSA). */ + case object AwsOpenshift extends CloudPlatformValue("aws_openshift") + + /** Azure Virtual Machines. */ + case object AzureVm extends CloudPlatformValue("azure_vm") + + /** Azure Container Instances. */ + case object AzureContainerInstances + extends CloudPlatformValue("azure_container_instances") + + /** Azure Kubernetes Service. */ + case object AzureAks extends CloudPlatformValue("azure_aks") + + /** Azure Functions. */ + case object AzureFunctions extends CloudPlatformValue("azure_functions") + + /** Azure App Service. */ + case object AzureAppService extends CloudPlatformValue("azure_app_service") + + /** Azure Red Hat OpenShift. */ + case object AzureOpenshift extends CloudPlatformValue("azure_openshift") + + /** Google Bare Metal Solution (BMS). */ + case object GcpBareMetalSolution + extends CloudPlatformValue("gcp_bare_metal_solution") + + /** Google Cloud Compute Engine (GCE). */ + case object GcpComputeEngine + extends CloudPlatformValue("gcp_compute_engine") + + /** Google Cloud Run. */ + case object GcpCloudRun extends CloudPlatformValue("gcp_cloud_run") + + /** Google Cloud Kubernetes Engine (GKE). */ + case object GcpKubernetesEngine + extends CloudPlatformValue("gcp_kubernetes_engine") + + /** Google Cloud Functions (GCF). */ + case object GcpCloudFunctions + extends CloudPlatformValue("gcp_cloud_functions") + + /** Google Cloud App Engine (GAE). */ + case object GcpAppEngine extends CloudPlatformValue("gcp_app_engine") + + /** Red Hat OpenShift on Google Cloud. */ + case object GcpOpenshift extends CloudPlatformValue("gcp_openshift") + + /** Red Hat OpenShift on IBM Cloud. */ + case object IbmCloudOpenshift + extends CloudPlatformValue("ibm_cloud_openshift") + + /** Tencent Cloud Cloud Virtual Machine (CVM). */ + case object TencentCloudCvm extends CloudPlatformValue("tencent_cloud_cvm") + + /** Tencent Cloud Elastic Kubernetes Service (EKS). */ + case object TencentCloudEks extends CloudPlatformValue("tencent_cloud_eks") + + /** Tencent Cloud Serverless Cloud Function (SCF). */ + case object TencentCloudScf extends CloudPlatformValue("tencent_cloud_scf") + } + + /** Values for [[CloudProvider]]. + */ + abstract class CloudProviderValue(val value: String) + object CloudProviderValue { + + /** Alibaba Cloud. */ + case object AlibabaCloud extends CloudProviderValue("alibaba_cloud") + + /** Amazon Web Services. */ + case object Aws extends CloudProviderValue("aws") + + /** Microsoft Azure. */ + case object Azure extends CloudProviderValue("azure") + + /** Google Cloud Platform. */ + case object Gcp extends CloudProviderValue("gcp") + + /** Heroku Platform as a Service. */ + case object Heroku extends CloudProviderValue("heroku") + + /** IBM Cloud. */ + case object IbmCloud extends CloudProviderValue("ibm_cloud") + + /** Tencent Cloud. */ + case object TencentCloud extends CloudProviderValue("tencent_cloud") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CloudeventsExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CloudeventsExperimentalAttributes.scala new file mode 100644 index 000000000..fa6f33dae --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CloudeventsExperimentalAttributes.scala @@ -0,0 +1,64 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object CloudeventsExperimentalAttributes { + + /** The event_id + * uniquely identifies the event. + */ + val CloudeventsEventId: AttributeKey[String] = string("cloudevents.event_id") + + /** The source + * identifies the context in which an event happened. + */ + val CloudeventsEventSource: AttributeKey[String] = string( + "cloudevents.event_source" + ) + + /** The version + * of the CloudEvents specification which the event uses. + */ + val CloudeventsEventSpecVersion: AttributeKey[String] = string( + "cloudevents.event_spec_version" + ) + + /** The subject + * of the event in the context of the event producer (identified by source). + */ + val CloudeventsEventSubject: AttributeKey[String] = string( + "cloudevents.event_subject" + ) + + /** The event_type + * contains a value describing the type of event related to the originating + * occurrence. + */ + val CloudeventsEventType: AttributeKey[String] = string( + "cloudevents.event_type" + ) + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CodeExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CodeExperimentalAttributes.scala new file mode 100644 index 000000000..a340935c4 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/CodeExperimentalAttributes.scala @@ -0,0 +1,57 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object CodeExperimentalAttributes { + + /** The column number in `code.filepath` best representing the operation. It + * SHOULD point within the code unit named in `code.function`. + */ + val CodeColumn: AttributeKey[Long] = long("code.column") + + /** The source code file name that identifies the code unit as uniquely as + * possible (preferably an absolute file path). + */ + val CodeFilepath: AttributeKey[String] = string("code.filepath") + + /** The method or function name, or equivalent (usually rightmost part of the + * code unit's name). + */ + val CodeFunction: AttributeKey[String] = string("code.function") + + /** The line number in `code.filepath` best representing the operation. It + * SHOULD point within the code unit named in `code.function`. + */ + val CodeLineno: AttributeKey[Long] = long("code.lineno") + + /** The "namespace" within which `code.function` is defined. Usually + * the qualified class or module name, such that `code.namespace` + some + * separator + `code.function` form a unique identifier for the code unit. + */ + val CodeNamespace: AttributeKey[String] = string("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. + */ + val CodeStacktrace: AttributeKey[String] = string("code.stacktrace") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ContainerExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ContainerExperimentalAttributes.scala new file mode 100644 index 000000000..0c34e6ea8 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ContainerExperimentalAttributes.scala @@ -0,0 +1,108 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ContainerExperimentalAttributes { + + /** The command used to run the container (i.e. the command name). + * + * @note + * - If using embedded credentials or sensitive data, it is recommended to + * remove them to prevent potential leakage. + */ + val ContainerCommand: AttributeKey[String] = string("container.command") + + /** All the command arguments (including the command/executable itself) run by + * the container. [2] + */ + val ContainerCommandArgs: AttributeKey[Seq[String]] = stringSeq( + "container.command_args" + ) + + /** The full command run by the container as a single string representing the + * full command. [2] + */ + val ContainerCommandLine: AttributeKey[String] = string( + "container.command_line" + ) + + /** Container ID. Usually a UUID, as for example used to identify + * Docker containers. The UUID might be abbreviated. + */ + val ContainerId: AttributeKey[String] = string("container.id") + + /** Runtime specific image identifier. Usually a hash algorithm followed by a + * UUID. + * + * @note + * - Docker defines a sha256 of the image id; `container.image.id` + * corresponds to the `Image` field from the Docker container inspect API + * endpoint. K8s defines a link to the container registry repository with + * digest `"imageID": "registry.azurecr.io + * /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. + * The ID is assinged by the container runtime and can vary in different + * environments. Consider using `oci.manifest.digest` if it is important + * to identify the same image in different environments/runtimes. + */ + val ContainerImageId: AttributeKey[String] = string("container.image.id") + + /** Name of the image the container was built on. + */ + val ContainerImageName: AttributeKey[String] = string("container.image.name") + + /** Repo digests of the container image as provided by the container runtime. + * + * @note + * - Docker + * and CRI + * report those under the `RepoDigests` field. + */ + val ContainerImageRepoDigests: AttributeKey[Seq[String]] = stringSeq( + "container.image.repo_digests" + ) + + /** Container image tags. An example can be found in Docker + * Image Inspect. Should be only the `` section of the full name for + * example from `registry.example.com/my-org/my-image:`. + */ + val ContainerImageTags: AttributeKey[Seq[String]] = stringSeq( + "container.image.tags" + ) + + /** Container labels, `` being the label name, the value being the label + * value. + */ + val ContainerLabels: AttributeKey[String] = string("container.labels") + + /** Container name used by container runtime. + */ + val ContainerName: AttributeKey[String] = string("container.name") + + /** The container runtime managing this container. + */ + val ContainerRuntime: AttributeKey[String] = string("container.runtime") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DbExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DbExperimentalAttributes.scala new file mode 100644 index 000000000..86317ccfd --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DbExperimentalAttributes.scala @@ -0,0 +1,514 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object DbExperimentalAttributes { + + /** The consistency level of the query. Based on consistency values from CQL. + */ + val DbCassandraConsistencyLevel: AttributeKey[String] = string( + "db.cassandra.consistency_level" + ) + + /** The data center of the coordinating node for a query. + */ + val DbCassandraCoordinatorDc: AttributeKey[String] = string( + "db.cassandra.coordinator.dc" + ) + + /** The ID of the coordinating node for a query. + */ + val DbCassandraCoordinatorId: AttributeKey[String] = string( + "db.cassandra.coordinator.id" + ) + + /** Whether or not the query is idempotent. + */ + val DbCassandraIdempotence: AttributeKey[Boolean] = boolean( + "db.cassandra.idempotence" + ) + + /** The fetch size used for paging, i.e. how many rows will be returned at + * once. + */ + val DbCassandraPageSize: AttributeKey[Long] = long("db.cassandra.page_size") + + /** The number of times a query was speculatively executed. Not set or `0` if + * the query was not executed speculatively. + */ + val DbCassandraSpeculativeExecutionCount: AttributeKey[Long] = long( + "db.cassandra.speculative_execution_count" + ) + + /** The name of the primary Cassandra table that the operation is acting upon, + * including the keyspace name (if applicable). + * + * @note + * - This mirrors the db.sql.table attribute but references cassandra + * rather than sql. It is not recommended to attempt any client-side + * parsing of `db.statement` just to get this property, but it should be + * set if it is provided by the library being instrumented. If the + * operation is acting upon an anonymous table, or more than one table, + * this value MUST NOT be set. + */ + val DbCassandraTable: AttributeKey[String] = string("db.cassandra.table") + + /** The connection string used to connect to the database. It is recommended + * to remove embedded credentials. + */ + val DbConnectionString: AttributeKey[String] = string("db.connection_string") + + /** Unique Cosmos client instance id. + */ + val DbCosmosdbClientId: AttributeKey[String] = string("db.cosmosdb.client_id") + + /** Cosmos client connection mode. + */ + val DbCosmosdbConnectionMode: AttributeKey[String] = string( + "db.cosmosdb.connection_mode" + ) + + /** Cosmos DB container name. + */ + val DbCosmosdbContainer: AttributeKey[String] = string( + "db.cosmosdb.container" + ) + + /** CosmosDB Operation Type. + */ + val DbCosmosdbOperationType: AttributeKey[String] = string( + "db.cosmosdb.operation_type" + ) + + /** RU consumed for that operation + */ + val DbCosmosdbRequestCharge: AttributeKey[Double] = double( + "db.cosmosdb.request_charge" + ) + + /** Request payload size in bytes + */ + val DbCosmosdbRequestContentLength: AttributeKey[Long] = long( + "db.cosmosdb.request_content_length" + ) + + /** Cosmos DB status code. + */ + val DbCosmosdbStatusCode: AttributeKey[Long] = long("db.cosmosdb.status_code") + + /** Cosmos DB sub status code. + */ + val DbCosmosdbSubStatusCode: AttributeKey[Long] = long( + "db.cosmosdb.sub_status_code" + ) + + /** Represents the identifier of an Elasticsearch cluster. + */ + val DbElasticsearchClusterName: AttributeKey[String] = string( + "db.elasticsearch.cluster.name" + ) + + /** Represents the human-readable identifier of the node/instance to which a + * request was routed. + */ + val DbElasticsearchNodeName: AttributeKey[String] = string( + "db.elasticsearch.node.name" + ) + + /** A dynamic value in the url path. + * + * @note + * - Many Elasticsearch url paths allow dynamic values. These SHOULD be + * recorded in span attributes in the format + * `db.elasticsearch.path_parts.`, where `` is the url path + * part name. The implementation SHOULD reference the elasticsearch + * schema in order to map the path part values to their names. + */ + val DbElasticsearchPathParts: AttributeKey[String] = string( + "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 `select @@hostname`. + */ + val DbInstanceId: AttributeKey[String] = string("db.instance.id") + + /** The fully-qualified class name of the Java + * Database Connectivity (JDBC) driver used to connect. + */ + val DbJdbcDriverClassname: AttributeKey[String] = string( + "db.jdbc.driver_classname" + ) + + /** The MongoDB collection being accessed within the database stated in + * `db.name`. + */ + val DbMongodbCollection: AttributeKey[String] = string( + "db.mongodb.collection" + ) + + /** The Microsoft SQL Server instance + * name connecting to. This name is used to determine the port of a named + * instance. + * + * @note + * - If setting a `db.mssql.instance_name`, `server.port` is no longer + * required (but still recommended if non-standard). + */ + val DbMssqlInstanceName: AttributeKey[String] = string( + "db.mssql.instance_name" + ) + + /** This attribute is used to report the name of the database being accessed. + * For commands that switch the database, this should be set to the target + * database (even if the command fails). + * + * @note + * - In some SQL databases, the database name to be used is called + * "schema name". In case there are multiple layers that could + * be considered for database name (e.g. Oracle instance name and schema + * name), the database name to be used is the more specific layer (e.g. + * Oracle schema name). + */ + val DbName: AttributeKey[String] = string("db.name") + + /** The name of the operation being executed, e.g. the MongoDB + * command name such as `findAndModify`, or the SQL keyword. + * + * @note + * - When setting this to an SQL keyword, it is not recommended to attempt + * any client-side parsing of `db.statement` just to get this property, + * but it should be set if the operation name is provided by the library + * being instrumented. If the SQL statement has an ambiguous operation, + * or performs more than one operation, this value may be omitted. + */ + val DbOperation: AttributeKey[String] = string("db.operation") + + /** The index of the database being accessed as used in the `SELECT` command, provided as + * an integer. To be used instead of the generic `db.name` attribute. + */ + val DbRedisDatabaseIndex: AttributeKey[Long] = long("db.redis.database_index") + + /** The name of the primary table that the operation is acting upon, including + * the database name (if applicable). + * + * @note + * - It is not recommended to attempt any client-side parsing of + * `db.statement` just to get this property, but it should be set if it + * is provided by the library being instrumented. If the operation is + * acting upon an anonymous table, or more than one table, this value + * MUST NOT be set. + */ + val DbSqlTable: AttributeKey[String] = string("db.sql.table") + + /** The database statement being executed. + */ + val DbStatement: AttributeKey[String] = string("db.statement") + + /** An identifier for the database management system (DBMS) product being + * used. See below for a list of well-known identifiers. + */ + val DbSystem: AttributeKey[String] = string("db.system") + + /** Username for accessing the database. + */ + val DbUser: AttributeKey[String] = string("db.user") + // Enum definitions + + /** Values for [[DbCassandraConsistencyLevel]]. + */ + abstract class DbCassandraConsistencyLevelValue(val value: String) + object DbCassandraConsistencyLevelValue { + + /** all. */ + case object All extends DbCassandraConsistencyLevelValue("all") + + /** each_quorum. */ + case object EachQuorum + extends DbCassandraConsistencyLevelValue("each_quorum") + + /** quorum. */ + case object Quorum extends DbCassandraConsistencyLevelValue("quorum") + + /** local_quorum. */ + case object LocalQuorum + extends DbCassandraConsistencyLevelValue("local_quorum") + + /** one. */ + case object One extends DbCassandraConsistencyLevelValue("one") + + /** two. */ + case object Two extends DbCassandraConsistencyLevelValue("two") + + /** three. */ + case object Three extends DbCassandraConsistencyLevelValue("three") + + /** local_one. */ + case object LocalOne extends DbCassandraConsistencyLevelValue("local_one") + + /** any. */ + case object Any extends DbCassandraConsistencyLevelValue("any") + + /** serial. */ + case object Serial extends DbCassandraConsistencyLevelValue("serial") + + /** local_serial. */ + case object LocalSerial + extends DbCassandraConsistencyLevelValue("local_serial") + } + + /** Values for [[DbCosmosdbConnectionMode]]. + */ + abstract class DbCosmosdbConnectionModeValue(val value: String) + object DbCosmosdbConnectionModeValue { + + /** Gateway (HTTP) connections mode. */ + case object Gateway extends DbCosmosdbConnectionModeValue("gateway") + + /** Direct connection. */ + case object Direct extends DbCosmosdbConnectionModeValue("direct") + } + + /** Values for [[DbCosmosdbOperationType]]. + */ + abstract class DbCosmosdbOperationTypeValue(val value: String) + object DbCosmosdbOperationTypeValue { + + /** invalid. */ + case object Invalid extends DbCosmosdbOperationTypeValue("Invalid") + + /** create. */ + case object Create extends DbCosmosdbOperationTypeValue("Create") + + /** patch. */ + case object Patch extends DbCosmosdbOperationTypeValue("Patch") + + /** read. */ + case object Read extends DbCosmosdbOperationTypeValue("Read") + + /** read_feed. */ + case object ReadFeed extends DbCosmosdbOperationTypeValue("ReadFeed") + + /** delete. */ + case object Delete extends DbCosmosdbOperationTypeValue("Delete") + + /** replace. */ + case object Replace extends DbCosmosdbOperationTypeValue("Replace") + + /** execute. */ + case object Execute extends DbCosmosdbOperationTypeValue("Execute") + + /** query. */ + case object Query extends DbCosmosdbOperationTypeValue("Query") + + /** head. */ + case object Head extends DbCosmosdbOperationTypeValue("Head") + + /** head_feed. */ + case object HeadFeed extends DbCosmosdbOperationTypeValue("HeadFeed") + + /** upsert. */ + case object Upsert extends DbCosmosdbOperationTypeValue("Upsert") + + /** batch. */ + case object Batch extends DbCosmosdbOperationTypeValue("Batch") + + /** query_plan. */ + case object QueryPlan extends DbCosmosdbOperationTypeValue("QueryPlan") + + /** execute_javascript. */ + case object ExecuteJavascript + extends DbCosmosdbOperationTypeValue("ExecuteJavaScript") + } + + /** Values for [[DbSystem]]. + */ + abstract class DbSystemValue(val value: String) + object DbSystemValue { + + /** Some other SQL database. Fallback only. See notes. */ + case object OtherSql extends DbSystemValue("other_sql") + + /** Microsoft SQL Server. */ + case object Mssql extends DbSystemValue("mssql") + + /** Microsoft SQL Server Compact. */ + case object Mssqlcompact extends DbSystemValue("mssqlcompact") + + /** MySQL. */ + case object Mysql extends DbSystemValue("mysql") + + /** Oracle Database. */ + case object Oracle extends DbSystemValue("oracle") + + /** IBM Db2. */ + case object Db2 extends DbSystemValue("db2") + + /** PostgreSQL. */ + case object Postgresql extends DbSystemValue("postgresql") + + /** Amazon Redshift. */ + case object Redshift extends DbSystemValue("redshift") + + /** Apache Hive. */ + case object Hive extends DbSystemValue("hive") + + /** Cloudscape. */ + case object Cloudscape extends DbSystemValue("cloudscape") + + /** HyperSQL DataBase. */ + case object Hsqldb extends DbSystemValue("hsqldb") + + /** Progress Database. */ + case object Progress extends DbSystemValue("progress") + + /** SAP MaxDB. */ + case object Maxdb extends DbSystemValue("maxdb") + + /** SAP HANA. */ + case object Hanadb extends DbSystemValue("hanadb") + + /** Ingres. */ + case object Ingres extends DbSystemValue("ingres") + + /** FirstSQL. */ + case object Firstsql extends DbSystemValue("firstsql") + + /** EnterpriseDB. */ + case object Edb extends DbSystemValue("edb") + + /** InterSystems Caché. */ + case object Cache extends DbSystemValue("cache") + + /** Adabas (Adaptable Database System). */ + case object Adabas extends DbSystemValue("adabas") + + /** Firebird. */ + case object Firebird extends DbSystemValue("firebird") + + /** Apache Derby. */ + case object Derby extends DbSystemValue("derby") + + /** FileMaker. */ + case object Filemaker extends DbSystemValue("filemaker") + + /** Informix. */ + case object Informix extends DbSystemValue("informix") + + /** InstantDB. */ + case object Instantdb extends DbSystemValue("instantdb") + + /** InterBase. */ + case object Interbase extends DbSystemValue("interbase") + + /** MariaDB. */ + case object Mariadb extends DbSystemValue("mariadb") + + /** Netezza. */ + case object Netezza extends DbSystemValue("netezza") + + /** Pervasive PSQL. */ + case object Pervasive extends DbSystemValue("pervasive") + + /** PointBase. */ + case object Pointbase extends DbSystemValue("pointbase") + + /** SQLite. */ + case object Sqlite extends DbSystemValue("sqlite") + + /** Sybase. */ + case object Sybase extends DbSystemValue("sybase") + + /** Teradata. */ + case object Teradata extends DbSystemValue("teradata") + + /** Vertica. */ + case object Vertica extends DbSystemValue("vertica") + + /** H2. */ + case object H2 extends DbSystemValue("h2") + + /** ColdFusion IMQ. */ + case object Coldfusion extends DbSystemValue("coldfusion") + + /** Apache Cassandra. */ + case object Cassandra extends DbSystemValue("cassandra") + + /** Apache HBase. */ + case object Hbase extends DbSystemValue("hbase") + + /** MongoDB. */ + case object Mongodb extends DbSystemValue("mongodb") + + /** Redis. */ + case object Redis extends DbSystemValue("redis") + + /** Couchbase. */ + case object Couchbase extends DbSystemValue("couchbase") + + /** CouchDB. */ + case object Couchdb extends DbSystemValue("couchdb") + + /** Microsoft Azure Cosmos DB. */ + case object Cosmosdb extends DbSystemValue("cosmosdb") + + /** Amazon DynamoDB. */ + case object Dynamodb extends DbSystemValue("dynamodb") + + /** Neo4j. */ + case object Neo4j extends DbSystemValue("neo4j") + + /** Apache Geode. */ + case object Geode extends DbSystemValue("geode") + + /** Elasticsearch. */ + case object Elasticsearch extends DbSystemValue("elasticsearch") + + /** Memcached. */ + case object Memcached extends DbSystemValue("memcached") + + /** CockroachDB. */ + case object Cockroachdb extends DbSystemValue("cockroachdb") + + /** OpenSearch. */ + case object Opensearch extends DbSystemValue("opensearch") + + /** ClickHouse. */ + case object Clickhouse extends DbSystemValue("clickhouse") + + /** Cloud Spanner. */ + case object Spanner extends DbSystemValue("spanner") + + /** Trino. */ + case object Trino extends DbSystemValue("trino") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DeploymentExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DeploymentExperimentalAttributes.scala new file mode 100644 index 000000000..8f9576d10 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DeploymentExperimentalAttributes.scala @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object DeploymentExperimentalAttributes { + + /** Name of the deployment + * environment (aka deployment tier). + * + * @note + * - `deployment.environment` does not affect the uniqueness constraints + * defined through the `service.namespace`, `service.name` and + * `service.instance.id` resource attributes. This implies that resources + * carrying the following attribute combinations MUST be considered to be + * identifying the same service:
  • `service.name=frontend`, + * `deployment.environment=production`
  • `service.name=frontend`, + * `deployment.environment=staging`.
  • + */ + val DeploymentEnvironment: AttributeKey[String] = string( + "deployment.environment" + ) + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DestinationExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DestinationExperimentalAttributes.scala new file mode 100644 index 000000000..4b5483b1f --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DestinationExperimentalAttributes.scala @@ -0,0 +1,40 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object DestinationExperimentalAttributes { + + /** Destination address - domain name if available without reverse DNS lookup; + * otherwise, IP address or Unix domain socket name. + * + * @note + * - When observed from the source side, and when communicating through an + * intermediary, `destination.address` SHOULD represent the destination + * address behind any intermediaries, for example proxies, if it's + * available. + */ + val DestinationAddress: AttributeKey[String] = string("destination.address") + + /** Destination port number + */ + val DestinationPort: AttributeKey[Long] = long("destination.port") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DeviceExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DeviceExperimentalAttributes.scala new file mode 100644 index 000000000..7ff97c442 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DeviceExperimentalAttributes.scala @@ -0,0 +1,73 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object DeviceExperimentalAttributes { + + /** A unique identifier representing the device + * + * @note + * - The device identifier MUST only be defined using the values outlined + * below. This value is not an advertising identifier and MUST NOT be + * used as such. On iOS (Swift or Objective-C), this value MUST be equal + * to the vendor + * identifier. On Android (Java or Kotlin), this value MUST be equal + * to the Firebase Installation ID or a globally unique UUID which is + * persisted across sessions in your application. More information can be + * found here + * on best practices and exact implementation details. Caution should be + * taken when storing personal data or anything which can identify a + * user. GDPR and data protection laws may apply, ensure you do your own + * due diligence. + */ + val DeviceId: AttributeKey[String] = string("device.id") + + /** The name of the device manufacturer + * + * @note + * - The Android OS provides this field via Build. + * iOS apps SHOULD hardcode the value `Apple`. + */ + val DeviceManufacturer: AttributeKey[String] = string("device.manufacturer") + + /** The model identifier for the device + * + * @note + * - 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. + */ + val DeviceModelIdentifier: AttributeKey[String] = string( + "device.model.identifier" + ) + + /** The marketing name for the device model + * + * @note + * - It's recommended this value represents a human-readable version of the + * device model rather than a machine-readable alternative. + */ + val DeviceModelName: AttributeKey[String] = string("device.model.name") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DiskExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DiskExperimentalAttributes.scala new file mode 100644 index 000000000..de82a8dba --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DiskExperimentalAttributes.scala @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object DiskExperimentalAttributes { + + /** The disk IO operation direction. + */ + val DiskIoDirection: AttributeKey[String] = string("disk.io.direction") + // Enum definitions + + /** Values for [[DiskIoDirection]]. + */ + abstract class DiskIoDirectionValue(val value: String) + object DiskIoDirectionValue { + + /** read. */ + case object Read extends DiskIoDirectionValue("read") + + /** write. */ + case object Write extends DiskIoDirectionValue("write") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DnsExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DnsExperimentalAttributes.scala new file mode 100644 index 000000000..2a5211580 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/DnsExperimentalAttributes.scala @@ -0,0 +1,36 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object DnsExperimentalAttributes { + + /** The name being queried. + * + * @note + * - 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. + */ + val DnsQuestionName: AttributeKey[String] = string("dns.question.name") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/EnduserExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/EnduserExperimentalAttributes.scala new file mode 100644 index 000000000..66ece3d91 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/EnduserExperimentalAttributes.scala @@ -0,0 +1,46 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object EnduserExperimentalAttributes { + + /** Username or client_id extracted from the access token or Authorization + * header in the inbound request from outside the system. + */ + val EnduserId: AttributeKey[String] = string("enduser.id") + + /** Actual/assumed role the client is making the request under extracted from + * token or application security context. + */ + val EnduserRole: AttributeKey[String] = string("enduser.role") + + /** Scopes or granted authorities the client currently possesses extracted + * from token or application security context. The value would come from the + * scope associated with an OAuth 2.0 Access + * Token or an attribute value in a SAML + * 2.0 Assertion. + */ + val EnduserScope: AttributeKey[String] = string("enduser.scope") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ErrorExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ErrorExperimentalAttributes.scala new file mode 100644 index 000000000..3c89e491a --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ErrorExperimentalAttributes.scala @@ -0,0 +1,67 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ErrorExperimentalAttributes { + + /** Describes a class of error the operation ended with. + * + * @note + * - The `error.type` SHOULD be predictable and SHOULD have low + * cardinality. Instrumentations SHOULD document the list of errors they + * report. + * - The cardinality of `error.type` within one instrumentation library + * SHOULD be low. Telemetry consumers that aggregate data from multiple + * instrumentation libraries and applications should be prepared for + * `error.type` to have high cardinality at query time when no additional + * filters are applied. + * - If the operation has completed successfully, instrumentations SHOULD + * NOT set `error.type`. + * - If a specific domain defines its own set of error identifiers (such as + * HTTP or gRPC status codes), it's RECOMMENDED to:
  • Use a + * domain-specific attribute
  • Set `error.type` to capture all + * errors, regardless of whether they are defined within the + * domain-specific set or not.
  • + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.ErrorAttributes.ErrorType` instead.", + "0.5.0" + ) + val ErrorType: AttributeKey[String] = string("error.type") + // Enum definitions + + /** Values for [[ErrorType]]. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.ErrorAttributes.ErrorTypeValue` instead.", + "0.5.0" + ) + abstract class ErrorTypeValue(val value: String) + @annotation.nowarn("cat=deprecation") + object ErrorTypeValue { + + /** A fallback error value to be used when the instrumentation doesn't + * define a custom value. + */ + case object Other extends ErrorTypeValue("_OTHER") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/EventExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/EventExperimentalAttributes.scala new file mode 100644 index 000000000..a5bd06d7b --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/EventExperimentalAttributes.scala @@ -0,0 +1,36 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object EventExperimentalAttributes { + + /** Identifies the class / type of event. + * + * @note + * - Event names are subject to the same rules as attribute + * names. 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. + */ + val EventName: AttributeKey[String] = string("event.name") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ExceptionExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ExceptionExperimentalAttributes.scala new file mode 100644 index 000000000..6d55124b1 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ExceptionExperimentalAttributes.scala @@ -0,0 +1,64 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ExceptionExperimentalAttributes { + + /** SHOULD be set to true if the exception event is recorded at a point where + * it is known that the exception is escaping the scope of the span. + * + * @note + * - An exception is considered to have escaped (or left) the scope of a + * span, if that span is ended while the exception is still logically + * "in flight". This may be actually "in flight" in + * some languages (e.g. if the exception is passed to a Context manager's + * `__exit__` method in Python) but will usually be caught at the point + * of recording the exception in most languages. + * - 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 example for recording span + * exceptions. + * - It follows that an exception may still escape the scope of the span + * even if the `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. + */ + val ExceptionEscaped: AttributeKey[Boolean] = boolean("exception.escaped") + + /** The exception message. + */ + val ExceptionMessage: AttributeKey[String] = string("exception.message") + + /** 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. + */ + val ExceptionStacktrace: AttributeKey[String] = string("exception.stacktrace") + + /** The type of the exception (its fully-qualified class name, if applicable). + * The dynamic type of the exception should be preferred over the static type + * in languages that support it. + */ + val ExceptionType: AttributeKey[String] = string("exception.type") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/FaasExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/FaasExperimentalAttributes.scala new file mode 100644 index 000000000..ef0511a18 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/FaasExperimentalAttributes.scala @@ -0,0 +1,220 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object FaasExperimentalAttributes { + + /** A boolean that is true if the serverless function is executed for the + * first time (aka cold-start). + */ + val FaasColdstart: AttributeKey[Boolean] = boolean("faas.coldstart") + + /** A string containing the schedule period as Cron + * Expression. + */ + val FaasCron: AttributeKey[String] = string("faas.cron") + + /** The name of the source on which the triggering operation was performed. + * For example, in Cloud Storage or S3 corresponds to the bucket name, and in + * Cosmos DB to the database name. + */ + val FaasDocumentCollection: AttributeKey[String] = string( + "faas.document.collection" + ) + + /** The document name/table subjected to the operation. For example, in Cloud + * Storage or S3 is the name of the file, and in Cosmos DB the table name. + */ + val FaasDocumentName: AttributeKey[String] = string("faas.document.name") + + /** Describes the type of the operation that was performed on the data. + */ + val FaasDocumentOperation: AttributeKey[String] = string( + "faas.document.operation" + ) + + /** A string containing the time when the data was accessed in the ISO 8601 + * format expressed in UTC. + */ + val FaasDocumentTime: AttributeKey[String] = string("faas.document.time") + + /** The execution environment ID as a string, that will be potentially reused + * for other invocations to the same function/function version. + * + * @note + *
  • AWS Lambda: Use the (full) log stream name.
  • + */ + val FaasInstance: AttributeKey[String] = string("faas.instance") + + /** The invocation ID of the current function invocation. + */ + val FaasInvocationId: AttributeKey[String] = string("faas.invocation_id") + + /** The name of the invoked function. + * + * @note + * - SHOULD be equal to the `faas.name` resource attribute of the invoked + * function. + */ + val FaasInvokedName: AttributeKey[String] = string("faas.invoked_name") + + /** The cloud provider of the invoked function. + * + * @note + * - SHOULD be equal to the `cloud.provider` resource attribute of the + * invoked function. + */ + val FaasInvokedProvider: AttributeKey[String] = string( + "faas.invoked_provider" + ) + + /** The cloud region of the invoked function. + * + * @note + * - SHOULD be equal to the `cloud.region` resource attribute of the + * invoked function. + */ + val FaasInvokedRegion: AttributeKey[String] = string("faas.invoked_region") + + /** The amount of memory available to the serverless function converted to + * Bytes. + * + * @note + * - It's recommended to set this attribute since e.g. too little memory + * can easily stop a Java AWS Lambda function from working correctly. On + * AWS Lambda, the environment variable `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` + * provides this information (which must be multiplied by 1,048,576). + */ + val FaasMaxMemory: AttributeKey[Long] = long("faas.max_memory") + + /** The name of the single function that this runtime instance executes. + * + * @note + * - This is the name of the function as configured/deployed on the FaaS + * platform and is usually different from the name of the callback + * function (which may be stored in the `code.namespace`/`code.function` + * span attributes). + * - For some cloud providers, the above definition is ambiguous. The + * following definition of function name MUST be used for this attribute + * (and consequently the span name) for the listed cloud + * providers/products:
  • Azure: The full name + * `/`, i.e., function app name followed by a forward + * slash followed by the function name (this form can also be seen in the + * resource JSON for the function). This means that a span attribute MUST + * be used, as an Azure function app can host multiple functions that + * would usually share a TracerProvider (see also the `cloud.resource_id` + * attribute).
  • + */ + val FaasName: AttributeKey[String] = string("faas.name") + + /** A string containing the function invocation time in the ISO 8601 + * format expressed in UTC. + */ + val FaasTime: AttributeKey[String] = string("faas.time") + + /** Type of the trigger which caused this function invocation. + */ + val FaasTrigger: AttributeKey[String] = string("faas.trigger") + + /** The immutable version of the function being executed. + * + * @note + * - Depending on the cloud provider and platform, use:
  • AWS + * Lambda: The function + * version (an integer represented as a decimal string).
  • + *
  • Google Cloud Run (Services): The revision + * (i.e., the function name plus the revision suffix).
  • + *
  • Google Cloud Functions: The value of the `K_REVISION` + * environment variable.
  • Azure Functions: + * Not applicable. Do not set this attribute.
  • + */ + val FaasVersion: AttributeKey[String] = string("faas.version") + // Enum definitions + + /** Values for [[FaasDocumentOperation]]. + */ + abstract class FaasDocumentOperationValue(val value: String) + object FaasDocumentOperationValue { + + /** When a new object is created. */ + case object Insert extends FaasDocumentOperationValue("insert") + + /** When an object is modified. */ + case object Edit extends FaasDocumentOperationValue("edit") + + /** When an object is deleted. */ + case object Delete extends FaasDocumentOperationValue("delete") + } + + /** Values for [[FaasInvokedProvider]]. + */ + abstract class FaasInvokedProviderValue(val value: String) + object FaasInvokedProviderValue { + + /** Alibaba Cloud. */ + case object AlibabaCloud extends FaasInvokedProviderValue("alibaba_cloud") + + /** Amazon Web Services. */ + case object Aws extends FaasInvokedProviderValue("aws") + + /** Microsoft Azure. */ + case object Azure extends FaasInvokedProviderValue("azure") + + /** Google Cloud Platform. */ + case object Gcp extends FaasInvokedProviderValue("gcp") + + /** Tencent Cloud. */ + case object TencentCloud extends FaasInvokedProviderValue("tencent_cloud") + } + + /** Values for [[FaasTrigger]]. + */ + abstract class FaasTriggerValue(val value: String) + object FaasTriggerValue { + + /** A response to some data source operation such as a database or + * filesystem read/write. + */ + case object Datasource extends FaasTriggerValue("datasource") + + /** To provide an answer to an inbound HTTP request. */ + case object Http extends FaasTriggerValue("http") + + /** A function is set to be executed when messages are sent to a messaging + * system. + */ + case object Pubsub extends FaasTriggerValue("pubsub") + + /** A function is scheduled to be executed regularly. */ + case object Timer extends FaasTriggerValue("timer") + + /** If none of the others apply. */ + case object Other extends FaasTriggerValue("other") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/FeatureFlagExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/FeatureFlagExperimentalAttributes.scala new file mode 100644 index 000000000..9ac636a06 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/FeatureFlagExperimentalAttributes.scala @@ -0,0 +1,50 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object FeatureFlagExperimentalAttributes { + + /** The unique identifier of the feature flag. + */ + val FeatureFlagKey: AttributeKey[String] = string("feature_flag.key") + + /** The name of the service provider that performs the flag evaluation. + */ + val FeatureFlagProviderName: AttributeKey[String] = string( + "feature_flag.provider_name" + ) + + /** SHOULD be a semantic identifier for a value. If one is unavailable, a + * stringified version of the value can be used. + * + * @note + * - A semantic identifier, commonly referred to as a variant, provides a + * means for referring to a value without including the value itself. + * This can provide additional context for understanding the meaning + * behind a value. For example, the variant `red` maybe be used for the + * value `#c05543`. + * - A stringified version of the value can be used in situations where a + * semantic identifier is unavailable. String representation of the value + * should be determined by the implementer. + */ + val FeatureFlagVariant: AttributeKey[String] = string("feature_flag.variant") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/GcpExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/GcpExperimentalAttributes.scala new file mode 100644 index 000000000..dbee85ea0 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/GcpExperimentalAttributes.scala @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object GcpExperimentalAttributes { + + /** The name of the Cloud Run execution + * being run for the Job, as set by the `CLOUD_RUN_EXECUTION` + * environment variable. + */ + val GcpCloudRunJobExecution: AttributeKey[String] = string( + "gcp.cloud_run.job.execution" + ) + + /** The index for a task within an execution as provided by the `CLOUD_RUN_TASK_INDEX` + * environment variable. + */ + val GcpCloudRunJobTaskIndex: AttributeKey[Long] = long( + "gcp.cloud_run.job.task_index" + ) + + /** The hostname of a GCE instance. This is the full value of the default or + * custom + * hostname. + */ + val GcpGceInstanceHostname: AttributeKey[String] = string( + "gcp.gce.instance.hostname" + ) + + /** The instance name of a GCE instance. This is the value provided by + * `host.name`, the visible name of the instance in the Cloud Console UI, and + * the prefix for the default hostname of the instance as defined by the default + * internal DNS name. + */ + val GcpGceInstanceName: AttributeKey[String] = string("gcp.gce.instance.name") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/GraphqlExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/GraphqlExperimentalAttributes.scala new file mode 100644 index 000000000..d0e97ab1f --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/GraphqlExperimentalAttributes.scala @@ -0,0 +1,60 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object GraphqlExperimentalAttributes { + + /** The GraphQL document being executed. + * + * @note + * - The value may be sanitized to exclude sensitive information. + */ + val GraphqlDocument: AttributeKey[String] = string("graphql.document") + + /** The name of the operation being executed. + */ + val GraphqlOperationName: AttributeKey[String] = string( + "graphql.operation.name" + ) + + /** The type of the operation being executed. + */ + val GraphqlOperationType: AttributeKey[String] = string( + "graphql.operation.type" + ) + // Enum definitions + + /** Values for [[GraphqlOperationType]]. + */ + abstract class GraphqlOperationTypeValue(val value: String) + object GraphqlOperationTypeValue { + + /** GraphQL query. */ + case object Query extends GraphqlOperationTypeValue("query") + + /** GraphQL mutation. */ + case object Mutation extends GraphqlOperationTypeValue("mutation") + + /** GraphQL subscription. */ + case object Subscription extends GraphqlOperationTypeValue("subscription") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HerokuExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HerokuExperimentalAttributes.scala new file mode 100644 index 000000000..0046031ab --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HerokuExperimentalAttributes.scala @@ -0,0 +1,41 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object HerokuExperimentalAttributes { + + /** Unique identifier for the application + */ + val HerokuAppId: AttributeKey[String] = string("heroku.app.id") + + /** Commit hash for the current release + */ + val HerokuReleaseCommit: AttributeKey[String] = string( + "heroku.release.commit" + ) + + /** Time and date the release was created + */ + val HerokuReleaseCreationTimestamp: AttributeKey[String] = string( + "heroku.release.creation_timestamp" + ) + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HostExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HostExperimentalAttributes.scala new file mode 100644 index 000000000..383c099a7 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HostExperimentalAttributes.scala @@ -0,0 +1,141 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object HostExperimentalAttributes { + + /** The CPU architecture the host system is running on. + */ + val HostArch: AttributeKey[String] = string("host.arch") + + /** The amount of level 2 memory cache available to the processor (in Bytes). + */ + val HostCpuCacheL2Size: AttributeKey[Long] = long("host.cpu.cache.l2.size") + + /** Family or generation of the CPU. + */ + val HostCpuFamily: AttributeKey[String] = string("host.cpu.family") + + /** Model identifier. It provides more granular information about the CPU, + * distinguishing it from other CPUs within the same family. + */ + val HostCpuModelId: AttributeKey[String] = string("host.cpu.model.id") + + /** Model designation of the processor. + */ + val HostCpuModelName: AttributeKey[String] = string("host.cpu.model.name") + + /** Stepping or core revisions. + */ + val HostCpuStepping: AttributeKey[Long] = long("host.cpu.stepping") + + /** Processor manufacturer identifier. A maximum 12-character string. + * + * @note + * - CPUID command returns the + * vendor ID string in EBX, EDX and ECX registers. Writing these to + * memory in this order results in a 12-character string. + */ + val HostCpuVendorId: AttributeKey[String] = string("host.cpu.vendor.id") + + /** Unique host ID. For Cloud, this must be the instance_id assigned by the + * cloud provider. For non-containerized systems, this should be the + * `machine-id`. See the table below for the sources to use to determine the + * `machine-id` based on operating system. + */ + val HostId: AttributeKey[String] = string("host.id") + + /** VM image ID or host OS image ID. For Cloud, this value is from the + * provider. + */ + val HostImageId: AttributeKey[String] = string("host.image.id") + + /** Name of the VM image or OS install the host was instantiated from. + */ + val HostImageName: AttributeKey[String] = string("host.image.name") + + /** The version string of the VM image or host OS as defined in Version Attributes. + */ + val HostImageVersion: AttributeKey[String] = string("host.image.version") + + /** Available IP addresses of the host, excluding loopback interfaces. + * + * @note + * - IPv4 Addresses MUST be specified in dotted-quad notation. IPv6 + * addresses MUST be specified in the RFC 5952 + * format. + */ + val HostIp: AttributeKey[Seq[String]] = stringSeq("host.ip") + + /** Available MAC addresses of the host, excluding loopback interfaces. + * + * @note + * - MAC Addresses MUST be represented in IEEE + * RA hexadecimal form: as hyphen-separated octets in uppercase + * hexadecimal form from most to least significant. + */ + val HostMac: AttributeKey[Seq[String]] = stringSeq("host.mac") + + /** Name of the host. On Unix systems, it may contain what the hostname + * command returns, or the fully qualified hostname, or another name + * specified by the user. + */ + val HostName: AttributeKey[String] = string("host.name") + + /** Type of host. For Cloud, this must be the machine type. + */ + val HostType: AttributeKey[String] = string("host.type") + // Enum definitions + + /** Values for [[HostArch]]. + */ + abstract class HostArchValue(val value: String) + object HostArchValue { + + /** AMD64. */ + case object Amd64 extends HostArchValue("amd64") + + /** ARM32. */ + case object Arm32 extends HostArchValue("arm32") + + /** ARM64. */ + case object Arm64 extends HostArchValue("arm64") + + /** Itanium. */ + case object Ia64 extends HostArchValue("ia64") + + /** 32-bit PowerPC. */ + case object Ppc32 extends HostArchValue("ppc32") + + /** 64-bit PowerPC. */ + case object Ppc64 extends HostArchValue("ppc64") + + /** IBM z/Architecture. */ + case object S390x extends HostArchValue("s390x") + + /** 32-bit x86. */ + case object X86 extends HostArchValue("x86") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HttpExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HttpExperimentalAttributes.scala new file mode 100644 index 000000000..3c1f49fdc --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/HttpExperimentalAttributes.scala @@ -0,0 +1,309 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object HttpExperimentalAttributes { + + /** State of the HTTP connection in the HTTP connection pool. + */ + val HttpConnectionState: AttributeKey[String] = string( + "http.connection.state" + ) + + /** Deprecated, use `network.protocol.name` instead. + */ + @deprecated("Use `network.protocol.name` instead", "0.5.0") + val HttpFlavor: AttributeKey[String] = string("http.flavor") + + /** Deprecated, use `http.request.method` instead. + */ + @deprecated("Use `http.request.method` instead", "0.5.0") + val HttpMethod: AttributeKey[String] = string("http.method") + + /** The size of the request payload body in bytes. This is the number of bytes + * transferred excluding headers and is often, but not always, present as the + * Content-Length + * header. For requests using transport encoding, this should be the + * compressed size. + */ + val HttpRequestBodySize: AttributeKey[Long] = long("http.request.body.size") + + /** HTTP request headers, `` being the normalized HTTP Header name + * (lowercase), the value being the header values. + * + * @note + * - Instrumentations SHOULD require an explicit configuration of which + * headers are to be captured. Including all request headers can be a + * security risk - explicit configuration helps avoid leaking sensitive + * information. The `User-Agent` header is already captured in the + * `user_agent.original` attribute. Users MAY explicitly configure + * instrumentations to capture them even though it is not recommended. + * The attribute value MUST consist of either multiple header values as + * an array of strings or a single-item array containing a possibly + * comma-concatenated string, depending on the way the HTTP library + * provides access to headers. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.HttpAttributes.HttpRequestHeader` instead.", + "0.5.0" + ) + val HttpRequestHeader: AttributeKey[Seq[String]] = stringSeq( + "http.request.header" + ) + + /** HTTP request method. + * + * @note + * - HTTP request method value SHOULD be "known" to the + * instrumentation. By default, this convention defines "known" + * methods as the ones listed in RFC9110 + * and the PATCH method defined in RFC5789. + * - If the HTTP request method is not known to instrumentation, it MUST + * set the `http.request.method` attribute to `_OTHER`. + * - If the HTTP instrumentation could end up converting valid HTTP request + * methods to `_OTHER`, then it MUST provide a way to override the list + * of known HTTP methods. If this override is done via environment + * variable, then the environment variable MUST be named + * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated + * list of case-sensitive known HTTP methods (this list MUST be a full + * override of the default known method, it is not a list of known + * methods in addition to the defaults). + * - HTTP method names are case-sensitive and `http.request.method` + * attribute value MUST match a known HTTP method name exactly. + * Instrumentations for specific web frameworks that consider HTTP + * methods to be case insensitive, SHOULD populate a canonical + * equivalent. Tracing instrumentations that do so, MUST also set + * `http.request.method_original` to the original value. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.HttpAttributes.HttpRequestMethod` instead.", + "0.5.0" + ) + val HttpRequestMethod: AttributeKey[String] = string("http.request.method") + + /** Original HTTP method sent by the client in the request line. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.HttpAttributes.HttpRequestMethodOriginal` instead.", + "0.5.0" + ) + val HttpRequestMethodOriginal: AttributeKey[String] = string( + "http.request.method_original" + ) + + /** The ordinal number of request resending attempt (for any reason, including + * redirects). + * + * @note + * - The resend count SHOULD be updated each time an HTTP request gets + * resent by the client, regardless of what was the cause of the + * resending (e.g. redirection, authorization failure, 503 Server + * Unavailable, network issues, or any other). + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.HttpAttributes.HttpRequestResendCount` instead.", + "0.5.0" + ) + val HttpRequestResendCount: AttributeKey[Long] = long( + "http.request.resend_count" + ) + + /** Deprecated, use `http.request.header.content-length` instead. + */ + @deprecated("Use `http.request.header.content-length` instead", "0.5.0") + val HttpRequestContentLength: AttributeKey[Long] = long( + "http.request_content_length" + ) + + /** The size of the response payload body in bytes. This is the number of + * bytes transferred excluding headers and is often, but not always, present + * as the Content-Length + * header. For requests using transport encoding, this should be the + * compressed size. + */ + val HttpResponseBodySize: AttributeKey[Long] = long("http.response.body.size") + + /** HTTP response headers, `` being the normalized HTTP Header name + * (lowercase), the value being the header values. + * + * @note + * - Instrumentations SHOULD require an explicit configuration of which + * headers are to be captured. Including all response headers can be a + * security risk - explicit configuration helps avoid leaking sensitive + * information. Users MAY explicitly configure instrumentations to + * capture them even though it is not recommended. The attribute value + * MUST consist of either multiple header values as an array of strings + * or a single-item array containing a possibly comma-concatenated + * string, depending on the way the HTTP library provides access to + * headers. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.HttpAttributes.HttpResponseHeader` instead.", + "0.5.0" + ) + val HttpResponseHeader: AttributeKey[Seq[String]] = stringSeq( + "http.response.header" + ) + + /** HTTP response + * status code. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.HttpAttributes.HttpResponseStatusCode` instead.", + "0.5.0" + ) + val HttpResponseStatusCode: AttributeKey[Long] = long( + "http.response.status_code" + ) + + /** Deprecated, use `http.response.header.content-length` instead. + */ + @deprecated("Use `http.response.header.content-length` instead", "0.5.0") + val HttpResponseContentLength: AttributeKey[Long] = long( + "http.response_content_length" + ) + + /** The matched route, that is, the path template in the format used by the + * respective server framework. + * + * @note + * - MUST NOT be populated when this is not supported by the HTTP server + * framework as the route attribute should have low-cardinality and the + * URI path can NOT substitute it. SHOULD include the application + * root if there is one. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.HttpAttributes.HttpRoute` instead.", + "0.5.0" + ) + val HttpRoute: AttributeKey[String] = string("http.route") + + /** Deprecated, use `url.scheme` instead. + */ + @deprecated("Use `url.scheme` instead", "0.5.0") + val HttpScheme: AttributeKey[String] = string("http.scheme") + + /** Deprecated, use `http.response.status_code` instead. + */ + @deprecated("Use `http.response.status_code` instead", "0.5.0") + val HttpStatusCode: AttributeKey[Long] = long("http.status_code") + + /** Deprecated, use `url.path` and `url.query` instead. + */ + @deprecated("Use `url.path` and `url.query` instead", "0.5.0") + val HttpTarget: AttributeKey[String] = string("http.target") + + /** Deprecated, use `url.full` instead. + */ + @deprecated("Use `url.full` instead", "0.5.0") + val HttpUrl: AttributeKey[String] = string("http.url") + + /** Deprecated, use `user_agent.original` instead. + */ + @deprecated("Use `user_agent.original` instead", "0.5.0") + val HttpUserAgent: AttributeKey[String] = string("http.user_agent") + // Enum definitions + + /** Values for [[HttpConnectionState]]. + */ + abstract class HttpConnectionStateValue(val value: String) + object HttpConnectionStateValue { + + /** active state. */ + case object Active extends HttpConnectionStateValue("active") + + /** idle state. */ + case object Idle extends HttpConnectionStateValue("idle") + } + + /** Values for [[HttpFlavor]]. + */ + @deprecated("Use `network.protocol.name` instead", "0.5.0") + abstract class HttpFlavorValue(val value: String) + @annotation.nowarn("cat=deprecation") + object HttpFlavorValue { + + /** HTTP/1.0. */ + case object Http10 extends HttpFlavorValue("1.0") + + /** HTTP/1.1. */ + case object Http11 extends HttpFlavorValue("1.1") + + /** HTTP/2. */ + case object Http20 extends HttpFlavorValue("2.0") + + /** HTTP/3. */ + case object Http30 extends HttpFlavorValue("3.0") + + /** SPDY protocol. */ + case object Spdy extends HttpFlavorValue("SPDY") + + /** QUIC protocol. */ + case object Quic extends HttpFlavorValue("QUIC") + } + + /** Values for [[HttpRequestMethod]]. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.HttpAttributes.HttpRequestMethodValue` instead.", + "0.5.0" + ) + abstract class HttpRequestMethodValue(val value: String) + @annotation.nowarn("cat=deprecation") + object HttpRequestMethodValue { + + /** CONNECT method. */ + case object Connect extends HttpRequestMethodValue("CONNECT") + + /** DELETE method. */ + case object Delete extends HttpRequestMethodValue("DELETE") + + /** GET method. */ + case object Get extends HttpRequestMethodValue("GET") + + /** HEAD method. */ + case object Head extends HttpRequestMethodValue("HEAD") + + /** OPTIONS method. */ + case object Options extends HttpRequestMethodValue("OPTIONS") + + /** PATCH method. */ + case object Patch extends HttpRequestMethodValue("PATCH") + + /** POST method. */ + case object Post extends HttpRequestMethodValue("POST") + + /** PUT method. */ + case object Put extends HttpRequestMethodValue("PUT") + + /** TRACE method. */ + case object Trace extends HttpRequestMethodValue("TRACE") + + /** Any HTTP method that the instrumentation has no prior knowledge of. */ + case object Other extends HttpRequestMethodValue("_OTHER") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/JvmExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/JvmExperimentalAttributes.scala new file mode 100644 index 000000000..f58712bb9 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/JvmExperimentalAttributes.scala @@ -0,0 +1,144 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object JvmExperimentalAttributes { + + /** Name of the buffer pool. + * + * @note + * - Pool names are generally obtained via BufferPoolMXBean#getName(). + */ + val JvmBufferPoolName: AttributeKey[String] = string("jvm.buffer.pool.name") + + /** Name of the garbage collector action. + * + * @note + * - Garbage collector action is generally obtained via GarbageCollectionNotificationInfo#getGcAction(). + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.JvmAttributes.JvmGcAction` instead.", + "0.5.0" + ) + val JvmGcAction: AttributeKey[String] = string("jvm.gc.action") + + /** Name of the garbage collector. + * + * @note + * - Garbage collector name is generally obtained via GarbageCollectionNotificationInfo#getGcName(). + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.JvmAttributes.JvmGcName` instead.", + "0.5.0" + ) + val JvmGcName: AttributeKey[String] = string("jvm.gc.name") + + /** Name of the memory pool. + * + * @note + * - Pool names are generally obtained via MemoryPoolMXBean#getName(). + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.JvmAttributes.JvmMemoryPoolName` instead.", + "0.5.0" + ) + val JvmMemoryPoolName: AttributeKey[String] = string("jvm.memory.pool.name") + + /** The type of memory. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.JvmAttributes.JvmMemoryType` instead.", + "0.5.0" + ) + val JvmMemoryType: AttributeKey[String] = string("jvm.memory.type") + + /** Whether the thread is daemon or not. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.JvmAttributes.JvmThreadDaemon` instead.", + "0.5.0" + ) + val JvmThreadDaemon: AttributeKey[Boolean] = boolean("jvm.thread.daemon") + + /** State of the thread. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.JvmAttributes.JvmThreadState` instead.", + "0.5.0" + ) + val JvmThreadState: AttributeKey[String] = string("jvm.thread.state") + // Enum definitions + + /** Values for [[JvmMemoryType]]. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.JvmAttributes.JvmMemoryTypeValue` instead.", + "0.5.0" + ) + abstract class JvmMemoryTypeValue(val value: String) + @annotation.nowarn("cat=deprecation") + object JvmMemoryTypeValue { + + /** Heap memory. */ + case object Heap extends JvmMemoryTypeValue("heap") + + /** Non-heap memory. */ + case object NonHeap extends JvmMemoryTypeValue("non_heap") + } + + /** Values for [[JvmThreadState]]. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.JvmAttributes.JvmThreadStateValue` instead.", + "0.5.0" + ) + abstract class JvmThreadStateValue(val value: String) + @annotation.nowarn("cat=deprecation") + object JvmThreadStateValue { + + /** A thread that has not yet started is in this state. */ + case object New extends JvmThreadStateValue("new") + + /** A thread executing in the Java virtual machine is in this state. */ + case object Runnable extends JvmThreadStateValue("runnable") + + /** A thread that is blocked waiting for a monitor lock is in this state. */ + case object Blocked extends JvmThreadStateValue("blocked") + + /** A thread that is waiting indefinitely for another thread to perform a + * particular action is in this state. + */ + case object Waiting extends JvmThreadStateValue("waiting") + + /** A thread that is waiting for another thread to perform an action for up + * to a specified waiting time is in this state. + */ + case object TimedWaiting extends JvmThreadStateValue("timed_waiting") + + /** A thread that has exited is in this state. */ + case object Terminated extends JvmThreadStateValue("terminated") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/K8sExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/K8sExperimentalAttributes.scala new file mode 100644 index 000000000..5e40c3caa --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/K8sExperimentalAttributes.scala @@ -0,0 +1,150 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object K8sExperimentalAttributes { + + /** The name of the cluster. + */ + val K8sClusterName: AttributeKey[String] = string("k8s.cluster.name") + + /** A pseudo-ID for the cluster, set to the UID of the `kube-system` + * namespace. + * + * @note + * - K8s doesn't have support for obtaining a cluster ID. If this is ever + * added, we will recommend collecting the `k8s.cluster.uid` through the + * official APIs. In the meantime, we are able to use the `uid` of the + * `kube-system` namespace as a proxy for cluster ID. Read on for the + * rationale. + * - Every object created in a K8s cluster is assigned a distinct UID. The + * `kube-system` namespace is used by Kubernetes itself and will exist + * for the lifetime of the cluster. Using the `uid` of the `kube-system` + * namespace is a reasonable proxy for the K8s ClusterID as it will only + * change if the cluster is rebuilt. Furthermore, Kubernetes UIDs are + * UUIDs as standardized by ISO/IEC + * 9834-8 and ITU-T X.667. Which states:
    + * + * - If generated according to one of the mechanisms defined in + * Rec.
    + * + * - ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be + * different from all other UUIDs generated before 3603 A.D., or is extremely + * likely to be different (depending on the mechanism chosen). + * - Therefore, UIDs between clusters should be extremely unlikely to + * conflict. + */ + val K8sClusterUid: AttributeKey[String] = string("k8s.cluster.uid") + + /** The name of the Container from Pod specification, must be unique within a + * Pod. Container runtime usually uses different globally unique name + * (`container.name`). + */ + val K8sContainerName: AttributeKey[String] = string("k8s.container.name") + + /** Number of times the container was restarted. This attribute can be used to + * identify a particular container (running or stopped) within a container + * spec. + */ + val K8sContainerRestartCount: AttributeKey[Long] = long( + "k8s.container.restart_count" + ) + + /** The name of the CronJob. + */ + val K8sCronjobName: AttributeKey[String] = string("k8s.cronjob.name") + + /** The UID of the CronJob. + */ + val K8sCronjobUid: AttributeKey[String] = string("k8s.cronjob.uid") + + /** The name of the DaemonSet. + */ + val K8sDaemonsetName: AttributeKey[String] = string("k8s.daemonset.name") + + /** The UID of the DaemonSet. + */ + val K8sDaemonsetUid: AttributeKey[String] = string("k8s.daemonset.uid") + + /** The name of the Deployment. + */ + val K8sDeploymentName: AttributeKey[String] = string("k8s.deployment.name") + + /** The UID of the Deployment. + */ + val K8sDeploymentUid: AttributeKey[String] = string("k8s.deployment.uid") + + /** The name of the Job. + */ + val K8sJobName: AttributeKey[String] = string("k8s.job.name") + + /** The UID of the Job. + */ + val K8sJobUid: AttributeKey[String] = string("k8s.job.uid") + + /** The name of the namespace that the pod is running in. + */ + val K8sNamespaceName: AttributeKey[String] = string("k8s.namespace.name") + + /** The name of the Node. + */ + val K8sNodeName: AttributeKey[String] = string("k8s.node.name") + + /** The UID of the Node. + */ + val K8sNodeUid: AttributeKey[String] = string("k8s.node.uid") + + /** The annotation key-value pairs placed on the Pod, the `` being the + * annotation name, the value being the annotation value. + */ + val K8sPodAnnotation: AttributeKey[String] = string("k8s.pod.annotation") + + /** The labels placed on the Pod, the `` being the label name, the value + * being the label value. + */ + val K8sPodLabels: AttributeKey[String] = string("k8s.pod.labels") + + /** The name of the Pod. + */ + val K8sPodName: AttributeKey[String] = string("k8s.pod.name") + + /** The UID of the Pod. + */ + val K8sPodUid: AttributeKey[String] = string("k8s.pod.uid") + + /** The name of the ReplicaSet. + */ + val K8sReplicasetName: AttributeKey[String] = string("k8s.replicaset.name") + + /** The UID of the ReplicaSet. + */ + val K8sReplicasetUid: AttributeKey[String] = string("k8s.replicaset.uid") + + /** The name of the StatefulSet. + */ + val K8sStatefulsetName: AttributeKey[String] = string("k8s.statefulset.name") + + /** The UID of the StatefulSet. + */ + val K8sStatefulsetUid: AttributeKey[String] = string("k8s.statefulset.uid") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/LogExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/LogExperimentalAttributes.scala new file mode 100644 index 000000000..d0ca68a47 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/LogExperimentalAttributes.scala @@ -0,0 +1,75 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object LogExperimentalAttributes { + + /** The basename of the file. + */ + val LogFileName: AttributeKey[String] = string("log.file.name") + + /** The basename of the file, with symlinks resolved. + */ + val LogFileNameResolved: AttributeKey[String] = string( + "log.file.name_resolved" + ) + + /** The full path to the file. + */ + val LogFilePath: AttributeKey[String] = string("log.file.path") + + /** The full path to the file, with symlinks resolved. + */ + val LogFilePathResolved: AttributeKey[String] = string( + "log.file.path_resolved" + ) + + /** The stream associated with the log. See below for a list of well-known + * values. + */ + val LogIostream: AttributeKey[String] = string("log.iostream") + + /** A unique identifier for the Log Record. + * + * @note + * - If an id is provided, other log records with the same id will be + * considered duplicates and can be removed safely. This means, that two + * distinguishable log records MUST have different values. The id MAY be + * an Universally Unique + * Lexicographically Sortable Identifier (ULID), but other + * identifiers (e.g. UUID) may be used as needed. + */ + val LogRecordUid: AttributeKey[String] = string("log.record.uid") + // Enum definitions + + /** Values for [[LogIostream]]. + */ + abstract class LogIostreamValue(val value: String) + object LogIostreamValue { + + /** Logs from stdout stream. */ + case object Stdout extends LogIostreamValue("stdout") + + /** Events from stderr stream. */ + case object Stderr extends LogIostreamValue("stderr") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/MessageExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/MessageExperimentalAttributes.scala new file mode 100644 index 000000000..55ec416fe --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/MessageExperimentalAttributes.scala @@ -0,0 +1,63 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object MessageExperimentalAttributes { + + /** Compressed size of the message in bytes. + */ + val MessageCompressedSize: AttributeKey[Long] = long( + "message.compressed_size" + ) + + /** MUST be calculated as two different counters starting from `1` one for + * sent messages and one for received message. + * + * @note + * - This way we guarantee that the values will be consistent between + * different implementations. + */ + val MessageId: AttributeKey[Long] = long("message.id") + + /** Whether this is a received or sent message. + */ + val MessageType: AttributeKey[String] = string("message.type") + + /** Uncompressed size of the message in bytes. + */ + val MessageUncompressedSize: AttributeKey[Long] = long( + "message.uncompressed_size" + ) + // Enum definitions + + /** Values for [[MessageType]]. + */ + abstract class MessageTypeValue(val value: String) + object MessageTypeValue { + + /** sent. */ + case object Sent extends MessageTypeValue("SENT") + + /** received. */ + case object Received extends MessageTypeValue("RECEIVED") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/MessagingExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/MessagingExperimentalAttributes.scala new file mode 100644 index 000000000..6114ff386 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/MessagingExperimentalAttributes.scala @@ -0,0 +1,356 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object MessagingExperimentalAttributes { + + /** The number of messages sent, received, or processed in the scope of the + * batching operation. + * + * @note + * - Instrumentations SHOULD NOT set `messaging.batch.message_count` on + * spans that operate with a single message. When a messaging client + * library supports both batch and single-message API for the same + * operation, instrumentations SHOULD use `messaging.batch.message_count` + * for batching APIs and SHOULD NOT use it for single-message APIs. + */ + val MessagingBatchMessageCount: AttributeKey[Long] = long( + "messaging.batch.message_count" + ) + + /** A unique identifier for the client that consumes or produces a message. + */ + val MessagingClientId: AttributeKey[String] = string("messaging.client_id") + + /** A boolean that is true if the message destination is anonymous (could be + * unnamed or have auto-generated name). + */ + val MessagingDestinationAnonymous: AttributeKey[Boolean] = boolean( + "messaging.destination.anonymous" + ) + + /** The message destination name + * + * @note + * - Destination name SHOULD uniquely identify a specific queue, topic or + * other entity within the broker. If the broker doesn't have such + * notion, the destination name SHOULD uniquely identify the broker. + */ + val MessagingDestinationName: AttributeKey[String] = string( + "messaging.destination.name" + ) + + /** Low cardinality representation of the messaging destination name + * + * @note + * - Destination names could be constructed from templates. An example + * would be a destination name involving a user name or product id. + * Although the destination name in this case is of high cardinality, the + * underlying template is of low cardinality and can be effectively used + * for grouping and aggregation. + */ + val MessagingDestinationTemplate: AttributeKey[String] = string( + "messaging.destination.template" + ) + + /** A boolean that is true if the message destination is temporary and might + * not exist anymore after messages are processed. + */ + val MessagingDestinationTemporary: AttributeKey[Boolean] = boolean( + "messaging.destination.temporary" + ) + + /** A boolean that is true if the publish message destination is anonymous + * (could be unnamed or have auto-generated name). + */ + val MessagingDestinationPublishAnonymous: AttributeKey[Boolean] = boolean( + "messaging.destination_publish.anonymous" + ) + + /** The name of the original destination the message was published to + * + * @note + * - The name SHOULD uniquely identify a specific queue, topic, or other + * entity within the broker. If the broker doesn't have such notion, the + * original destination name SHOULD uniquely identify the broker. + */ + val MessagingDestinationPublishName: AttributeKey[String] = string( + "messaging.destination_publish.name" + ) + + /** The ordering key for a given message. If the attribute is not present, the + * message does not have an ordering key. + */ + val MessagingGcpPubsubMessageOrderingKey: AttributeKey[String] = string( + "messaging.gcp_pubsub.message.ordering_key" + ) + + /** Name of the Kafka Consumer Group that is handling the message. Only + * applies to consumers, not producers. + */ + val MessagingKafkaConsumerGroup: AttributeKey[String] = string( + "messaging.kafka.consumer.group" + ) + + /** Partition the message is sent to. + */ + val MessagingKafkaDestinationPartition: AttributeKey[Long] = long( + "messaging.kafka.destination.partition" + ) + + /** Message keys in Kafka are used for grouping alike messages to ensure + * they're processed on the same partition. They differ from + * `messaging.message.id` in that they're not unique. If the key is `null`, + * the attribute MUST NOT be set. + * + * @note + * - If the key type is not string, it's string representation has to be + * supplied for the attribute. If the key has no unambiguous, canonical + * string form, don't include its value. + */ + val MessagingKafkaMessageKey: AttributeKey[String] = string( + "messaging.kafka.message.key" + ) + + /** The offset of a record in the corresponding Kafka partition. + */ + val MessagingKafkaMessageOffset: AttributeKey[Long] = long( + "messaging.kafka.message.offset" + ) + + /** A boolean that is true if the message is a tombstone. + */ + val MessagingKafkaMessageTombstone: AttributeKey[Boolean] = boolean( + "messaging.kafka.message.tombstone" + ) + + /** The size of the message body in bytes. + * + * @note + * - This can refer to both the compressed or uncompressed body size. If + * both sizes are known, the uncompressed body size should be used. + */ + val MessagingMessageBodySize: AttributeKey[Long] = long( + "messaging.message.body.size" + ) + + /** The conversation ID identifying the conversation to which the message + * belongs, represented as a string. Sometimes called "Correlation + * ID". + */ + val MessagingMessageConversationId: AttributeKey[String] = string( + "messaging.message.conversation_id" + ) + + /** The size of the message body and metadata in bytes. + * + * @note + * - This can refer to both the compressed or uncompressed size. If both + * sizes are known, the uncompressed size should be used. + */ + val MessagingMessageEnvelopeSize: AttributeKey[Long] = long( + "messaging.message.envelope.size" + ) + + /** A value used by the messaging system as an identifier for the message, + * represented as a string. + */ + val MessagingMessageId: AttributeKey[String] = string("messaging.message.id") + + /** A string identifying the kind of messaging operation. + * + * @note + * - If a custom value is used, it MUST be of low cardinality. + */ + val MessagingOperation: AttributeKey[String] = string("messaging.operation") + + /** RabbitMQ message routing key. + */ + val MessagingRabbitmqDestinationRoutingKey: AttributeKey[String] = string( + "messaging.rabbitmq.destination.routing_key" + ) + + /** Name of the RocketMQ producer/consumer group that is handling the message. + * The client type is identified by the SpanKind. + */ + val MessagingRocketmqClientGroup: AttributeKey[String] = string( + "messaging.rocketmq.client_group" + ) + + /** Model of message consumption. This only applies to consumer spans. + */ + val MessagingRocketmqConsumptionModel: AttributeKey[String] = string( + "messaging.rocketmq.consumption_model" + ) + + /** The delay time level for delay message, which determines the message delay + * time. + */ + val MessagingRocketmqMessageDelayTimeLevel: AttributeKey[Long] = long( + "messaging.rocketmq.message.delay_time_level" + ) + + /** The timestamp in milliseconds that the delay message is expected to be + * delivered to consumer. + */ + val MessagingRocketmqMessageDeliveryTimestamp: AttributeKey[Long] = long( + "messaging.rocketmq.message.delivery_timestamp" + ) + + /** It is essential for FIFO message. Messages that belong to the same message + * group are always processed one by one within the same consumer group. + */ + val MessagingRocketmqMessageGroup: AttributeKey[String] = string( + "messaging.rocketmq.message.group" + ) + + /** Key(s) of message, another way to mark message besides message id. + */ + val MessagingRocketmqMessageKeys: AttributeKey[Seq[String]] = stringSeq( + "messaging.rocketmq.message.keys" + ) + + /** The secondary classifier of message besides topic. + */ + val MessagingRocketmqMessageTag: AttributeKey[String] = string( + "messaging.rocketmq.message.tag" + ) + + /** Type of message. + */ + val MessagingRocketmqMessageType: AttributeKey[String] = string( + "messaging.rocketmq.message.type" + ) + + /** Namespace of RocketMQ resources, resources in different namespaces are + * individual. + */ + val MessagingRocketmqNamespace: AttributeKey[String] = string( + "messaging.rocketmq.namespace" + ) + + /** An identifier for the messaging system being used. See below for a list of + * well-known identifiers. + */ + val MessagingSystem: AttributeKey[String] = string("messaging.system") + // Enum definitions + + /** Values for [[MessagingOperation]]. + */ + abstract class MessagingOperationValue(val value: String) + object MessagingOperationValue { + + /** One or more messages are provided for publishing to an intermediary. If + * a single message is published, the context of the "Publish" span + * can be used as the creation context and no "Create" span needs + * to be created. + */ + case object Publish extends MessagingOperationValue("publish") + + /** A message is created. "Create" spans always refer to a single + * message and are used to provide a unique creation context for messages + * in batch publishing scenarios. + */ + case object Create extends MessagingOperationValue("create") + + /** One or more messages are requested by a consumer. This operation refers + * to pull-based scenarios, where consumers explicitly call methods of + * messaging SDKs to receive messages. + */ + case object Receive extends MessagingOperationValue("receive") + + /** One or more messages are passed to a consumer. This operation refers to + * push-based scenarios, where consumer register callbacks which get called + * by messaging SDKs. + */ + case object Deliver extends MessagingOperationValue("deliver") + } + + /** Values for [[MessagingRocketmqConsumptionModel]]. + */ + abstract class MessagingRocketmqConsumptionModelValue(val value: String) + object MessagingRocketmqConsumptionModelValue { + + /** Clustering consumption model. */ + case object Clustering + extends MessagingRocketmqConsumptionModelValue("clustering") + + /** Broadcasting consumption model. */ + case object Broadcasting + extends MessagingRocketmqConsumptionModelValue("broadcasting") + } + + /** Values for [[MessagingRocketmqMessageType]]. + */ + abstract class MessagingRocketmqMessageTypeValue(val value: String) + object MessagingRocketmqMessageTypeValue { + + /** Normal message. */ + case object Normal extends MessagingRocketmqMessageTypeValue("normal") + + /** FIFO message. */ + case object Fifo extends MessagingRocketmqMessageTypeValue("fifo") + + /** Delay message. */ + case object Delay extends MessagingRocketmqMessageTypeValue("delay") + + /** Transaction message. */ + case object Transaction + extends MessagingRocketmqMessageTypeValue("transaction") + } + + /** Values for [[MessagingSystem]]. + */ + abstract class MessagingSystemValue(val value: String) + object MessagingSystemValue { + + /** Apache ActiveMQ. */ + case object Activemq extends MessagingSystemValue("activemq") + + /** Amazon Simple Queue Service (SQS). */ + case object AwsSqs extends MessagingSystemValue("aws_sqs") + + /** Azure Event Grid. */ + case object AzureEventgrid extends MessagingSystemValue("azure_eventgrid") + + /** Azure Event Hubs. */ + case object AzureEventhubs extends MessagingSystemValue("azure_eventhubs") + + /** Azure Service Bus. */ + case object AzureServicebus extends MessagingSystemValue("azure_servicebus") + + /** Google Cloud Pub/Sub. */ + case object GcpPubsub extends MessagingSystemValue("gcp_pubsub") + + /** Java Message Service. */ + case object Jms extends MessagingSystemValue("jms") + + /** Apache Kafka. */ + case object Kafka extends MessagingSystemValue("kafka") + + /** RabbitMQ. */ + case object Rabbitmq extends MessagingSystemValue("rabbitmq") + + /** Apache RocketMQ. */ + case object Rocketmq extends MessagingSystemValue("rocketmq") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/NetExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/NetExperimentalAttributes.scala new file mode 100644 index 000000000..68f450ce8 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/NetExperimentalAttributes.scala @@ -0,0 +1,139 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object NetExperimentalAttributes { + + /** Deprecated, use `server.address`. + */ + @deprecated("Use `server.address`", "0.5.0") + val NetHostName: AttributeKey[String] = string("net.host.name") + + /** Deprecated, use `server.port`. + */ + @deprecated("Use `server.port`", "0.5.0") + val NetHostPort: AttributeKey[Long] = long("net.host.port") + + /** Deprecated, use `server.address` on client spans and `client.address` on + * server spans. + */ + @deprecated( + "Use `server.address` on client spans and `client.address` on server spans", + "0.5.0" + ) + val NetPeerName: AttributeKey[String] = string("net.peer.name") + + /** Deprecated, use `server.port` on client spans and `client.port` on server + * spans. + */ + @deprecated( + "Use `server.port` on client spans and `client.port` on server spans", + "0.5.0" + ) + val NetPeerPort: AttributeKey[Long] = long("net.peer.port") + + /** Deprecated, use `network.protocol.name`. + */ + @deprecated("Use `network.protocol.name`", "0.5.0") + val NetProtocolName: AttributeKey[String] = string("net.protocol.name") + + /** Deprecated, use `network.protocol.version`. + */ + @deprecated("Use `network.protocol.version`", "0.5.0") + val NetProtocolVersion: AttributeKey[String] = string("net.protocol.version") + + /** Deprecated, use `network.transport` and `network.type`. + */ + @deprecated("Use `network.transport` and `network.type`", "0.5.0") + val NetSockFamily: AttributeKey[String] = string("net.sock.family") + + /** Deprecated, use `network.local.address`. + */ + @deprecated("Use `network.local.address`", "0.5.0") + val NetSockHostAddr: AttributeKey[String] = string("net.sock.host.addr") + + /** Deprecated, use `network.local.port`. + */ + @deprecated("Use `network.local.port`", "0.5.0") + val NetSockHostPort: AttributeKey[Long] = long("net.sock.host.port") + + /** Deprecated, use `network.peer.address`. + */ + @deprecated("Use `network.peer.address`", "0.5.0") + val NetSockPeerAddr: AttributeKey[String] = string("net.sock.peer.addr") + + /** Deprecated, no replacement at this time. + */ + @deprecated("No replacement at this time", "0.5.0") + val NetSockPeerName: AttributeKey[String] = string("net.sock.peer.name") + + /** Deprecated, use `network.peer.port`. + */ + @deprecated("Use `network.peer.port`", "0.5.0") + val NetSockPeerPort: AttributeKey[Long] = long("net.sock.peer.port") + + /** Deprecated, use `network.transport`. + */ + @deprecated("Use `network.transport`", "0.5.0") + val NetTransport: AttributeKey[String] = string("net.transport") + // Enum definitions + + /** Values for [[NetSockFamily]]. + */ + @deprecated("Use `network.transport` and `network.type`", "0.5.0") + abstract class NetSockFamilyValue(val value: String) + @annotation.nowarn("cat=deprecation") + object NetSockFamilyValue { + + /** IPv4 address. */ + case object Inet extends NetSockFamilyValue("inet") + + /** IPv6 address. */ + case object Inet6 extends NetSockFamilyValue("inet6") + + /** Unix domain socket path. */ + case object Unix extends NetSockFamilyValue("unix") + } + + /** Values for [[NetTransport]]. + */ + @deprecated("Use `network.transport`", "0.5.0") + abstract class NetTransportValue(val value: String) + @annotation.nowarn("cat=deprecation") + object NetTransportValue { + + /** ip_tcp. */ + case object IpTcp extends NetTransportValue("ip_tcp") + + /** ip_udp. */ + case object IpUdp extends NetTransportValue("ip_udp") + + /** Named or anonymous pipe. */ + case object Pipe extends NetTransportValue("pipe") + + /** In-process communication. */ + case object Inproc extends NetTransportValue("inproc") + + /** Something else (non IP-based). */ + case object Other extends NetTransportValue("other") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/NetworkExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/NetworkExperimentalAttributes.scala new file mode 100644 index 000000000..9559a69c9 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/NetworkExperimentalAttributes.scala @@ -0,0 +1,300 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object NetworkExperimentalAttributes { + + /** The ISO 3166-1 alpha-2 2-character country code associated with the mobile + * carrier network. + */ + val NetworkCarrierIcc: AttributeKey[String] = string("network.carrier.icc") + + /** The mobile carrier country code. + */ + val NetworkCarrierMcc: AttributeKey[String] = string("network.carrier.mcc") + + /** The mobile carrier network code. + */ + val NetworkCarrierMnc: AttributeKey[String] = string("network.carrier.mnc") + + /** The name of the mobile carrier. + */ + val NetworkCarrierName: AttributeKey[String] = string("network.carrier.name") + + /** This describes more details regarding the connection.type. It may be the + * type of cell technology connection, but it could be used for describing + * details about a wifi connection. + */ + val NetworkConnectionSubtype: AttributeKey[String] = string( + "network.connection.subtype" + ) + + /** The internet connection type. + */ + val NetworkConnectionType: AttributeKey[String] = string( + "network.connection.type" + ) + + /** The network IO operation direction. + */ + val NetworkIoDirection: AttributeKey[String] = string("network.io.direction") + + /** Local address of the network connection - IP address or Unix domain socket + * name. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.NetworkAttributes.NetworkLocalAddress` instead.", + "0.5.0" + ) + val NetworkLocalAddress: AttributeKey[String] = string( + "network.local.address" + ) + + /** Local port number of the network connection. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.NetworkAttributes.NetworkLocalPort` instead.", + "0.5.0" + ) + val NetworkLocalPort: AttributeKey[Long] = long("network.local.port") + + /** Peer address of the network connection - IP address or Unix domain socket + * name. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.NetworkAttributes.NetworkPeerAddress` instead.", + "0.5.0" + ) + val NetworkPeerAddress: AttributeKey[String] = string("network.peer.address") + + /** Peer port number of the network connection. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.NetworkAttributes.NetworkPeerPort` instead.", + "0.5.0" + ) + val NetworkPeerPort: AttributeKey[Long] = long("network.peer.port") + + /** OSI application + * layer or non-OSI equivalent. + * + * @note + * - The value SHOULD be normalized to lowercase. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.NetworkAttributes.NetworkProtocolName` instead.", + "0.5.0" + ) + val NetworkProtocolName: AttributeKey[String] = string( + "network.protocol.name" + ) + + /** Version of the protocol specified in `network.protocol.name`. + * + * @note + * - `network.protocol.version` refers to the version of the protocol used + * and might be different from the protocol client's version. If the HTTP + * client has a version of `0.27.2`, but sends HTTP version `1.1`, this + * attribute should be set to `1.1`. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.NetworkAttributes.NetworkProtocolVersion` instead.", + "0.5.0" + ) + val NetworkProtocolVersion: AttributeKey[String] = string( + "network.protocol.version" + ) + + /** OSI transport layer + * or inter-process + * communication method. + * + * @note + * - The value SHOULD be normalized to lowercase. + * - Consider always setting the transport when setting a port number, + * since a port number is ambiguous without knowing the transport. For + * example different processes could be listening on TCP port 12345 and + * UDP port 12345. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.NetworkAttributes.NetworkTransport` instead.", + "0.5.0" + ) + val NetworkTransport: AttributeKey[String] = string("network.transport") + + /** OSI network layer or + * non-OSI equivalent. + * + * @note + * - The value SHOULD be normalized to lowercase. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.NetworkAttributes.NetworkType` instead.", + "0.5.0" + ) + val NetworkType: AttributeKey[String] = string("network.type") + // Enum definitions + + /** Values for [[NetworkConnectionSubtype]]. + */ + abstract class NetworkConnectionSubtypeValue(val value: String) + object NetworkConnectionSubtypeValue { + + /** GPRS. */ + case object Gprs extends NetworkConnectionSubtypeValue("gprs") + + /** EDGE. */ + case object Edge extends NetworkConnectionSubtypeValue("edge") + + /** UMTS. */ + case object Umts extends NetworkConnectionSubtypeValue("umts") + + /** CDMA. */ + case object Cdma extends NetworkConnectionSubtypeValue("cdma") + + /** EVDO Rel. 0. */ + case object Evdo0 extends NetworkConnectionSubtypeValue("evdo_0") + + /** EVDO Rev. A. */ + case object EvdoA extends NetworkConnectionSubtypeValue("evdo_a") + + /** CDMA2000 1XRTT. */ + case object Cdma20001xrtt + extends NetworkConnectionSubtypeValue("cdma2000_1xrtt") + + /** HSDPA. */ + case object Hsdpa extends NetworkConnectionSubtypeValue("hsdpa") + + /** HSUPA. */ + case object Hsupa extends NetworkConnectionSubtypeValue("hsupa") + + /** HSPA. */ + case object Hspa extends NetworkConnectionSubtypeValue("hspa") + + /** IDEN. */ + case object Iden extends NetworkConnectionSubtypeValue("iden") + + /** EVDO Rev. B. */ + case object EvdoB extends NetworkConnectionSubtypeValue("evdo_b") + + /** LTE. */ + case object Lte extends NetworkConnectionSubtypeValue("lte") + + /** EHRPD. */ + case object Ehrpd extends NetworkConnectionSubtypeValue("ehrpd") + + /** HSPAP. */ + case object Hspap extends NetworkConnectionSubtypeValue("hspap") + + /** GSM. */ + case object Gsm extends NetworkConnectionSubtypeValue("gsm") + + /** TD-SCDMA. */ + case object TdScdma extends NetworkConnectionSubtypeValue("td_scdma") + + /** IWLAN. */ + case object Iwlan extends NetworkConnectionSubtypeValue("iwlan") + + /** 5G NR (New Radio). */ + case object Nr extends NetworkConnectionSubtypeValue("nr") + + /** 5G NRNSA (New Radio Non-Standalone). */ + case object Nrnsa extends NetworkConnectionSubtypeValue("nrnsa") + + /** LTE CA. */ + case object LteCa extends NetworkConnectionSubtypeValue("lte_ca") + } + + /** Values for [[NetworkConnectionType]]. + */ + abstract class NetworkConnectionTypeValue(val value: String) + object NetworkConnectionTypeValue { + + /** wifi. */ + case object Wifi extends NetworkConnectionTypeValue("wifi") + + /** wired. */ + case object Wired extends NetworkConnectionTypeValue("wired") + + /** cell. */ + case object Cell extends NetworkConnectionTypeValue("cell") + + /** unavailable. */ + case object Unavailable extends NetworkConnectionTypeValue("unavailable") + + /** unknown. */ + case object Unknown extends NetworkConnectionTypeValue("unknown") + } + + /** Values for [[NetworkIoDirection]]. + */ + abstract class NetworkIoDirectionValue(val value: String) + object NetworkIoDirectionValue { + + /** transmit. */ + case object Transmit extends NetworkIoDirectionValue("transmit") + + /** receive. */ + case object Receive extends NetworkIoDirectionValue("receive") + } + + /** Values for [[NetworkTransport]]. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.NetworkAttributes.NetworkTransportValue` instead.", + "0.5.0" + ) + abstract class NetworkTransportValue(val value: String) + @annotation.nowarn("cat=deprecation") + object NetworkTransportValue { + + /** TCP. */ + case object Tcp extends NetworkTransportValue("tcp") + + /** UDP. */ + case object Udp extends NetworkTransportValue("udp") + + /** Named or anonymous pipe. */ + case object Pipe extends NetworkTransportValue("pipe") + + /** Unix domain socket. */ + case object Unix extends NetworkTransportValue("unix") + } + + /** Values for [[NetworkType]]. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.NetworkAttributes.NetworkTypeValue` instead.", + "0.5.0" + ) + abstract class NetworkTypeValue(val value: String) + @annotation.nowarn("cat=deprecation") + object NetworkTypeValue { + + /** IPv4. */ + case object Ipv4 extends NetworkTypeValue("ipv4") + + /** IPv6. */ + case object Ipv6 extends NetworkTypeValue("ipv6") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OciExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OciExperimentalAttributes.scala new file mode 100644 index 000000000..63f9634d0 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OciExperimentalAttributes.scala @@ -0,0 +1,39 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object OciExperimentalAttributes { + + /** The digest of the OCI image manifest. For container images specifically is + * the digest by which the container image is known. + * + * @note + * - Follows OCI + * Image Manifest Specification, and specifically the Digest + * property. An example can be found in Example + * Image Manifest. + */ + val OciManifestDigest: AttributeKey[String] = string("oci.manifest.digest") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OpentracingExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OpentracingExperimentalAttributes.scala new file mode 100644 index 000000000..a17823770 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OpentracingExperimentalAttributes.scala @@ -0,0 +1,47 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object OpentracingExperimentalAttributes { + + /** Parent-child Reference type + * + * @note + * - The causal relationship between a child Span and a parent Span. + */ + val OpentracingRefType: AttributeKey[String] = string("opentracing.ref_type") + // Enum definitions + + /** Values for [[OpentracingRefType]]. + */ + abstract class OpentracingRefTypeValue(val value: String) + object OpentracingRefTypeValue { + + /** The parent Span depends on the child Span in some capacity. */ + case object ChildOf extends OpentracingRefTypeValue("child_of") + + /** The parent Span doesn't depend in any way on the result of the child + * Span. + */ + case object FollowsFrom extends OpentracingRefTypeValue("follows_from") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OsExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OsExperimentalAttributes.scala new file mode 100644 index 000000000..a1cb9155a --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OsExperimentalAttributes.scala @@ -0,0 +1,88 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object OsExperimentalAttributes { + + /** Unique identifier for a particular build or compilation of the operating + * system. + */ + val OsBuildId: AttributeKey[String] = string("os.build_id") + + /** Human readable (not intended to be parsed) OS version information, like + * e.g. reported by `ver` or `lsb_release -a` commands. + */ + val OsDescription: AttributeKey[String] = string("os.description") + + /** Human readable operating system name. + */ + val OsName: AttributeKey[String] = string("os.name") + + /** The operating system type. + */ + val OsType: AttributeKey[String] = string("os.type") + + /** The version string of the operating system as defined in Version Attributes. + */ + val OsVersion: AttributeKey[String] = string("os.version") + // Enum definitions + + /** Values for [[OsType]]. + */ + abstract class OsTypeValue(val value: String) + object OsTypeValue { + + /** Microsoft Windows. */ + case object Windows extends OsTypeValue("windows") + + /** Linux. */ + case object Linux extends OsTypeValue("linux") + + /** Apple Darwin. */ + case object Darwin extends OsTypeValue("darwin") + + /** FreeBSD. */ + case object Freebsd extends OsTypeValue("freebsd") + + /** NetBSD. */ + case object Netbsd extends OsTypeValue("netbsd") + + /** OpenBSD. */ + case object Openbsd extends OsTypeValue("openbsd") + + /** DragonFly BSD. */ + case object Dragonflybsd extends OsTypeValue("dragonflybsd") + + /** HP-UX (Hewlett Packard Unix). */ + case object Hpux extends OsTypeValue("hpux") + + /** AIX (Advanced Interactive eXecutive). */ + case object Aix extends OsTypeValue("aix") + + /** SunOS, Oracle Solaris. */ + case object Solaris extends OsTypeValue("solaris") + + /** IBM z/OS. */ + case object ZOs extends OsTypeValue("z_os") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OtelExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OtelExperimentalAttributes.scala new file mode 100644 index 000000000..f6fdb1675 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OtelExperimentalAttributes.scala @@ -0,0 +1,69 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object OtelExperimentalAttributes { + + /** Deprecated, use the `otel.scope.name` attribute. + */ + val OtelLibraryName: AttributeKey[String] = string("otel.library.name") + + /** Deprecated, use the `otel.scope.version` attribute. + */ + val OtelLibraryVersion: AttributeKey[String] = string("otel.library.version") + + /** The name of the instrumentation scope - (`InstrumentationScope.Name` in + * OTLP). + */ + val OtelScopeName: AttributeKey[String] = string("otel.scope.name") + + /** The version of the instrumentation scope - (`InstrumentationScope.Version` + * in OTLP). + */ + val OtelScopeVersion: AttributeKey[String] = string("otel.scope.version") + + /** Name of the code, either "OK" or "ERROR". MUST NOT be + * set if the status code is UNSET. + */ + val OtelStatusCode: AttributeKey[String] = string("otel.status_code") + + /** Description of the Status if it has a value, otherwise not set. + */ + val OtelStatusDescription: AttributeKey[String] = string( + "otel.status_description" + ) + // Enum definitions + + /** Values for [[OtelStatusCode]]. + */ + abstract class OtelStatusCodeValue(val value: String) + object OtelStatusCodeValue { + + /** The operation has been validated by an Application developer or Operator + * to have completed successfully. + */ + case object Ok extends OtelStatusCodeValue("OK") + + /** The operation contains an error. */ + case object Error extends OtelStatusCodeValue("ERROR") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OtherExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OtherExperimentalAttributes.scala new file mode 100644 index 000000000..c37f979f4 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/OtherExperimentalAttributes.scala @@ -0,0 +1,42 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object OtherExperimentalAttributes { + + /** The state of a connection in the pool + */ + val State: AttributeKey[String] = string("state") + // Enum definitions + + /** Values for [[State]]. + */ + abstract class StateValue(val value: String) + object StateValue { + + /** idle. */ + case object Idle extends StateValue("idle") + + /** used. */ + case object Used extends StateValue("used") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/PeerExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/PeerExperimentalAttributes.scala new file mode 100644 index 000000000..7cb3fbd55 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/PeerExperimentalAttributes.scala @@ -0,0 +1,31 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object PeerExperimentalAttributes { + + /** The `service.name` of the + * remote service. SHOULD be equal to the actual `service.name` resource + * attribute of the remote service if any. + */ + val PeerService: AttributeKey[String] = string("peer.service") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/PoolExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/PoolExperimentalAttributes.scala new file mode 100644 index 000000000..76683eb48 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/PoolExperimentalAttributes.scala @@ -0,0 +1,33 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object PoolExperimentalAttributes { + + /** The name of the connection pool; unique within the instrumented + * application. In case the connection pool implementation doesn't provide a + * name, then the db.connection_string + * should be used + */ + val PoolName: AttributeKey[String] = string("pool.name") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ProcessExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ProcessExperimentalAttributes.scala new file mode 100644 index 000000000..ac450edc6 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ProcessExperimentalAttributes.scala @@ -0,0 +1,96 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ProcessExperimentalAttributes { + + /** The command used to launch the process (i.e. the command name). On Linux + * based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On + * Windows, can be set to the first parameter extracted from + * `GetCommandLineW`. + */ + val ProcessCommand: AttributeKey[String] = string("process.command") + + /** All the command arguments (including the command/executable itself) as + * received by the process. On Linux-based systems (and some other Unixoid + * systems supporting procfs), can be set according to the list of + * null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based + * executables, this would be the full argv vector passed to `main`. + */ + val ProcessCommandArgs: AttributeKey[Seq[String]] = stringSeq( + "process.command_args" + ) + + /** The full command used to launch the process as a single string + * representing the full command. On Windows, can be set to the result of + * `GetCommandLineW`. Do not set this if you have to assemble it just for + * monitoring; use `process.command_args` instead. + */ + val ProcessCommandLine: AttributeKey[String] = string("process.command_line") + + /** The name of the process executable. On Linux based systems, can be set to + * the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name + * of `GetProcessImageFileNameW`. + */ + val ProcessExecutableName: AttributeKey[String] = string( + "process.executable.name" + ) + + /** The full path to the process executable. On Linux based systems, can be + * set to the target of `proc/[pid]/exe`. On Windows, can be set to the + * result of `GetProcessImageFileNameW`. + */ + val ProcessExecutablePath: AttributeKey[String] = string( + "process.executable.path" + ) + + /** The username of the user that owns the process. + */ + val ProcessOwner: AttributeKey[String] = string("process.owner") + + /** Parent Process identifier (PPID). + */ + val ProcessParentPid: AttributeKey[Long] = long("process.parent_pid") + + /** Process identifier (PID). + */ + val ProcessPid: AttributeKey[Long] = long("process.pid") + + /** An additional description about the runtime of the process, for example a + * specific vendor customization of the runtime environment. + */ + val ProcessRuntimeDescription: AttributeKey[String] = string( + "process.runtime.description" + ) + + /** The name of the runtime of this process. For compiled native binaries, + * this SHOULD be the name of the compiler. + */ + val ProcessRuntimeName: AttributeKey[String] = string("process.runtime.name") + + /** The version of the runtime of this process, as returned by the runtime + * without modification. + */ + val ProcessRuntimeVersion: AttributeKey[String] = string( + "process.runtime.version" + ) + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/RpcExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/RpcExperimentalAttributes.scala new file mode 100644 index 000000000..4e85b3709 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/RpcExperimentalAttributes.scala @@ -0,0 +1,285 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object RpcExperimentalAttributes { + + /** The error + * codes of the Connect request. Error codes are always string values. + */ + val RpcConnectRpcErrorCode: AttributeKey[String] = string( + "rpc.connect_rpc.error_code" + ) + + /** Connect request metadata, `` being the normalized Connect Metadata + * key (lowercase), the value being the metadata values. + * + * @note + * - Instrumentations SHOULD require an explicit configuration of which + * metadata values are to be captured. Including all request metadata + * values can be a security risk - explicit configuration helps avoid + * leaking sensitive information. + */ + val RpcConnectRpcRequestMetadata: AttributeKey[Seq[String]] = stringSeq( + "rpc.connect_rpc.request.metadata" + ) + + /** Connect response metadata, `` being the normalized Connect Metadata + * key (lowercase), the value being the metadata values. + * + * @note + * - Instrumentations SHOULD require an explicit configuration of which + * metadata values are to be captured. Including all response metadata + * values can be a security risk - explicit configuration helps avoid + * leaking sensitive information. + */ + val RpcConnectRpcResponseMetadata: AttributeKey[Seq[String]] = stringSeq( + "rpc.connect_rpc.response.metadata" + ) + + /** gRPC request metadata, `` being the normalized gRPC Metadata key + * (lowercase), the value being the metadata values. + * + * @note + * - Instrumentations SHOULD require an explicit configuration of which + * metadata values are to be captured. Including all request metadata + * values can be a security risk - explicit configuration helps avoid + * leaking sensitive information. + */ + val RpcGrpcRequestMetadata: AttributeKey[Seq[String]] = stringSeq( + "rpc.grpc.request.metadata" + ) + + /** gRPC response metadata, `` being the normalized gRPC Metadata key + * (lowercase), the value being the metadata values. + * + * @note + * - Instrumentations SHOULD require an explicit configuration of which + * metadata values are to be captured. Including all response metadata + * values can be a security risk - explicit configuration helps avoid + * leaking sensitive information. + */ + val RpcGrpcResponseMetadata: AttributeKey[Seq[String]] = stringSeq( + "rpc.grpc.response.metadata" + ) + + /** The numeric + * status code of the gRPC request. + */ + val RpcGrpcStatusCode: AttributeKey[Long] = long("rpc.grpc.status_code") + + /** `error.code` property of response if it is an error response. + */ + val RpcJsonrpcErrorCode: AttributeKey[Long] = long("rpc.jsonrpc.error_code") + + /** `error.message` property of response if it is an error response. + */ + val RpcJsonrpcErrorMessage: AttributeKey[String] = string( + "rpc.jsonrpc.error_message" + ) + + /** `id` property of request or response. Since protocol allows id to be int, + * string, `null` or missing (for notifications), value is expected to be + * cast to string for simplicity. Use empty string in case of `null` value. + * Omit entirely if this is a notification. + */ + val RpcJsonrpcRequestId: AttributeKey[String] = string( + "rpc.jsonrpc.request_id" + ) + + /** Protocol version as in `jsonrpc` property of request/response. Since + * JSON-RPC 1.0 doesn't specify this, the value can be omitted. + */ + val RpcJsonrpcVersion: AttributeKey[String] = string("rpc.jsonrpc.version") + + /** The name of the (logical) method being called, must be equal to the method + * part in the span name. + * + * @note + * - This is the logical name of the method from the RPC interface + * perspective, which can be different from the name of any implementing + * method/function. The `code.function` attribute may be used to store + * the latter (e.g., method actually executing the call on the server + * side, RPC client stub method on the client side). + */ + val RpcMethod: AttributeKey[String] = string("rpc.method") + + /** The full (logical) name of the service being called, including its package + * name, if applicable. + * + * @note + * - This is the logical name of the service from the RPC interface + * perspective, which can be different from the name of any implementing + * class. The `code.namespace` attribute may be used to store the latter + * (despite the attribute name, it may include a class name; e.g., class + * with method actually executing the call on the server side, RPC client + * stub class on the client side). + */ + val RpcService: AttributeKey[String] = string("rpc.service") + + /** A string identifying the remoting system. See below for a list of + * well-known identifiers. + */ + val RpcSystem: AttributeKey[String] = string("rpc.system") + // Enum definitions + + /** Values for [[RpcConnectRpcErrorCode]]. + */ + abstract class RpcConnectRpcErrorCodeValue(val value: String) + object RpcConnectRpcErrorCodeValue { + + /** cancelled. */ + case object Cancelled extends RpcConnectRpcErrorCodeValue("cancelled") + + /** unknown. */ + case object Unknown extends RpcConnectRpcErrorCodeValue("unknown") + + /** invalid_argument. */ + case object InvalidArgument + extends RpcConnectRpcErrorCodeValue("invalid_argument") + + /** deadline_exceeded. */ + case object DeadlineExceeded + extends RpcConnectRpcErrorCodeValue("deadline_exceeded") + + /** not_found. */ + case object NotFound extends RpcConnectRpcErrorCodeValue("not_found") + + /** already_exists. */ + case object AlreadyExists + extends RpcConnectRpcErrorCodeValue("already_exists") + + /** permission_denied. */ + case object PermissionDenied + extends RpcConnectRpcErrorCodeValue("permission_denied") + + /** resource_exhausted. */ + case object ResourceExhausted + extends RpcConnectRpcErrorCodeValue("resource_exhausted") + + /** failed_precondition. */ + case object FailedPrecondition + extends RpcConnectRpcErrorCodeValue("failed_precondition") + + /** aborted. */ + case object Aborted extends RpcConnectRpcErrorCodeValue("aborted") + + /** out_of_range. */ + case object OutOfRange extends RpcConnectRpcErrorCodeValue("out_of_range") + + /** unimplemented. */ + case object Unimplemented + extends RpcConnectRpcErrorCodeValue("unimplemented") + + /** internal. */ + case object Internal extends RpcConnectRpcErrorCodeValue("internal") + + /** unavailable. */ + case object Unavailable extends RpcConnectRpcErrorCodeValue("unavailable") + + /** data_loss. */ + case object DataLoss extends RpcConnectRpcErrorCodeValue("data_loss") + + /** unauthenticated. */ + case object Unauthenticated + extends RpcConnectRpcErrorCodeValue("unauthenticated") + } + + /** Values for [[RpcGrpcStatusCode]]. + */ + abstract class RpcGrpcStatusCodeValue(val value: Long) + object RpcGrpcStatusCodeValue { + + /** OK. */ + case object Ok extends RpcGrpcStatusCodeValue(0) + + /** CANCELLED. */ + case object Cancelled extends RpcGrpcStatusCodeValue(1) + + /** UNKNOWN. */ + case object Unknown extends RpcGrpcStatusCodeValue(2) + + /** INVALID_ARGUMENT. */ + case object InvalidArgument extends RpcGrpcStatusCodeValue(3) + + /** DEADLINE_EXCEEDED. */ + case object DeadlineExceeded extends RpcGrpcStatusCodeValue(4) + + /** NOT_FOUND. */ + case object NotFound extends RpcGrpcStatusCodeValue(5) + + /** ALREADY_EXISTS. */ + case object AlreadyExists extends RpcGrpcStatusCodeValue(6) + + /** PERMISSION_DENIED. */ + case object PermissionDenied extends RpcGrpcStatusCodeValue(7) + + /** RESOURCE_EXHAUSTED. */ + case object ResourceExhausted extends RpcGrpcStatusCodeValue(8) + + /** FAILED_PRECONDITION. */ + case object FailedPrecondition extends RpcGrpcStatusCodeValue(9) + + /** ABORTED. */ + case object Aborted extends RpcGrpcStatusCodeValue(10) + + /** OUT_OF_RANGE. */ + case object OutOfRange extends RpcGrpcStatusCodeValue(11) + + /** UNIMPLEMENTED. */ + case object Unimplemented extends RpcGrpcStatusCodeValue(12) + + /** INTERNAL. */ + case object Internal extends RpcGrpcStatusCodeValue(13) + + /** UNAVAILABLE. */ + case object Unavailable extends RpcGrpcStatusCodeValue(14) + + /** DATA_LOSS. */ + case object DataLoss extends RpcGrpcStatusCodeValue(15) + + /** UNAUTHENTICATED. */ + case object Unauthenticated extends RpcGrpcStatusCodeValue(16) + } + + /** Values for [[RpcSystem]]. + */ + abstract class RpcSystemValue(val value: String) + object RpcSystemValue { + + /** gRPC. */ + case object Grpc extends RpcSystemValue("grpc") + + /** Java RMI. */ + case object JavaRmi extends RpcSystemValue("java_rmi") + + /** .NET WCF. */ + case object DotnetWcf extends RpcSystemValue("dotnet_wcf") + + /** Apache Dubbo. */ + case object ApacheDubbo extends RpcSystemValue("apache_dubbo") + + /** Connect RPC. */ + case object ConnectRpc extends RpcSystemValue("connect_rpc") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ServerExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ServerExperimentalAttributes.scala new file mode 100644 index 000000000..4131bcdd1 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ServerExperimentalAttributes.scala @@ -0,0 +1,52 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ServerExperimentalAttributes { + + /** Server domain name if available without reverse DNS lookup; otherwise, IP + * address or Unix domain socket name. + * + * @note + * - When observed from the client side, and when communicating through an + * intermediary, `server.address` SHOULD represent the server address + * behind any intermediaries, for example proxies, if it's available. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.ServerAttributes.ServerAddress` instead.", + "0.5.0" + ) + val ServerAddress: AttributeKey[String] = string("server.address") + + /** Server port number. + * + * @note + * - When observed from the client side, and when communicating through an + * intermediary, `server.port` SHOULD represent the server port behind + * any intermediaries, for example proxies, if it's available. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.ServerAttributes.ServerPort` instead.", + "0.5.0" + ) + val ServerPort: AttributeKey[Long] = long("server.port") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ServiceExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ServiceExperimentalAttributes.scala new file mode 100644 index 000000000..19734bb31 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ServiceExperimentalAttributes.scala @@ -0,0 +1,75 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ServiceExperimentalAttributes { + + /** The string ID of the service instance. + * + * @note + * - MUST be unique for each instance of the same + * `service.namespace,service.name` pair (in other words + * `service.namespace,service.name,service.instance.id` triplet MUST be + * globally unique). The ID helps to distinguish instances of the same + * service that exist at the same time (e.g. instances of a horizontally + * scaled service). It is preferable for the ID to be persistent and stay + * the same for the lifetime of the service instance, however it is + * acceptable that the ID is ephemeral and changes during important + * lifetime events for the service (e.g. service restarts). If the + * service has no inherent unique ID that can be used as the value of + * this attribute it is recommended to generate a random Version 1 or + * Version 4 RFC 4122 UUID (services aiming for reproducible UUIDs may + * also use Version 5, see RFC 4122 for more recommendations). + */ + val ServiceInstanceId: AttributeKey[String] = string("service.instance.id") + + /** Logical name of the service. + * + * @note + * - MUST be the same for all instances of horizontally scaled services. If + * the value was not specified, SDKs MUST fallback to `unknown_service:` + * concatenated with `process.executable.name`, e.g. + * `unknown_service:bash`. If `process.executable.name` is not available, + * the value MUST be set to `unknown_service`. + */ + val ServiceName: AttributeKey[String] = string("service.name") + + /** A namespace for `service.name`. + * + * @note + * - A string value having a meaning that helps to distinguish a group of + * services, for example the team name that owns a group of services. + * `service.name` is expected to be unique within the same namespace. If + * `service.namespace` is not specified in the Resource then + * `service.name` is expected to be unique for all services that have no + * explicit namespace defined (so the empty/unspecified namespace is + * simply one more valid namespace). Zero-length namespace string is + * assumed equal to unspecified namespace. + */ + val ServiceNamespace: AttributeKey[String] = string("service.namespace") + + /** The version string of the service API or implementation. The format is not + * defined by these conventions. + */ + val ServiceVersion: AttributeKey[String] = string("service.version") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SessionExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SessionExperimentalAttributes.scala new file mode 100644 index 000000000..1ca888aa9 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SessionExperimentalAttributes.scala @@ -0,0 +1,33 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object SessionExperimentalAttributes { + + /** A unique id to identify a session. + */ + val SessionId: AttributeKey[String] = string("session.id") + + /** The previous `session.id` for this user, when known. + */ + val SessionPreviousId: AttributeKey[String] = string("session.previous_id") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SourceExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SourceExperimentalAttributes.scala new file mode 100644 index 000000000..8c9abb1ef --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SourceExperimentalAttributes.scala @@ -0,0 +1,40 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object SourceExperimentalAttributes { + + /** Source address - domain name if available without reverse DNS lookup; + * otherwise, IP address or Unix domain socket name. + * + * @note + * - When observed from the destination side, and when communicating + * through an intermediary, `source.address` SHOULD represent the source + * address behind any intermediaries, for example proxies, if it's + * available. + */ + val SourceAddress: AttributeKey[String] = string("source.address") + + /** Source port number + */ + val SourcePort: AttributeKey[Long] = long("source.port") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SystemExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SystemExperimentalAttributes.scala new file mode 100644 index 000000000..674fa7010 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/SystemExperimentalAttributes.scala @@ -0,0 +1,277 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object SystemExperimentalAttributes { + + /** The logical CPU number [0..n-1] + */ + val SystemCpuLogicalNumber: AttributeKey[Long] = long( + "system.cpu.logical_number" + ) + + /** The state of the CPU + */ + val SystemCpuState: AttributeKey[String] = string("system.cpu.state") + + /** The device identifier + */ + val SystemDevice: AttributeKey[String] = string("system.device") + + /** The filesystem mode + */ + val SystemFilesystemMode: AttributeKey[String] = string( + "system.filesystem.mode" + ) + + /** The filesystem mount path + */ + val SystemFilesystemMountpoint: AttributeKey[String] = string( + "system.filesystem.mountpoint" + ) + + /** The filesystem state + */ + val SystemFilesystemState: AttributeKey[String] = string( + "system.filesystem.state" + ) + + /** The filesystem type + */ + val SystemFilesystemType: AttributeKey[String] = string( + "system.filesystem.type" + ) + + /** The memory state + */ + val SystemMemoryState: AttributeKey[String] = string("system.memory.state") + + /** A stateless protocol MUST NOT set this attribute + */ + val SystemNetworkState: AttributeKey[String] = string("system.network.state") + + /** The paging access direction + */ + val SystemPagingDirection: AttributeKey[String] = string( + "system.paging.direction" + ) + + /** The memory paging state + */ + val SystemPagingState: AttributeKey[String] = string("system.paging.state") + + /** The memory paging type + */ + val SystemPagingType: AttributeKey[String] = string("system.paging.type") + + /** The process state, e.g., Linux + * Process State Codes + */ + val SystemProcessesStatus: AttributeKey[String] = string( + "system.processes.status" + ) + // Enum definitions + + /** Values for [[SystemCpuState]]. + */ + abstract class SystemCpuStateValue(val value: String) + object SystemCpuStateValue { + + /** user. */ + case object User extends SystemCpuStateValue("user") + + /** system. */ + case object System extends SystemCpuStateValue("system") + + /** nice. */ + case object Nice extends SystemCpuStateValue("nice") + + /** idle. */ + case object Idle extends SystemCpuStateValue("idle") + + /** iowait. */ + case object Iowait extends SystemCpuStateValue("iowait") + + /** interrupt. */ + case object Interrupt extends SystemCpuStateValue("interrupt") + + /** steal. */ + case object Steal extends SystemCpuStateValue("steal") + } + + /** Values for [[SystemFilesystemState]]. + */ + abstract class SystemFilesystemStateValue(val value: String) + object SystemFilesystemStateValue { + + /** used. */ + case object Used extends SystemFilesystemStateValue("used") + + /** free. */ + case object Free extends SystemFilesystemStateValue("free") + + /** reserved. */ + case object Reserved extends SystemFilesystemStateValue("reserved") + } + + /** Values for [[SystemFilesystemType]]. + */ + abstract class SystemFilesystemTypeValue(val value: String) + object SystemFilesystemTypeValue { + + /** fat32. */ + case object Fat32 extends SystemFilesystemTypeValue("fat32") + + /** exfat. */ + case object Exfat extends SystemFilesystemTypeValue("exfat") + + /** ntfs. */ + case object Ntfs extends SystemFilesystemTypeValue("ntfs") + + /** refs. */ + case object Refs extends SystemFilesystemTypeValue("refs") + + /** hfsplus. */ + case object Hfsplus extends SystemFilesystemTypeValue("hfsplus") + + /** ext4. */ + case object Ext4 extends SystemFilesystemTypeValue("ext4") + } + + /** Values for [[SystemMemoryState]]. + */ + abstract class SystemMemoryStateValue(val value: String) + object SystemMemoryStateValue { + + /** used. */ + case object Used extends SystemMemoryStateValue("used") + + /** free. */ + case object Free extends SystemMemoryStateValue("free") + + /** shared. */ + case object Shared extends SystemMemoryStateValue("shared") + + /** buffers. */ + case object Buffers extends SystemMemoryStateValue("buffers") + + /** cached. */ + case object Cached extends SystemMemoryStateValue("cached") + } + + /** Values for [[SystemNetworkState]]. + */ + abstract class SystemNetworkStateValue(val value: String) + object SystemNetworkStateValue { + + /** close. */ + case object Close extends SystemNetworkStateValue("close") + + /** close_wait. */ + case object CloseWait extends SystemNetworkStateValue("close_wait") + + /** closing. */ + case object Closing extends SystemNetworkStateValue("closing") + + /** delete. */ + case object Delete extends SystemNetworkStateValue("delete") + + /** established. */ + case object Established extends SystemNetworkStateValue("established") + + /** fin_wait_1. */ + case object FinWait1 extends SystemNetworkStateValue("fin_wait_1") + + /** fin_wait_2. */ + case object FinWait2 extends SystemNetworkStateValue("fin_wait_2") + + /** last_ack. */ + case object LastAck extends SystemNetworkStateValue("last_ack") + + /** listen. */ + case object Listen extends SystemNetworkStateValue("listen") + + /** syn_recv. */ + case object SynRecv extends SystemNetworkStateValue("syn_recv") + + /** syn_sent. */ + case object SynSent extends SystemNetworkStateValue("syn_sent") + + /** time_wait. */ + case object TimeWait extends SystemNetworkStateValue("time_wait") + } + + /** Values for [[SystemPagingDirection]]. + */ + abstract class SystemPagingDirectionValue(val value: String) + object SystemPagingDirectionValue { + + /** in. */ + case object In extends SystemPagingDirectionValue("in") + + /** out. */ + case object Out extends SystemPagingDirectionValue("out") + } + + /** Values for [[SystemPagingState]]. + */ + abstract class SystemPagingStateValue(val value: String) + object SystemPagingStateValue { + + /** used. */ + case object Used extends SystemPagingStateValue("used") + + /** free. */ + case object Free extends SystemPagingStateValue("free") + } + + /** Values for [[SystemPagingType]]. + */ + abstract class SystemPagingTypeValue(val value: String) + object SystemPagingTypeValue { + + /** major. */ + case object Major extends SystemPagingTypeValue("major") + + /** minor. */ + case object Minor extends SystemPagingTypeValue("minor") + } + + /** Values for [[SystemProcessesStatus]]. + */ + abstract class SystemProcessesStatusValue(val value: String) + object SystemProcessesStatusValue { + + /** running. */ + case object Running extends SystemProcessesStatusValue("running") + + /** sleeping. */ + case object Sleeping extends SystemProcessesStatusValue("sleeping") + + /** stopped. */ + case object Stopped extends SystemProcessesStatusValue("stopped") + + /** defunct. */ + case object Defunct extends SystemProcessesStatusValue("defunct") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/TelemetryExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/TelemetryExperimentalAttributes.scala new file mode 100644 index 000000000..b26c4f4c3 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/TelemetryExperimentalAttributes.scala @@ -0,0 +1,115 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object TelemetryExperimentalAttributes { + + /** The name of the auto instrumentation agent or distribution, if used. + * + * @note + * - Official auto instrumentation agents and distributions SHOULD set the + * `telemetry.distro.name` attribute to a string starting with + * `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`. + */ + val TelemetryDistroName: AttributeKey[String] = string( + "telemetry.distro.name" + ) + + /** The version string of the auto instrumentation agent or distribution, if + * used. + */ + val TelemetryDistroVersion: AttributeKey[String] = string( + "telemetry.distro.version" + ) + + /** The language of the telemetry SDK. + */ + val TelemetrySdkLanguage: AttributeKey[String] = string( + "telemetry.sdk.language" + ) + + /** The name of the telemetry SDK as defined above. + * + * @note + * - The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to + * `opentelemetry`. If another SDK, like a fork or a vendor-provided + * implementation, is used, this SDK MUST set the `telemetry.sdk.name` + * attribute to the fully-qualified class or module name of this SDK's + * main entry point or another suitable identifier depending on the + * language. The identifier `opentelemetry` is reserved and MUST NOT be + * used in this case. All custom identifiers SHOULD be stable across + * different versions of an implementation. + */ + val TelemetrySdkName: AttributeKey[String] = string("telemetry.sdk.name") + + /** The version string of the telemetry SDK. + */ + val TelemetrySdkVersion: AttributeKey[String] = string( + "telemetry.sdk.version" + ) + // Enum definitions + + /** Values for [[TelemetrySdkLanguage]]. + */ + abstract class TelemetrySdkLanguageValue(val value: String) + object TelemetrySdkLanguageValue { + + /** cpp. */ + case object Cpp extends TelemetrySdkLanguageValue("cpp") + + /** dotnet. */ + case object Dotnet extends TelemetrySdkLanguageValue("dotnet") + + /** erlang. */ + case object Erlang extends TelemetrySdkLanguageValue("erlang") + + /** go. */ + case object Go extends TelemetrySdkLanguageValue("go") + + /** java. */ + case object Java extends TelemetrySdkLanguageValue("java") + + /** nodejs. */ + case object Nodejs extends TelemetrySdkLanguageValue("nodejs") + + /** php. */ + case object Php extends TelemetrySdkLanguageValue("php") + + /** python. */ + case object Python extends TelemetrySdkLanguageValue("python") + + /** ruby. */ + case object Ruby extends TelemetrySdkLanguageValue("ruby") + + /** rust. */ + case object Rust extends TelemetrySdkLanguageValue("rust") + + /** swift. */ + case object Swift extends TelemetrySdkLanguageValue("swift") + + /** webjs. */ + case object Webjs extends TelemetrySdkLanguageValue("webjs") + + /** scala. */ + case object Scala extends TelemetrySdkLanguageValue("scala") + } + +} diff --git a/semconv/src/test/scala/org/typelevel/otel4s/semconv/trace/attributes/SemanticAttributesSuite.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ThreadExperimentalAttributes.scala similarity index 52% rename from semconv/src/test/scala/org/typelevel/otel4s/semconv/trace/attributes/SemanticAttributesSuite.scala rename to semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ThreadExperimentalAttributes.scala index 1336e94cc..93e57ca9b 100644 --- a/semconv/src/test/scala/org/typelevel/otel4s/semconv/trace/attributes/SemanticAttributesSuite.scala +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/ThreadExperimentalAttributes.scala @@ -14,21 +14,20 @@ * limitations under the License. */ -package org.typelevel.otel4s.semconv -package trace.attributes +package org.typelevel.otel4s.semconv.experimental.attributes -import munit._ +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ -class SemanticAttributesSuite extends FunSuite { +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ThreadExperimentalAttributes { - test("the schema url should match with the sem conv version") { - val version = - BuildInfo.openTelemetrySemanticConventionsVersion.stripSuffix("-alpha") + /** Current "managed" thread ID (as opposed to OS thread ID). + */ + val ThreadId: AttributeKey[Long] = long("thread.id") - assertEquals( - SemanticAttributes.SchemaUrl, - s"https://opentelemetry.io/schemas/$version" - ) - } + /** Current thread name. + */ + val ThreadName: AttributeKey[String] = string("thread.name") } diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/TlsExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/TlsExperimentalAttributes.scala new file mode 100644 index 000000000..6cab14af3 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/TlsExperimentalAttributes.scala @@ -0,0 +1,221 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object TlsExperimentalAttributes { + + /** String indicating the cipher + * used during the current connection. + * + * @note + * - The values allowed for `tls.cipher` MUST be one of the `Descriptions` + * of the registered + * TLS Cipher Suits. + */ + val TlsCipher: AttributeKey[String] = string("tls.cipher") + + /** PEM-encoded stand-alone certificate offered by the client. This is usually + * mutually-exclusive of `client.certificate_chain` since this value also + * exists in that list. + */ + val TlsClientCertificate: AttributeKey[String] = string( + "tls.client.certificate" + ) + + /** Array of PEM-encoded certificates that make up the certificate chain + * offered by the client. This is usually mutually-exclusive of + * `client.certificate` since that value should be the first certificate in + * the chain. + */ + val TlsClientCertificateChain: AttributeKey[Seq[String]] = stringSeq( + "tls.client.certificate_chain" + ) + + /** Certificate fingerprint using the MD5 digest of DER-encoded version of + * certificate offered by the client. For consistency with other hash values, + * this value should be formatted as an uppercase hash. + */ + val TlsClientHashMd5: AttributeKey[String] = string("tls.client.hash.md5") + + /** Certificate fingerprint using the SHA1 digest of DER-encoded version of + * certificate offered by the client. For consistency with other hash values, + * this value should be formatted as an uppercase hash. + */ + val TlsClientHashSha1: AttributeKey[String] = string("tls.client.hash.sha1") + + /** Certificate fingerprint using the SHA256 digest of DER-encoded version of + * certificate offered by the client. For consistency with other hash values, + * this value should be formatted as an uppercase hash. + */ + val TlsClientHashSha256: AttributeKey[String] = string( + "tls.client.hash.sha256" + ) + + /** Distinguished name of subject + * of the issuer of the x.509 certificate presented by the client. + */ + val TlsClientIssuer: AttributeKey[String] = string("tls.client.issuer") + + /** A hash that identifies clients based on how they perform an SSL/TLS + * handshake. + */ + val TlsClientJa3: AttributeKey[String] = string("tls.client.ja3") + + /** Date/Time indicating when client certificate is no longer considered + * valid. + */ + val TlsClientNotAfter: AttributeKey[String] = string("tls.client.not_after") + + /** Date/Time indicating when client certificate is first considered valid. + */ + val TlsClientNotBefore: AttributeKey[String] = string("tls.client.not_before") + + /** Also called an SNI, this tells the server which hostname to which the + * client is attempting to connect to. + */ + val TlsClientServerName: AttributeKey[String] = string( + "tls.client.server_name" + ) + + /** Distinguished name of subject of the x.509 certificate presented by the + * client. + */ + val TlsClientSubject: AttributeKey[String] = string("tls.client.subject") + + /** Array of ciphers offered by the client during the client hello. + */ + val TlsClientSupportedCiphers: AttributeKey[Seq[String]] = stringSeq( + "tls.client.supported_ciphers" + ) + + /** String indicating the curve used for the given cipher, when applicable + */ + val TlsCurve: AttributeKey[String] = string("tls.curve") + + /** Boolean flag indicating if the TLS negotiation was successful and + * transitioned to an encrypted tunnel. + */ + val TlsEstablished: AttributeKey[Boolean] = boolean("tls.established") + + /** String indicating the protocol being tunneled. Per the values in the IANA + * registry, this string should be lower case. + */ + val TlsNextProtocol: AttributeKey[String] = string("tls.next_protocol") + + /** Normalized lowercase protocol name parsed from original string of the + * negotiated SSL/TLS + * protocol version + */ + val TlsProtocolName: AttributeKey[String] = string("tls.protocol.name") + + /** Numeric part of the version parsed from the original string of the + * negotiated SSL/TLS + * protocol version + */ + val TlsProtocolVersion: AttributeKey[String] = string("tls.protocol.version") + + /** Boolean flag indicating if this TLS connection was resumed from an + * existing TLS negotiation. + */ + val TlsResumed: AttributeKey[Boolean] = boolean("tls.resumed") + + /** PEM-encoded stand-alone certificate offered by the server. This is usually + * mutually-exclusive of `server.certificate_chain` since this value also + * exists in that list. + */ + val TlsServerCertificate: AttributeKey[String] = string( + "tls.server.certificate" + ) + + /** Array of PEM-encoded certificates that make up the certificate chain + * offered by the server. This is usually mutually-exclusive of + * `server.certificate` since that value should be the first certificate in + * the chain. + */ + val TlsServerCertificateChain: AttributeKey[Seq[String]] = stringSeq( + "tls.server.certificate_chain" + ) + + /** Certificate fingerprint using the MD5 digest of DER-encoded version of + * certificate offered by the server. For consistency with other hash values, + * this value should be formatted as an uppercase hash. + */ + val TlsServerHashMd5: AttributeKey[String] = string("tls.server.hash.md5") + + /** Certificate fingerprint using the SHA1 digest of DER-encoded version of + * certificate offered by the server. For consistency with other hash values, + * this value should be formatted as an uppercase hash. + */ + val TlsServerHashSha1: AttributeKey[String] = string("tls.server.hash.sha1") + + /** Certificate fingerprint using the SHA256 digest of DER-encoded version of + * certificate offered by the server. For consistency with other hash values, + * this value should be formatted as an uppercase hash. + */ + val TlsServerHashSha256: AttributeKey[String] = string( + "tls.server.hash.sha256" + ) + + /** Distinguished name of subject + * of the issuer of the x.509 certificate presented by the client. + */ + val TlsServerIssuer: AttributeKey[String] = string("tls.server.issuer") + + /** A hash that identifies servers based on how they perform an SSL/TLS + * handshake. + */ + val TlsServerJa3s: AttributeKey[String] = string("tls.server.ja3s") + + /** Date/Time indicating when server certificate is no longer considered + * valid. + */ + val TlsServerNotAfter: AttributeKey[String] = string("tls.server.not_after") + + /** Date/Time indicating when server certificate is first considered valid. + */ + val TlsServerNotBefore: AttributeKey[String] = string("tls.server.not_before") + + /** Distinguished name of subject of the x.509 certificate presented by the + * server. + */ + val TlsServerSubject: AttributeKey[String] = string("tls.server.subject") + // Enum definitions + + /** Values for [[TlsProtocolName]]. + */ + abstract class TlsProtocolNameValue(val value: String) + object TlsProtocolNameValue { + + /** ssl. */ + case object Ssl extends TlsProtocolNameValue("ssl") + + /** tls. */ + case object Tls extends TlsProtocolNameValue("tls") + } + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/UrlExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/UrlExperimentalAttributes.scala new file mode 100644 index 000000000..aefa45433 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/UrlExperimentalAttributes.scala @@ -0,0 +1,87 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object UrlExperimentalAttributes { + + /** The URI + * fragment component + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.UrlAttributes.UrlFragment` instead.", + "0.5.0" + ) + val UrlFragment: AttributeKey[String] = string("url.fragment") + + /** Absolute URL describing a network resource according to RFC3986 + * + * @note + * - For network calls, URL usually has + * `scheme://host[:port][path][?query][#fragment]` format, where the + * fragment is not transmitted over HTTP, but if it is known, it SHOULD + * be included nevertheless. `url.full` MUST NOT contain credentials + * passed via URL in form of + * `https://username:password@www.example.com/`. In such case username + * and password SHOULD be redacted and attribute's value SHOULD be + * `https://REDACTED:REDACTED@www.example.com/`. `url.full` SHOULD + * capture the absolute URL when it is available (or can be + * reconstructed) and SHOULD NOT be validated or modified except for + * sanitizing purposes. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.UrlAttributes.UrlFull` instead.", + "0.5.0" + ) + val UrlFull: AttributeKey[String] = string("url.full") + + /** The URI + * path component + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.UrlAttributes.UrlPath` instead.", + "0.5.0" + ) + val UrlPath: AttributeKey[String] = string("url.path") + + /** The URI + * query component + * + * @note + * - Sensitive content provided in query string SHOULD be scrubbed when + * instrumentations can identify it. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.UrlAttributes.UrlQuery` instead.", + "0.5.0" + ) + val UrlQuery: AttributeKey[String] = string("url.query") + + /** The URI + * scheme component identifying the used protocol. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.UrlAttributes.UrlScheme` instead.", + "0.5.0" + ) + val UrlScheme: AttributeKey[String] = string("url.scheme") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/UserAgentExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/UserAgentExperimentalAttributes.scala new file mode 100644 index 000000000..1f280a271 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/UserAgentExperimentalAttributes.scala @@ -0,0 +1,35 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object UserAgentExperimentalAttributes { + + /** Value of the HTTP + * User-Agent header sent by the client. + */ + @deprecated( + "use `org.typelevel.otel4s.semconv.attributes.UserAgentAttributes.UserAgentOriginal` instead.", + "0.5.0" + ) + val UserAgentOriginal: AttributeKey[String] = string("user_agent.original") + +} diff --git a/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/WebengineExperimentalAttributes.scala b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/WebengineExperimentalAttributes.scala new file mode 100644 index 000000000..5c8136de0 --- /dev/null +++ b/semconv/experimental/src/main/scala/org/typelevel/otel4s/semconv/experimental/WebengineExperimentalAttributes.scala @@ -0,0 +1,40 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.experimental.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object WebengineExperimentalAttributes { + + /** Additional description of the web engine (e.g. detailed version and + * edition information). + */ + val WebengineDescription: AttributeKey[String] = string( + "webengine.description" + ) + + /** The name of the web engine. + */ + val WebengineName: AttributeKey[String] = string("webengine.name") + + /** The version of the web engine. + */ + val WebengineVersion: AttributeKey[String] = string("webengine.version") + +} diff --git a/semconv/src/main/scala/org/typelevel/otel4s/semconv/resource/attributes/ResourceAttributes.scala b/semconv/src/main/scala/org/typelevel/otel4s/semconv/resource/attributes/ResourceAttributes.scala deleted file mode 100644 index 47a70e83e..000000000 --- a/semconv/src/main/scala/org/typelevel/otel4s/semconv/resource/attributes/ResourceAttributes.scala +++ /dev/null @@ -1,1204 +0,0 @@ -/* - * Copyright 2023 Typelevel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.typelevel.otel4s.semconv.resource.attributes - -import org.typelevel.otel4s.AttributeKey -import org.typelevel.otel4s.AttributeKey._ - -// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 -object ResourceAttributes { - - /** The URL of the OpenTelemetry schema for these keys and values. - */ - final val SchemaUrl = "https://opentelemetry.io/schemas/1.23.1" - - /** The cloud account ID the resource is assigned to. - */ - val CloudAccountId: AttributeKey[String] = string("cloud.account.id") - - /** Cloud regions often have multiple, isolated locations known as zones to - * increase availability. Availability zone represents the zone where the - * resource is running. - * - *

    Notes:

    • Availability zones are called "zones" on - * Alibaba Cloud and Google Cloud.
    - */ - val CloudAvailabilityZone: AttributeKey[String] = string( - "cloud.availability_zone" - ) - - /** The cloud platform in use. - * - *

    Notes:

    • The prefix of the service SHOULD match the one - * specified in `cloud.provider`.
    - */ - val CloudPlatform: AttributeKey[String] = string("cloud.platform") - - /** Name of the cloud provider. - */ - val CloudProvider: AttributeKey[String] = string("cloud.provider") - - /** The geographical region the resource is running. - * - *

    Notes:

    - */ - val CloudRegion: AttributeKey[String] = string("cloud.region") - - /** Cloud provider-specific native identifier of the monitored cloud resource - * (e.g. an ARN - * on AWS, a fully - * qualified resource ID on Azure, a full - * resource name on GCP) - * - *

    Notes:

    • On some cloud providers, it may not be possible to - * determine the full ID at startup, so it may be necessary to set - * `cloud.resource_id` as a span attribute instead.
    • The exact value - * to use for `cloud.resource_id` depends on the cloud provider. The - * following well-known definitions MUST be used if you set this attribute - * and they apply:
    • AWS Lambda: The function ARN. - * Take care not to use the "invoked ARN" directly but replace any - * alias - * suffix with the resolved function version, as the same runtime - * instance may be invokable with multiple different aliases.
    • - *
    • GCP: The URI of the - * resource
    • Azure: The Fully - * Qualified Resource ID of the invoked function, not the - * function app, having the form - * `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/`. - * This means that a span attribute MUST be used, as an Azure function app - * can host multiple functions that would usually share a - * TracerProvider.
    - */ - val CloudResourceId: AttributeKey[String] = string("cloud.resource_id") - - /** The command used to run the container (i.e. the command name). - * - *

    Notes:

    • If using embedded credentials or sensitive data, it is - * recommended to remove them to prevent potential leakage.
    - */ - val ContainerCommand: AttributeKey[String] = string("container.command") - - /** All the command arguments (including the command/executable itself) run by - * the container. [2] - */ - val ContainerCommandArgs: AttributeKey[Seq[String]] = stringSeq( - "container.command_args" - ) - - /** The full command run by the container as a single string representing the - * full command. [2] - */ - val ContainerCommandLine: AttributeKey[String] = string( - "container.command_line" - ) - - /** Container ID. Usually a UUID, as for example used to identify - * Docker containers. The UUID might be abbreviated. - */ - val ContainerId: AttributeKey[String] = string("container.id") - - /** Runtime specific image identifier. Usually a hash algorithm followed by a - * UUID. - * - *

    Notes:

    • Docker defines a sha256 of the image id; - * `container.image.id` corresponds to the `Image` field from the Docker - * container inspect API - * endpoint. K8s defines a link to the container registry repository with - * digest `"imageID": "registry.azurecr.io - * /namespace/service/dockerfile@sha256:bdeabd40c3a8a492eaf9e8e44d0ebbb84bac7ee25ac0cf8a7159d25f62555625"`. - * The ID is assinged by the container runtime and can vary in different - * environments. Consider using `oci.manifest.digest` if it is important to - * identify the same image in different environments/runtimes.
    - */ - val ContainerImageId: AttributeKey[String] = string("container.image.id") - - /** Name of the image the container was built on. - */ - val ContainerImageName: AttributeKey[String] = string("container.image.name") - - /** Repo digests of the container image as provided by the container runtime. - * - *

    Notes:

    • Docker - * and CRI - * report those under the `RepoDigests` field.
    - */ - val ContainerImageRepoDigests: AttributeKey[Seq[String]] = stringSeq( - "container.image.repo_digests" - ) - - /** Container image tags. An example can be found in Docker - * Image Inspect. Should be only the `` section of the full name for - * example from `registry.example.com/my-org/my-image:`. - */ - val ContainerImageTags: AttributeKey[Seq[String]] = stringSeq( - "container.image.tags" - ) - - /** Container name used by container runtime. - */ - val ContainerName: AttributeKey[String] = string("container.name") - - /** The container runtime managing this container. - */ - val ContainerRuntime: AttributeKey[String] = string("container.runtime") - - /** The digest of the OCI image manifest. For container images specifically is - * the digest by which the container image is known. - * - *

    Notes:

    - */ - val OciManifestDigest: AttributeKey[String] = string("oci.manifest.digest") - - /** Uniquely identifies the framework API revision offered by a version - * (`os.version`) of the android operating system. More information can be - * found here. - */ - val AndroidOsApiLevel: AttributeKey[String] = string("android.os.api_level") - - /** Array of brand name and version separated by a space - * - *

    Notes:

    - */ - val BrowserBrands: AttributeKey[Seq[String]] = stringSeq("browser.brands") - - /** Preferred language of the user using the browser - * - *

    Notes:

    • This value is intended to be taken from the Navigator - * API `navigator.language`.
    - */ - val BrowserLanguage: AttributeKey[String] = string("browser.language") - - /** A boolean that is true if the browser is running on a mobile device - * - *

    Notes:

    • This value is intended to be taken from the UA client hints - * API (`navigator.userAgentData.mobile`). If unavailable, this attribute - * SHOULD be left unset.
    - */ - val BrowserMobile: AttributeKey[Boolean] = boolean("browser.mobile") - - /** The platform on which the browser is running - * - *

    Notes:

    • This value is intended to be taken from the UA client hints - * API (`navigator.userAgentData.platform`). If unavailable, the legacy - * `navigator.platform` API SHOULD NOT be used instead and this attribute - * SHOULD be left unset in order for the values to be consistent. The list of - * possible values is defined in the W3C - * User-Agent Client Hints specification. Note that some (but not all) of - * these values can overlap with values in the `os.type` - * and `os.name` attributes. However, for consistency, the values in the - * `browser.platform` attribute should capture the exact value that the user - * agent provides.
    - */ - val BrowserPlatform: AttributeKey[String] = string("browser.platform") - - /** The ARN of an ECS - * cluster. - */ - val AwsEcsClusterArn: AttributeKey[String] = string("aws.ecs.cluster.arn") - - /** The Amazon Resource Name (ARN) of an ECS - * container instance. - */ - val AwsEcsContainerArn: AttributeKey[String] = string("aws.ecs.container.arn") - - /** The launch - * type for an ECS task. - */ - val AwsEcsLaunchtype: AttributeKey[String] = string("aws.ecs.launchtype") - - /** The ARN of an ECS - * task definition. - */ - val AwsEcsTaskArn: AttributeKey[String] = string("aws.ecs.task.arn") - - /** The task definition family this task definition is a member of. - */ - val AwsEcsTaskFamily: AttributeKey[String] = string("aws.ecs.task.family") - - /** The revision for this task definition. - */ - val AwsEcsTaskRevision: AttributeKey[String] = string("aws.ecs.task.revision") - - /** The ARN of an EKS cluster. - */ - val AwsEksClusterArn: AttributeKey[String] = string("aws.eks.cluster.arn") - - /** The Amazon Resource Name(s) (ARN) of the AWS log group(s). - * - *

    Notes:

    - */ - val AwsLogGroupArns: AttributeKey[Seq[String]] = stringSeq( - "aws.log.group.arns" - ) - - /** The name(s) of the AWS log group(s) an application is writing to. - * - *

    Notes:

    • Multiple log groups must be supported for cases like - * multi-container applications, where a single application has sidecar - * containers, and each write to their own log group.
    - */ - val AwsLogGroupNames: AttributeKey[Seq[String]] = stringSeq( - "aws.log.group.names" - ) - - /** The ARN(s) of the AWS log stream(s). - * - *

    Notes:

    - */ - val AwsLogStreamArns: AttributeKey[Seq[String]] = stringSeq( - "aws.log.stream.arns" - ) - - /** The name(s) of the AWS log stream(s) an application is writing to. - */ - val AwsLogStreamNames: AttributeKey[Seq[String]] = stringSeq( - "aws.log.stream.names" - ) - - /** The name of the Cloud Run execution - * being run for the Job, as set by the `CLOUD_RUN_EXECUTION` - * environment variable. - */ - val GcpCloudRunJobExecution: AttributeKey[String] = string( - "gcp.cloud_run.job.execution" - ) - - /** The index for a task within an execution as provided by the `CLOUD_RUN_TASK_INDEX` - * environment variable. - */ - val GcpCloudRunJobTaskIndex: AttributeKey[Long] = long( - "gcp.cloud_run.job.task_index" - ) - - /** The hostname of a GCE instance. This is the full value of the default or - * custom - * hostname. - */ - val GcpGceInstanceHostname: AttributeKey[String] = string( - "gcp.gce.instance.hostname" - ) - - /** The instance name of a GCE instance. This is the value provided by - * `host.name`, the visible name of the instance in the Cloud Console UI, and - * the prefix for the default hostname of the instance as defined by the default - * internal DNS name. - */ - val GcpGceInstanceName: AttributeKey[String] = string("gcp.gce.instance.name") - - /** Unique identifier for the application - */ - val HerokuAppId: AttributeKey[String] = string("heroku.app.id") - - /** Commit hash for the current release - */ - val HerokuReleaseCommit: AttributeKey[String] = string( - "heroku.release.commit" - ) - - /** Time and date the release was created - */ - val HerokuReleaseCreationTimestamp: AttributeKey[String] = string( - "heroku.release.creation_timestamp" - ) - - /** Name of the deployment - * environment (aka deployment tier). - */ - val DeploymentEnvironment: AttributeKey[String] = string( - "deployment.environment" - ) - - /** A unique identifier representing the device - * - *

    Notes:

    • The device identifier MUST only be defined using the - * values outlined below. This value is not an advertising identifier and - * MUST NOT be used as such. On iOS (Swift or Objective-C), this value MUST - * be equal to the vendor - * identifier. On Android (Java or Kotlin), this value MUST be equal to - * the Firebase Installation ID or a globally unique UUID which is persisted - * across sessions in your application. More information can be found here - * on best practices and exact implementation details. Caution should be - * taken when storing personal data or anything which can identify a user. - * GDPR and data protection laws may apply, ensure you do your own due - * diligence.
    - */ - val DeviceId: AttributeKey[String] = string("device.id") - - /** The name of the device manufacturer - * - *

    Notes:

    • The Android OS provides this field via Build. - * iOS apps SHOULD hardcode the value `Apple`.
    - */ - val DeviceManufacturer: AttributeKey[String] = string("device.manufacturer") - - /** The model identifier for the device - * - *

    Notes:

    • 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.
    - */ - val DeviceModelIdentifier: AttributeKey[String] = string( - "device.model.identifier" - ) - - /** The marketing name for the device model - * - *

    Notes:

    • It's recommended this value represents a human readable - * version of the device model rather than a machine readable - * alternative.
    - */ - val DeviceModelName: AttributeKey[String] = string("device.model.name") - - /** The execution environment ID as a string, that will be potentially reused - * for other invocations to the same function/function version. - * - *

    Notes:

    • AWS Lambda: Use the (full) log stream - * name.
    - */ - val FaasInstance: AttributeKey[String] = string("faas.instance") - - /** The amount of memory available to the serverless function converted to - * Bytes. - * - *

    Notes:

    • It's recommended to set this attribute since e.g. too - * little memory can easily stop a Java AWS Lambda function from working - * correctly. On AWS Lambda, the environment variable - * `AWS_LAMBDA_FUNCTION_MEMORY_SIZE` provides this information (which must be - * multiplied by 1,048,576).
    - */ - val FaasMaxMemory: AttributeKey[Long] = long("faas.max_memory") - - /** The name of the single function that this runtime instance executes. - * - *

    Notes:

    • This is the name of the function as configured/deployed - * on the FaaS platform and is usually different from the name of the - * callback function (which may be stored in the `code.namespace`/`code.function` - * span attributes).
    • For some cloud providers, the above definition - * is ambiguous. The following definition of function name MUST be used for - * this attribute (and consequently the span name) for the listed cloud - * providers/products:
    • Azure: The full name - * `/`, i.e., function app name followed by a forward slash - * followed by the function name (this form can also be seen in the resource - * JSON for the function). This means that a span attribute MUST be used, as - * an Azure function app can host multiple functions that would usually share - * a TracerProvider (see also the `cloud.resource_id` attribute).
    - */ - val FaasName: AttributeKey[String] = string("faas.name") - - /** The immutable version of the function being executed. - * - *

    Notes:

    • Depending on the cloud provider and platform, - * use:
    • AWS Lambda: The function - * version (an integer represented as a decimal string).
    • - *
    • Google Cloud Run (Services): The revision - * (i.e., the function name plus the revision suffix).
    • - *
    • Google Cloud Functions: The value of the `K_REVISION` - * environment variable.
    • Azure Functions: Not - * applicable. Do not set this attribute.
    - */ - val FaasVersion: AttributeKey[String] = string("faas.version") - - /** The CPU architecture the host system is running on. - */ - val HostArch: AttributeKey[String] = string("host.arch") - - /** Unique host ID. For Cloud, this must be the instance_id assigned by the - * cloud provider. For non-containerized systems, this should be the - * `machine-id`. See the table below for the sources to use to determine the - * `machine-id` based on operating system. - */ - val HostId: AttributeKey[String] = string("host.id") - - /** VM image ID or host OS image ID. For Cloud, this value is from the - * provider. - */ - val HostImageId: AttributeKey[String] = string("host.image.id") - - /** Name of the VM image or OS install the host was instantiated from. - */ - val HostImageName: AttributeKey[String] = string("host.image.name") - - /** The version string of the VM image or host OS as defined in Version Attributes. - */ - val HostImageVersion: AttributeKey[String] = string("host.image.version") - - /** Available IP addresses of the host, excluding loopback interfaces. - * - *

    Notes:

    • IPv4 Addresses MUST be specified in dotted-quad - * notation. IPv6 addresses MUST be specified in the RFC 5952 - * format.
    - */ - val HostIp: AttributeKey[Seq[String]] = stringSeq("host.ip") - - /** Available MAC addresses of the host, excluding loopback interfaces. - * - *

    Notes:

    • MAC Addresses MUST be represented in IEEE - * RA hexadecimal form: as hyphen-separated octets in uppercase - * hexadecimal form from most to least significant.
    - */ - val HostMac: AttributeKey[Seq[String]] = stringSeq("host.mac") - - /** Name of the host. On Unix systems, it may contain what the hostname - * command returns, or the fully qualified hostname, or another name - * specified by the user. - */ - val HostName: AttributeKey[String] = string("host.name") - - /** Type of host. For Cloud, this must be the machine type. - */ - val HostType: AttributeKey[String] = string("host.type") - - /** The amount of level 2 memory cache available to the processor (in Bytes). - */ - val HostCpuCacheL2Size: AttributeKey[Long] = long("host.cpu.cache.l2.size") - - /** Numeric value specifying the family or generation of the CPU. - */ - val HostCpuFamily: AttributeKey[Long] = long("host.cpu.family") - - /** Model identifier. It provides more granular information about the CPU, - * distinguishing it from other CPUs within the same family. - */ - val HostCpuModelId: AttributeKey[Long] = long("host.cpu.model.id") - - /** Model designation of the processor. - */ - val HostCpuModelName: AttributeKey[String] = string("host.cpu.model.name") - - /** Stepping or core revisions. - */ - val HostCpuStepping: AttributeKey[Long] = long("host.cpu.stepping") - - /** Processor manufacturer identifier. A maximum 12-character string. - * - *

    Notes:

    • CPUID - * command returns the vendor ID string in EBX, EDX and ECX registers. - * Writing these to memory in this order results in a 12-character - * string.
    - */ - val HostCpuVendorId: AttributeKey[String] = string("host.cpu.vendor.id") - - /** The name of the cluster. - */ - val K8sClusterName: AttributeKey[String] = string("k8s.cluster.name") - - /** A pseudo-ID for the cluster, set to the UID of the `kube-system` - * namespace. - * - *

    Notes:

    • K8s doesn't have support for obtaining a cluster ID. If - * this is ever added, we will recommend collecting the `k8s.cluster.uid` - * through the official APIs. In the meantime, we are able to use the `uid` - * of the `kube-system` namespace as a proxy for cluster ID. Read on for the - * rationale.
    • Every object created in a K8s cluster is assigned a - * distinct UID. The `kube-system` namespace is used by Kubernetes itself and - * will exist for the lifetime of the cluster. Using the `uid` of the - * `kube-system` namespace is a reasonable proxy for the K8s ClusterID as it - * will only change if the cluster is rebuilt. Furthermore, Kubernetes UIDs - * are UUIDs as standardized by ISO/IEC 9834-8 - * and ITU-T X.667. Which states:
    • If generated - * according to one of the mechanisms defined in Rec.
    • - *
    • ITU-T X.667 | ISO/IEC 9834-8, a UUID is either guaranteed to be - * different from all other UUIDs generated before 3603 A.D., or is extremely - * likely to be different (depending on the mechanism - * chosen).
    • Therefore, UIDs between clusters should be extremely - * unlikely to conflict.
    - */ - val K8sClusterUid: AttributeKey[String] = string("k8s.cluster.uid") - - /** The name of the Node. - */ - val K8sNodeName: AttributeKey[String] = string("k8s.node.name") - - /** The UID of the Node. - */ - val K8sNodeUid: AttributeKey[String] = string("k8s.node.uid") - - /** The name of the namespace that the pod is running in. - */ - val K8sNamespaceName: AttributeKey[String] = string("k8s.namespace.name") - - /** The name of the Pod. - */ - val K8sPodName: AttributeKey[String] = string("k8s.pod.name") - - /** The UID of the Pod. - */ - val K8sPodUid: AttributeKey[String] = string("k8s.pod.uid") - - /** The name of the Container from Pod specification, must be unique within a - * Pod. Container runtime usually uses different globally unique name - * (`container.name`). - */ - val K8sContainerName: AttributeKey[String] = string("k8s.container.name") - - /** Number of times the container was restarted. This attribute can be used to - * identify a particular container (running or stopped) within a container - * spec. - */ - val K8sContainerRestartCount: AttributeKey[Long] = long( - "k8s.container.restart_count" - ) - - /** The name of the ReplicaSet. - */ - val K8sReplicasetName: AttributeKey[String] = string("k8s.replicaset.name") - - /** The UID of the ReplicaSet. - */ - val K8sReplicasetUid: AttributeKey[String] = string("k8s.replicaset.uid") - - /** The name of the Deployment. - */ - val K8sDeploymentName: AttributeKey[String] = string("k8s.deployment.name") - - /** The UID of the Deployment. - */ - val K8sDeploymentUid: AttributeKey[String] = string("k8s.deployment.uid") - - /** The name of the StatefulSet. - */ - val K8sStatefulsetName: AttributeKey[String] = string("k8s.statefulset.name") - - /** The UID of the StatefulSet. - */ - val K8sStatefulsetUid: AttributeKey[String] = string("k8s.statefulset.uid") - - /** The name of the DaemonSet. - */ - val K8sDaemonsetName: AttributeKey[String] = string("k8s.daemonset.name") - - /** The UID of the DaemonSet. - */ - val K8sDaemonsetUid: AttributeKey[String] = string("k8s.daemonset.uid") - - /** The name of the Job. - */ - val K8sJobName: AttributeKey[String] = string("k8s.job.name") - - /** The UID of the Job. - */ - val K8sJobUid: AttributeKey[String] = string("k8s.job.uid") - - /** The name of the CronJob. - */ - val K8sCronjobName: AttributeKey[String] = string("k8s.cronjob.name") - - /** The UID of the CronJob. - */ - val K8sCronjobUid: AttributeKey[String] = string("k8s.cronjob.uid") - - /** Unique identifier for a particular build or compilation of the operating - * system. - */ - val OsBuildId: AttributeKey[String] = string("os.build_id") - - /** Human readable (not intended to be parsed) OS version information, like - * e.g. reported by `ver` or `lsb_release -a` commands. - */ - val OsDescription: AttributeKey[String] = string("os.description") - - /** Human readable operating system name. - */ - val OsName: AttributeKey[String] = string("os.name") - - /** The operating system type. - */ - val OsType: AttributeKey[String] = string("os.type") - - /** The version string of the operating system as defined in Version Attributes. - */ - val OsVersion: AttributeKey[String] = string("os.version") - - /** The command used to launch the process (i.e. the command name). On Linux - * based systems, can be set to the zeroth string in `proc/[pid]/cmdline`. On - * Windows, can be set to the first parameter extracted from - * `GetCommandLineW`. - */ - val ProcessCommand: AttributeKey[String] = string("process.command") - - /** All the command arguments (including the command/executable itself) as - * received by the process. On Linux-based systems (and some other Unixoid - * systems supporting procfs), can be set according to the list of - * null-delimited strings extracted from `proc/[pid]/cmdline`. For libc-based - * executables, this would be the full argv vector passed to `main`. - */ - val ProcessCommandArgs: AttributeKey[Seq[String]] = stringSeq( - "process.command_args" - ) - - /** The full command used to launch the process as a single string - * representing the full command. On Windows, can be set to the result of - * `GetCommandLineW`. Do not set this if you have to assemble it just for - * monitoring; use `process.command_args` instead. - */ - val ProcessCommandLine: AttributeKey[String] = string("process.command_line") - - /** The name of the process executable. On Linux based systems, can be set to - * the `Name` in `proc/[pid]/status`. On Windows, can be set to the base name - * of `GetProcessImageFileNameW`. - */ - val ProcessExecutableName: AttributeKey[String] = string( - "process.executable.name" - ) - - /** The full path to the process executable. On Linux based systems, can be - * set to the target of `proc/[pid]/exe`. On Windows, can be set to the - * result of `GetProcessImageFileNameW`. - */ - val ProcessExecutablePath: AttributeKey[String] = string( - "process.executable.path" - ) - - /** The username of the user that owns the process. - */ - val ProcessOwner: AttributeKey[String] = string("process.owner") - - /** Parent Process identifier (PID). - */ - val ProcessParentPid: AttributeKey[Long] = long("process.parent_pid") - - /** Process identifier (PID). - */ - val ProcessPid: AttributeKey[Long] = long("process.pid") - - /** An additional description about the runtime of the process, for example a - * specific vendor customization of the runtime environment. - */ - val ProcessRuntimeDescription: AttributeKey[String] = string( - "process.runtime.description" - ) - - /** The name of the runtime of this process. For compiled native binaries, - * this SHOULD be the name of the compiler. - */ - val ProcessRuntimeName: AttributeKey[String] = string("process.runtime.name") - - /** The version of the runtime of this process, as returned by the runtime - * without modification. - */ - val ProcessRuntimeVersion: AttributeKey[String] = string( - "process.runtime.version" - ) - - /** Logical name of the service. - * - *

    Notes:

    • MUST be the same for all instances of horizontally - * scaled services. If the value was not specified, SDKs MUST fallback to - * `unknown_service:` concatenated with `process.executable.name`, e.g. - * `unknown_service:bash`. If `process.executable.name` is not available, the - * value MUST be set to `unknown_service`.
    - */ - val ServiceName: AttributeKey[String] = string("service.name") - - /** The version string of the service API or implementation. The format is not - * defined by these conventions. - */ - val ServiceVersion: AttributeKey[String] = string("service.version") - - /** The string ID of the service instance. - * - *

    Notes:

    • MUST be unique for each instance of the same - * `service.namespace,service.name` pair (in other words - * `service.namespace,service.name,service.instance.id` triplet MUST be - * globally unique). The ID helps to distinguish instances of the same - * service that exist at the same time (e.g. instances of a horizontally - * scaled service). It is preferable for the ID to be persistent and stay the - * same for the lifetime of the service instance, however it is acceptable - * that the ID is ephemeral and changes during important lifetime events for - * the service (e.g. service restarts). If the service has no inherent unique - * ID that can be used as the value of this attribute it is recommended to - * generate a random Version 1 or Version 4 RFC 4122 UUID (services aiming - * for reproducible UUIDs may also use Version 5, see RFC 4122 for more - * recommendations).
    - */ - val ServiceInstanceId: AttributeKey[String] = string("service.instance.id") - - /** A namespace for `service.name`. - * - *

    Notes:

    • A string value having a meaning that helps to - * distinguish a group of services, for example the team name that owns a - * group of services. `service.name` is expected to be unique within the same - * namespace. If `service.namespace` is not specified in the Resource then - * `service.name` is expected to be unique for all services that have no - * explicit namespace defined (so the empty/unspecified namespace is simply - * one more valid namespace). Zero-length namespace string is assumed equal - * to unspecified namespace.
    - */ - val ServiceNamespace: AttributeKey[String] = string("service.namespace") - - /** The language of the telemetry SDK. - */ - val TelemetrySdkLanguage: AttributeKey[String] = string( - "telemetry.sdk.language" - ) - - /** The name of the telemetry SDK as defined above. - * - *

    Notes:

    • The OpenTelemetry SDK MUST set the `telemetry.sdk.name` - * attribute to `opentelemetry`. If another SDK, like a fork or a - * vendor-provided implementation, is used, this SDK MUST set the - * `telemetry.sdk.name` attribute to the fully-qualified class or module name - * of this SDK's main entry point or another suitable identifier depending on - * the language. The identifier `opentelemetry` is reserved and MUST NOT be - * used in this case. All custom identifiers SHOULD be stable across - * different versions of an implementation.
    - */ - val TelemetrySdkName: AttributeKey[String] = string("telemetry.sdk.name") - - /** The version string of the telemetry SDK. - */ - val TelemetrySdkVersion: AttributeKey[String] = string( - "telemetry.sdk.version" - ) - - /** The name of the auto instrumentation agent or distribution, if used. - * - *

    Notes:

    • Official auto instrumentation agents and distributions - * SHOULD set the `telemetry.distro.name` attribute to a string starting with - * `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`.
    - */ - val TelemetryDistroName: AttributeKey[String] = string( - "telemetry.distro.name" - ) - - /** The version string of the auto instrumentation agent or distribution, if - * used. - */ - val TelemetryDistroVersion: AttributeKey[String] = string( - "telemetry.distro.version" - ) - - /** Additional description of the web engine (e.g. detailed version and - * edition information). - */ - val WebengineDescription: AttributeKey[String] = string( - "webengine.description" - ) - - /** The name of the web engine. - */ - val WebengineName: AttributeKey[String] = string("webengine.name") - - /** The version of the web engine. - */ - val WebengineVersion: AttributeKey[String] = string("webengine.version") - - /** The name of the instrumentation scope - (`InstrumentationScope.Name` in - * OTLP). - */ - val OtelScopeName: AttributeKey[String] = string("otel.scope.name") - - /** The version of the instrumentation scope - (`InstrumentationScope.Version` - * in OTLP). - */ - val OtelScopeVersion: AttributeKey[String] = string("otel.scope.version") - - /** Deprecated, use the `otel.scope.name` attribute. - */ - @deprecated("Use the `otel.scope.name` attribute", "0.3.0") - val OtelLibraryName: AttributeKey[String] = string("otel.library.name") - - /** Deprecated, use the `otel.scope.version` attribute. - */ - @deprecated("Use the `otel.scope.version` attribute", "0.3.0") - val OtelLibraryVersion: AttributeKey[String] = string("otel.library.version") - - // Enum definitions - abstract class CloudPlatformValue(val value: String) - object CloudPlatformValue { - - /** Alibaba Cloud Elastic Compute Service. */ - case object AlibabaCloudEcs extends CloudPlatformValue("alibaba_cloud_ecs") - - /** Alibaba Cloud Function Compute. */ - case object AlibabaCloudFc extends CloudPlatformValue("alibaba_cloud_fc") - - /** Red Hat OpenShift on Alibaba Cloud. */ - case object AlibabaCloudOpenshift - extends CloudPlatformValue("alibaba_cloud_openshift") - - /** AWS Elastic Compute Cloud. */ - case object AwsEc2 extends CloudPlatformValue("aws_ec2") - - /** AWS Elastic Container Service. */ - case object AwsEcs extends CloudPlatformValue("aws_ecs") - - /** AWS Elastic Kubernetes Service. */ - case object AwsEks extends CloudPlatformValue("aws_eks") - - /** AWS Lambda. */ - case object AwsLambda extends CloudPlatformValue("aws_lambda") - - /** AWS Elastic Beanstalk. */ - case object AwsElasticBeanstalk - extends CloudPlatformValue("aws_elastic_beanstalk") - - /** AWS App Runner. */ - case object AwsAppRunner extends CloudPlatformValue("aws_app_runner") - - /** Red Hat OpenShift on AWS (ROSA). */ - case object AwsOpenshift extends CloudPlatformValue("aws_openshift") - - /** Azure Virtual Machines. */ - case object AzureVm extends CloudPlatformValue("azure_vm") - - /** Azure Container Instances. */ - case object AzureContainerInstances - extends CloudPlatformValue("azure_container_instances") - - /** Azure Kubernetes Service. */ - case object AzureAks extends CloudPlatformValue("azure_aks") - - /** Azure Functions. */ - case object AzureFunctions extends CloudPlatformValue("azure_functions") - - /** Azure App Service. */ - case object AzureAppService extends CloudPlatformValue("azure_app_service") - - /** Azure Red Hat OpenShift. */ - case object AzureOpenshift extends CloudPlatformValue("azure_openshift") - - /** Google Bare Metal Solution (BMS). */ - case object GcpBareMetalSolution - extends CloudPlatformValue("gcp_bare_metal_solution") - - /** Google Cloud Compute Engine (GCE). */ - case object GcpComputeEngine - extends CloudPlatformValue("gcp_compute_engine") - - /** Google Cloud Run. */ - case object GcpCloudRun extends CloudPlatformValue("gcp_cloud_run") - - /** Google Cloud Kubernetes Engine (GKE). */ - case object GcpKubernetesEngine - extends CloudPlatformValue("gcp_kubernetes_engine") - - /** Google Cloud Functions (GCF). */ - case object GcpCloudFunctions - extends CloudPlatformValue("gcp_cloud_functions") - - /** Google Cloud App Engine (GAE). */ - case object GcpAppEngine extends CloudPlatformValue("gcp_app_engine") - - /** Red Hat OpenShift on Google Cloud. */ - case object GcpOpenshift extends CloudPlatformValue("gcp_openshift") - - /** Red Hat OpenShift on IBM Cloud. */ - case object IbmCloudOpenshift - extends CloudPlatformValue("ibm_cloud_openshift") - - /** Tencent Cloud Cloud Virtual Machine (CVM). */ - case object TencentCloudCvm extends CloudPlatformValue("tencent_cloud_cvm") - - /** Tencent Cloud Elastic Kubernetes Service (EKS). */ - case object TencentCloudEks extends CloudPlatformValue("tencent_cloud_eks") - - /** Tencent Cloud Serverless Cloud Function (SCF). */ - case object TencentCloudScf extends CloudPlatformValue("tencent_cloud_scf") - - } - - abstract class CloudProviderValue(val value: String) - object CloudProviderValue { - - /** Alibaba Cloud. */ - case object AlibabaCloud extends CloudProviderValue("alibaba_cloud") - - /** Amazon Web Services. */ - case object Aws extends CloudProviderValue("aws") - - /** Microsoft Azure. */ - case object Azure extends CloudProviderValue("azure") - - /** Google Cloud Platform. */ - case object Gcp extends CloudProviderValue("gcp") - - /** Heroku Platform as a Service. */ - case object Heroku extends CloudProviderValue("heroku") - - /** IBM Cloud. */ - case object IbmCloud extends CloudProviderValue("ibm_cloud") - - /** Tencent Cloud. */ - case object TencentCloud extends CloudProviderValue("tencent_cloud") - - } - - abstract class AwsEcsLaunchtypeValue(val value: String) - object AwsEcsLaunchtypeValue { - - /** ec2. */ - case object Ec2 extends AwsEcsLaunchtypeValue("ec2") - - /** fargate. */ - case object Fargate extends AwsEcsLaunchtypeValue("fargate") - - } - - abstract class HostArchValue(val value: String) - object HostArchValue { - - /** AMD64. */ - case object Amd64 extends HostArchValue("amd64") - - /** ARM32. */ - case object Arm32 extends HostArchValue("arm32") - - /** ARM64. */ - case object Arm64 extends HostArchValue("arm64") - - /** Itanium. */ - case object Ia64 extends HostArchValue("ia64") - - /** 32-bit PowerPC. */ - case object Ppc32 extends HostArchValue("ppc32") - - /** 64-bit PowerPC. */ - case object Ppc64 extends HostArchValue("ppc64") - - /** IBM z/Architecture. */ - case object S390x extends HostArchValue("s390x") - - /** 32-bit x86. */ - case object X86 extends HostArchValue("x86") - - } - - abstract class OsTypeValue(val value: String) - object OsTypeValue { - - /** Microsoft Windows. */ - case object Windows extends OsTypeValue("windows") - - /** Linux. */ - case object Linux extends OsTypeValue("linux") - - /** Apple Darwin. */ - case object Darwin extends OsTypeValue("darwin") - - /** FreeBSD. */ - case object Freebsd extends OsTypeValue("freebsd") - - /** NetBSD. */ - case object Netbsd extends OsTypeValue("netbsd") - - /** OpenBSD. */ - case object Openbsd extends OsTypeValue("openbsd") - - /** DragonFly BSD. */ - case object Dragonflybsd extends OsTypeValue("dragonflybsd") - - /** HP-UX (Hewlett Packard Unix). */ - case object Hpux extends OsTypeValue("hpux") - - /** AIX (Advanced Interactive eXecutive). */ - case object Aix extends OsTypeValue("aix") - - /** SunOS, Oracle Solaris. */ - case object Solaris extends OsTypeValue("solaris") - - /** IBM z/OS. */ - case object ZOs extends OsTypeValue("z_os") - - } - - abstract class TelemetrySdkLanguageValue(val value: String) - object TelemetrySdkLanguageValue { - - /** cpp. */ - case object Cpp extends TelemetrySdkLanguageValue("cpp") - - /** dotnet. */ - case object Dotnet extends TelemetrySdkLanguageValue("dotnet") - - /** erlang. */ - case object Erlang extends TelemetrySdkLanguageValue("erlang") - - /** go. */ - case object Go extends TelemetrySdkLanguageValue("go") - - /** java. */ - case object Java extends TelemetrySdkLanguageValue("java") - - /** nodejs. */ - case object Nodejs extends TelemetrySdkLanguageValue("nodejs") - - /** php. */ - case object Php extends TelemetrySdkLanguageValue("php") - - /** python. */ - case object Python extends TelemetrySdkLanguageValue("python") - - /** ruby. */ - case object Ruby extends TelemetrySdkLanguageValue("ruby") - - /** rust. */ - case object Rust extends TelemetrySdkLanguageValue("rust") - - /** swift. */ - case object Swift extends TelemetrySdkLanguageValue("swift") - - /** webjs. */ - case object Webjs extends TelemetrySdkLanguageValue("webjs") - - /** scala. */ - case object Scala extends TelemetrySdkLanguageValue("scala") - - } - - /** Red Hat OpenShift on Google Cloud. - * @deprecated - * This item has been removed as of 1.18.0 of the semantic conventions. Use - * [[org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes.CloudPlatform.GcpOpenshift ResourceAttributes.CloudPlatform.GcpOpenshift]] - * instead. - */ - @deprecated( - "Use ResourceAttributes.CloudPlatform.GcpOpenshift instead", - "0.3.0" - ) - val GcpOpenshift = string("gcp_openshift") - - /** Full user-agent string provided by the browser - * - *

    Notes: - * - *

    • The user-agent value SHOULD be provided only from browsers that - * do not have a mechanism to retrieve brands and platform individually from - * the User-Agent Client Hints API. To retrieve the value, the legacy - * `navigator.userAgent` API can be used.
    - * @deprecated - * This item has been renamed in 1.19.0 version of the semantic - * conventions. Use - * [[org.typelevel.otel4s.semconv.trace.attributes.SemanticAttributes.UserAgentOriginal]] - * instead. - */ - @deprecated("Use SemanticAttributes.UserAgentOriginal instead", "0.3.0") - val BrowserUserAgent = string("browser.user_agent") - - /** The unique ID of the single function that this runtime instance executes. - * - *

    Notes: - * - *

    • On some cloud providers, it may not be possible to determine the - * full ID at startup, so consider setting `faas.id` as a span attribute - * instead.
    • The exact value to use for `faas.id` depends on the cloud - * provider:
    • AWS Lambda: The function ARN. - * Take care not to use the "invoked ARN" directly but replace any - * alias - * suffix with the resolved function version, as the same runtime - * instance may be invokable with multiple different aliases. - *
    • GCP: The URI of the - * resource
    • Azure: The Fully - * Qualified Resource ID of the invoked function, not the - * function app, having the form - * `/subscriptions//resourceGroups//providers/Microsoft.Web/sites//functions/}`. - * This means that a span attribute MUST be used, as an Azure function app - * can host multiple functions that would usually share a TracerProvider. - *
    - * @deprecated - * This item has been removed in 1.19.0 version of the semantic - * conventions. Use [[ResourceAttributes.CloudResourceId]] instead. - */ - @deprecated("Use ResourceAttributes.CloudResourceId instead", "0.3.0") - val FaasId = string("faas.id") - - /** The version string of the auto instrumentation agent, if used. - * - * @deprecated - * This item has been renamed in 1.22.0 of the semantic conventions. Use - * [[ResourceAttributes.TelemetryDistroVersion]] instead. - */ - @deprecated("Use ResourceAttributes.TelemetryDistroVersion instead", "0.4.0") - val TelemetryAutoVersion = string("telemetry.auto.version") - - /** Container image tag. - * - * @deprecated - * This item has been renamed in 1.22.0 of the semantic conventions. Use - * [[ResourceAttributes.ContainerImageTags]] instead. - */ - @deprecated("Use ResourceAttributes.ContainerImageTags instead", "0.4.0") - val ContainerImageTag = string("container.image.tag") - -} diff --git a/semconv/src/main/scala/org/typelevel/otel4s/semconv/trace/attributes/SemanticAttributes.scala b/semconv/src/main/scala/org/typelevel/otel4s/semconv/trace/attributes/SemanticAttributes.scala deleted file mode 100644 index 3e46b8ad2..000000000 --- a/semconv/src/main/scala/org/typelevel/otel4s/semconv/trace/attributes/SemanticAttributes.scala +++ /dev/null @@ -1,3560 +0,0 @@ -/* - * Copyright 2023 Typelevel - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.typelevel.otel4s.semconv.trace.attributes - -import org.typelevel.otel4s.AttributeKey -import org.typelevel.otel4s.AttributeKey._ - -// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 -object SemanticAttributes { - - /** The URL of the OpenTelemetry schema for these keys and values. - */ - final val SchemaUrl = "https://opentelemetry.io/schemas/1.23.1" - - /** Client address - domain name if available without reverse DNS lookup; - * otherwise, IP address or Unix domain socket name. - * - *

    Notes:

    • When observed from the server side, and when - * communicating through an intermediary, `client.address` SHOULD represent - * the client address behind any intermediaries, for example proxies, if it's - * available.
    - */ - val ClientAddress: AttributeKey[String] = string("client.address") - - /** Client port number. - * - *

    Notes:

    • When observed from the server side, and when - * communicating through an intermediary, `client.port` SHOULD represent the - * client port behind any intermediaries, for example proxies, if it's - * available.
    - */ - val ClientPort: AttributeKey[Long] = long("client.port") - - /** Destination address - domain name if available without reverse DNS lookup; - * otherwise, IP address or Unix domain socket name. - * - *

    Notes:

    • When observed from the source side, and when - * communicating through an intermediary, `destination.address` SHOULD - * represent the destination address behind any intermediaries, for example - * proxies, if it's available.
    - */ - val DestinationAddress: AttributeKey[String] = string("destination.address") - - /** Destination port number - */ - val DestinationPort: AttributeKey[Long] = long("destination.port") - - /** Describes a class of error the operation ended with. - * - *

    Notes:

    • The `error.type` SHOULD be predictable and SHOULD have - * low cardinality. Instrumentations SHOULD document the list of errors they - * report.
    • The cardinality of `error.type` within one instrumentation - * library SHOULD be low. Telemetry consumers that aggregate data from - * multiple instrumentation libraries and applications should be prepared for - * `error.type` to have high cardinality at query time when no additional - * filters are applied.
    • If the operation has completed successfully, - * instrumentations SHOULD NOT set `error.type`.
    • If a specific domain - * defines its own set of error identifiers (such as HTTP or gRPC status - * codes), it's RECOMMENDED to:
    • Use a domain-specific attribute
    • - *
    • Set `error.type` to capture all errors, regardless of whether they are - * defined within the domain-specific set or not.
    - */ - val ErrorType: AttributeKey[String] = string("error.type") - - /** The exception message. - */ - val ExceptionMessage: AttributeKey[String] = string("exception.message") - - /** 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. - */ - val ExceptionStacktrace: AttributeKey[String] = string("exception.stacktrace") - - /** The type of the exception (its fully-qualified class name, if applicable). - * The dynamic type of the exception should be preferred over the static type - * in languages that support it. - */ - val ExceptionType: AttributeKey[String] = string("exception.type") - - /** The name of the invoked function. - * - *

    Notes:

    • SHOULD be equal to the `faas.name` resource attribute - * of the invoked function.
    - */ - val FaasInvokedName: AttributeKey[String] = string("faas.invoked_name") - - /** The cloud provider of the invoked function. - * - *

    Notes:

    • SHOULD be equal to the `cloud.provider` resource - * attribute of the invoked function.
    - */ - val FaasInvokedProvider: AttributeKey[String] = string( - "faas.invoked_provider" - ) - - /** The cloud region of the invoked function. - * - *

    Notes:

    • SHOULD be equal to the `cloud.region` resource - * attribute of the invoked function.
    - */ - val FaasInvokedRegion: AttributeKey[String] = string("faas.invoked_region") - - /** Type of the trigger which caused this function invocation. - */ - val FaasTrigger: AttributeKey[String] = string("faas.trigger") - - /** The `service.name` of the - * remote service. SHOULD be equal to the actual `service.name` resource - * attribute of the remote service if any. - */ - val PeerService: AttributeKey[String] = string("peer.service") - - /** Username or client_id extracted from the access token or Authorization - * header in the inbound request from outside the system. - */ - val EnduserId: AttributeKey[String] = string("enduser.id") - - /** Actual/assumed role the client is making the request under extracted from - * token or application security context. - */ - val EnduserRole: AttributeKey[String] = string("enduser.role") - - /** Scopes or granted authorities the client currently possesses extracted - * from token or application security context. The value would come from the - * scope associated with an OAuth 2.0 Access - * Token or an attribute value in a SAML - * 2.0 Assertion. - */ - val EnduserScope: AttributeKey[String] = string("enduser.scope") - - /** The domain identifies the business context for the events. - * - *

    Notes:

    • Events across different domains may have same - * `event.name`, yet be unrelated events.
    - */ - val EventDomain: AttributeKey[String] = string("event.domain") - - /** The name identifies the event. - */ - val EventName: AttributeKey[String] = string("event.name") - - /** A unique identifier for the Log Record. - * - *

    Notes:

    • If an id is provided, other log records with the same - * id will be considered duplicates and can be removed safely. This means, - * that two distinguishable log records MUST have different values. The id - * MAY be an Universally Unique - * Lexicographically Sortable Identifier (ULID), but other identifiers - * (e.g. UUID) may be used as needed.
    - */ - val LogRecordUid: AttributeKey[String] = string("log.record.uid") - - /** The stream associated with the log. See below for a list of well-known - * values. - */ - val LogIostream: AttributeKey[String] = string("log.iostream") - - /** The basename of the file. - */ - val LogFileName: AttributeKey[String] = string("log.file.name") - - /** The basename of the file, with symlinks resolved. - */ - val LogFileNameResolved: AttributeKey[String] = string( - "log.file.name_resolved" - ) - - /** The full path to the file. - */ - val LogFilePath: AttributeKey[String] = string("log.file.path") - - /** The full path to the file, with symlinks resolved. - */ - val LogFilePathResolved: AttributeKey[String] = string( - "log.file.path_resolved" - ) - - /** This attribute represents the state the application has transitioned into - * at the occurrence of the event. - * - *

    Notes:

    - */ - val IosState: AttributeKey[String] = string("ios.state") - - /** This attribute represents the state the application has transitioned into - * at the occurrence of the event. - * - *

    Notes:

    - */ - val AndroidState: AttributeKey[String] = string("android.state") - - /** The name of the connection pool; unique within the instrumented - * application. In case the connection pool implementation doesn't provide a - * name, then the db.connection_string - * should be used - */ - val PoolName: AttributeKey[String] = string("pool.name") - - /** The state of a connection in the pool - */ - val State: AttributeKey[String] = string("state") - - /** Name of the buffer pool. - * - *

    Notes:

    - */ - val JvmBufferPoolName: AttributeKey[String] = string("jvm.buffer.pool.name") - - /** Name of the memory pool. - * - *

    Notes:

    - */ - val JvmMemoryPoolName: AttributeKey[String] = string("jvm.memory.pool.name") - - /** The type of memory. - */ - val JvmMemoryType: AttributeKey[String] = string("jvm.memory.type") - - /** The device identifier - */ - val SystemDevice: AttributeKey[String] = string("system.device") - - /** The logical CPU number [0..n-1] - */ - val SystemCpuLogicalNumber: AttributeKey[Long] = long( - "system.cpu.logical_number" - ) - - /** The state of the CPU - */ - val SystemCpuState: AttributeKey[String] = string("system.cpu.state") - - /** The memory state - */ - val SystemMemoryState: AttributeKey[String] = string("system.memory.state") - - /** The paging access direction - */ - val SystemPagingDirection: AttributeKey[String] = string( - "system.paging.direction" - ) - - /** The memory paging state - */ - val SystemPagingState: AttributeKey[String] = string("system.paging.state") - - /** The memory paging type - */ - val SystemPagingType: AttributeKey[String] = string("system.paging.type") - - /** The disk operation direction - */ - val SystemDiskDirection: AttributeKey[String] = string( - "system.disk.direction" - ) - - /** The filesystem mode - */ - val SystemFilesystemMode: AttributeKey[String] = string( - "system.filesystem.mode" - ) - - /** The filesystem mount path - */ - val SystemFilesystemMountpoint: AttributeKey[String] = string( - "system.filesystem.mountpoint" - ) - - /** The filesystem state - */ - val SystemFilesystemState: AttributeKey[String] = string( - "system.filesystem.state" - ) - - /** The filesystem type - */ - val SystemFilesystemType: AttributeKey[String] = string( - "system.filesystem.type" - ) - - /** */ - val SystemNetworkDirection: AttributeKey[String] = string( - "system.network.direction" - ) - - /** A stateless protocol MUST NOT set this attribute - */ - val SystemNetworkState: AttributeKey[String] = string("system.network.state") - - /** The process state, e.g., Linux - * Process State Codes - */ - val SystemProcessesStatus: AttributeKey[String] = string( - "system.processes.status" - ) - - /** The column number in `code.filepath` best representing the operation. It - * SHOULD point within the code unit named in `code.function`. - */ - val CodeColumn: AttributeKey[Long] = long("code.column") - - /** The source code file name that identifies the code unit as uniquely as - * possible (preferably an absolute file path). - */ - val CodeFilepath: AttributeKey[String] = string("code.filepath") - - /** The method or function name, or equivalent (usually rightmost part of the - * code unit's name). - */ - val CodeFunction: AttributeKey[String] = string("code.function") - - /** The line number in `code.filepath` best representing the operation. It - * SHOULD point within the code unit named in `code.function`. - */ - val CodeLineno: AttributeKey[Long] = long("code.lineno") - - /** The "namespace" within which `code.function` is defined. Usually - * the qualified class or module name, such that `code.namespace` + some - * separator + `code.function` form a unique identifier for the code unit. - */ - val CodeNamespace: AttributeKey[String] = string("code.namespace") - - /** Deprecated, use `http.request.method` instead. - */ - @deprecated("Use `http.request.method` instead", "0.3.0") - val HttpMethod: AttributeKey[String] = string("http.method") - - /** Deprecated, use `http.request.header.content-length` instead. - */ - @deprecated("Use `http.request.header.content-length` instead", "0.3.0") - val HttpRequestContentLength: AttributeKey[Long] = long( - "http.request_content_length" - ) - - /** Deprecated, use `http.response.header.content-length` instead. - */ - @deprecated("Use `http.response.header.content-length` instead", "0.3.0") - val HttpResponseContentLength: AttributeKey[Long] = long( - "http.response_content_length" - ) - - /** Deprecated, use `url.scheme` instead. - */ - @deprecated("Use `url.scheme` instead", "0.3.0") - val HttpScheme: AttributeKey[String] = string("http.scheme") - - /** Deprecated, use `http.response.status_code` instead. - */ - @deprecated("Use `http.response.status_code` instead", "0.3.0") - val HttpStatusCode: AttributeKey[Long] = long("http.status_code") - - /** Deprecated, use `url.path` and `url.query` instead. - */ - @deprecated("Use `url.path` and `url.query` instead", "0.3.0") - val HttpTarget: AttributeKey[String] = string("http.target") - - /** Deprecated, use `url.full` instead. - */ - @deprecated("Use `url.full` instead", "0.3.0") - val HttpUrl: AttributeKey[String] = string("http.url") - - /** Deprecated, use `server.address`. - */ - @deprecated("Use `server.address`", "0.3.0") - val NetHostName: AttributeKey[String] = string("net.host.name") - - /** Deprecated, use `server.port`. - */ - @deprecated("Use `server.port`", "0.3.0") - val NetHostPort: AttributeKey[Long] = long("net.host.port") - - /** Deprecated, use `server.address` on client spans and `client.address` on - * server spans. - */ - @deprecated( - "Use `server.address` on client spans and `client.address` on server spans", - "0.3.0" - ) - val NetPeerName: AttributeKey[String] = string("net.peer.name") - - /** Deprecated, use `server.port` on client spans and `client.port` on server - * spans. - */ - @deprecated( - "Use `server.port` on client spans and `client.port` on server spans", - "0.3.0" - ) - val NetPeerPort: AttributeKey[Long] = long("net.peer.port") - - /** Deprecated, use `network.protocol.name`. - */ - @deprecated("Use `network.protocol.name`", "0.3.0") - val NetProtocolName: AttributeKey[String] = string("net.protocol.name") - - /** Deprecated, use `network.protocol.version`. - */ - @deprecated("Use `network.protocol.version`", "0.3.0") - val NetProtocolVersion: AttributeKey[String] = string("net.protocol.version") - - /** Deprecated, use `network.transport` and `network.type`. - */ - @deprecated("Use `network.transport` and `network.type`", "0.3.0") - val NetSockFamily: AttributeKey[String] = string("net.sock.family") - - /** Deprecated, use `network.local.address`. - */ - @deprecated("Use `network.local.address`", "0.3.0") - val NetSockHostAddr: AttributeKey[String] = string("net.sock.host.addr") - - /** Deprecated, use `network.local.port`. - */ - @deprecated("Use `network.local.port`", "0.3.0") - val NetSockHostPort: AttributeKey[Long] = long("net.sock.host.port") - - /** Deprecated, use `network.peer.address`. - */ - @deprecated("Use `network.peer.address`", "0.3.0") - val NetSockPeerAddr: AttributeKey[String] = string("net.sock.peer.addr") - - /** Deprecated, no replacement at this time. - */ - @deprecated("No replacement at this time", "0.3.0") - val NetSockPeerName: AttributeKey[String] = string("net.sock.peer.name") - - /** Deprecated, use `network.peer.port`. - */ - @deprecated("Use `network.peer.port`", "0.3.0") - val NetSockPeerPort: AttributeKey[Long] = long("net.sock.peer.port") - - /** Deprecated, use `network.transport`. - */ - @deprecated("Use `network.transport`", "0.3.0") - val NetTransport: AttributeKey[String] = string("net.transport") - - /** The size of the request payload body in bytes. This is the number of bytes - * transferred excluding headers and is often, but not always, present as the - * Content-Length - * header. For requests using transport encoding, this should be the - * compressed size. - */ - val HttpRequestBodySize: AttributeKey[Long] = long("http.request.body.size") - - /** HTTP request method. - * - *

    Notes:

    • HTTP request method value SHOULD be "known" - * to the instrumentation. By default, this convention defines - * "known" methods as the ones listed in RFC9110 - * and the PATCH method defined in RFC5789.
    • If - * the HTTP request method is not known to instrumentation, it MUST set the - * `http.request.method` attribute to `_OTHER`.
    • If the HTTP - * instrumentation could end up converting valid HTTP request methods to - * `_OTHER`, then it MUST provide a way to override the list of known HTTP - * methods. If this override is done via environment variable, then the - * environment variable MUST be named OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS - * and support a comma-separated list of case-sensitive known HTTP methods - * (this list MUST be a full override of the default known method, it is not - * a list of known methods in addition to the defaults).
    • HTTP method - * names are case-sensitive and `http.request.method` attribute value MUST - * match a known HTTP method name exactly. Instrumentations for specific web - * frameworks that consider HTTP methods to be case insensitive, SHOULD - * populate a canonical equivalent. Tracing instrumentations that do so, MUST - * also set `http.request.method_original` to the original value.
    - */ - val HttpRequestMethod: AttributeKey[String] = string("http.request.method") - - /** Original HTTP method sent by the client in the request line. - */ - val HttpRequestMethodOriginal: AttributeKey[String] = string( - "http.request.method_original" - ) - - /** The ordinal number of request resending attempt (for any reason, including - * redirects). - * - *

    Notes:

    • The resend count SHOULD be updated each time an HTTP - * request gets resent by the client, regardless of what was the cause of the - * resending (e.g. redirection, authorization failure, 503 Server - * Unavailable, network issues, or any other).
    - */ - val HttpRequestResendCount: AttributeKey[Long] = long( - "http.request.resend_count" - ) - - /** The size of the response payload body in bytes. This is the number of - * bytes transferred excluding headers and is often, but not always, present - * as the Content-Length - * header. For requests using transport encoding, this should be the - * compressed size. - */ - val HttpResponseBodySize: AttributeKey[Long] = long("http.response.body.size") - - /** HTTP response - * status code. - */ - val HttpResponseStatusCode: AttributeKey[Long] = long( - "http.response.status_code" - ) - - /** The matched route, that is, the path template in the format used by the - * respective server framework. - * - *

    Notes:

    • MUST NOT be populated when this is not supported by the - * HTTP server framework as the route attribute should have low-cardinality - * and the URI path can NOT substitute it. SHOULD include the application - * root if there is one.
    - */ - val HttpRoute: AttributeKey[String] = string("http.route") - - /** The number of messages sent, received, or processed in the scope of the - * batching operation. - * - *

    Notes:

    • Instrumentations SHOULD NOT set - * `messaging.batch.message_count` on spans that operate with a single - * message. When a messaging client library supports both batch and - * single-message API for the same operation, instrumentations SHOULD use - * `messaging.batch.message_count` for batching APIs and SHOULD NOT use it - * for single-message APIs.
    - */ - val MessagingBatchMessageCount: AttributeKey[Long] = long( - "messaging.batch.message_count" - ) - - /** A unique identifier for the client that consumes or produces a message. - */ - val MessagingClientId: AttributeKey[String] = string("messaging.client_id") - - /** A boolean that is true if the message destination is anonymous (could be - * unnamed or have auto-generated name). - */ - val MessagingDestinationAnonymous: AttributeKey[Boolean] = boolean( - "messaging.destination.anonymous" - ) - - /** The message destination name - * - *

    Notes:

    • Destination name SHOULD uniquely identify a specific - * queue, topic or other entity within the broker. If the broker doesn't have - * such notion, the destination name SHOULD uniquely identify the - * broker.
    - */ - val MessagingDestinationName: AttributeKey[String] = string( - "messaging.destination.name" - ) - - /** Low cardinality representation of the messaging destination name - * - *

    Notes:

    • Destination names could be constructed from templates. - * An example would be a destination name involving a user name or product - * id. Although the destination name in this case is of high cardinality, the - * underlying template is of low cardinality and can be effectively used for - * grouping and aggregation.
    - */ - val MessagingDestinationTemplate: AttributeKey[String] = string( - "messaging.destination.template" - ) - - /** A boolean that is true if the message destination is temporary and might - * not exist anymore after messages are processed. - */ - val MessagingDestinationTemporary: AttributeKey[Boolean] = boolean( - "messaging.destination.temporary" - ) - - /** A boolean that is true if the publish message destination is anonymous - * (could be unnamed or have auto-generated name). - */ - val MessagingDestinationPublishAnonymous: AttributeKey[Boolean] = boolean( - "messaging.destination_publish.anonymous" - ) - - /** The name of the original destination the message was published to - * - *

    Notes:

    • The name SHOULD uniquely identify a specific queue, - * topic, or other entity within the broker. If the broker doesn't have such - * notion, the original destination name SHOULD uniquely identify the - * broker.
    - */ - val MessagingDestinationPublishName: AttributeKey[String] = string( - "messaging.destination_publish.name" - ) - - /** Name of the Kafka Consumer Group that is handling the message. Only - * applies to consumers, not producers. - */ - val MessagingKafkaConsumerGroup: AttributeKey[String] = string( - "messaging.kafka.consumer.group" - ) - - /** Partition the message is sent to. - */ - val MessagingKafkaDestinationPartition: AttributeKey[Long] = long( - "messaging.kafka.destination.partition" - ) - - /** Message keys in Kafka are used for grouping alike messages to ensure - * they're processed on the same partition. They differ from - * `messaging.message.id` in that they're not unique. If the key is `null`, - * the attribute MUST NOT be set. - * - *

    Notes:

    • If the key type is not string, it's string - * representation has to be supplied for the attribute. If the key has no - * unambiguous, canonical string form, don't include its value.
    - */ - val MessagingKafkaMessageKey: AttributeKey[String] = string( - "messaging.kafka.message.key" - ) - - /** The offset of a record in the corresponding Kafka partition. - */ - val MessagingKafkaMessageOffset: AttributeKey[Long] = long( - "messaging.kafka.message.offset" - ) - - /** A boolean that is true if the message is a tombstone. - */ - val MessagingKafkaMessageTombstone: AttributeKey[Boolean] = boolean( - "messaging.kafka.message.tombstone" - ) - - /** The size of the message body in bytes. - * - *

    Notes:

    • This can refer to both the compressed or uncompressed - * body size. If both sizes are known, the uncompressed body size should be - * used.
    - */ - val MessagingMessageBodySize: AttributeKey[Long] = long( - "messaging.message.body.size" - ) - - /** The conversation ID identifying the conversation to which the message - * belongs, represented as a string. Sometimes called "Correlation - * ID". - */ - val MessagingMessageConversationId: AttributeKey[String] = string( - "messaging.message.conversation_id" - ) - - /** The size of the message body and metadata in bytes. - * - *

    Notes:

    • This can refer to both the compressed or uncompressed - * size. If both sizes are known, the uncompressed size should be used.
    • - *
    - */ - val MessagingMessageEnvelopeSize: AttributeKey[Long] = long( - "messaging.message.envelope.size" - ) - - /** A value used by the messaging system as an identifier for the message, - * represented as a string. - */ - val MessagingMessageId: AttributeKey[String] = string("messaging.message.id") - - /** A string identifying the kind of messaging operation. - * - *

    Notes:

    • If a custom value is used, it MUST be of low - * cardinality.
    - */ - val MessagingOperation: AttributeKey[String] = string("messaging.operation") - - /** RabbitMQ message routing key. - */ - val MessagingRabbitmqDestinationRoutingKey: AttributeKey[String] = string( - "messaging.rabbitmq.destination.routing_key" - ) - - /** Name of the RocketMQ producer/consumer group that is handling the message. - * The client type is identified by the SpanKind. - */ - val MessagingRocketmqClientGroup: AttributeKey[String] = string( - "messaging.rocketmq.client_group" - ) - - /** Model of message consumption. This only applies to consumer spans. - */ - val MessagingRocketmqConsumptionModel: AttributeKey[String] = string( - "messaging.rocketmq.consumption_model" - ) - - /** The delay time level for delay message, which determines the message delay - * time. - */ - val MessagingRocketmqMessageDelayTimeLevel: AttributeKey[Long] = long( - "messaging.rocketmq.message.delay_time_level" - ) - - /** The timestamp in milliseconds that the delay message is expected to be - * delivered to consumer. - */ - val MessagingRocketmqMessageDeliveryTimestamp: AttributeKey[Long] = long( - "messaging.rocketmq.message.delivery_timestamp" - ) - - /** It is essential for FIFO message. Messages that belong to the same message - * group are always processed one by one within the same consumer group. - */ - val MessagingRocketmqMessageGroup: AttributeKey[String] = string( - "messaging.rocketmq.message.group" - ) - - /** Key(s) of message, another way to mark message besides message id. - */ - val MessagingRocketmqMessageKeys: AttributeKey[Seq[String]] = stringSeq( - "messaging.rocketmq.message.keys" - ) - - /** The secondary classifier of message besides topic. - */ - val MessagingRocketmqMessageTag: AttributeKey[String] = string( - "messaging.rocketmq.message.tag" - ) - - /** Type of message. - */ - val MessagingRocketmqMessageType: AttributeKey[String] = string( - "messaging.rocketmq.message.type" - ) - - /** Namespace of RocketMQ resources, resources in different namespaces are - * individual. - */ - val MessagingRocketmqNamespace: AttributeKey[String] = string( - "messaging.rocketmq.namespace" - ) - - /** A string identifying the messaging system. - */ - val MessagingSystem: AttributeKey[String] = string("messaging.system") - - /** The ISO 3166-1 alpha-2 2-character country code associated with the mobile - * carrier network. - */ - val NetworkCarrierIcc: AttributeKey[String] = string("network.carrier.icc") - - /** The mobile carrier country code. - */ - val NetworkCarrierMcc: AttributeKey[String] = string("network.carrier.mcc") - - /** The mobile carrier network code. - */ - val NetworkCarrierMnc: AttributeKey[String] = string("network.carrier.mnc") - - /** The name of the mobile carrier. - */ - val NetworkCarrierName: AttributeKey[String] = string("network.carrier.name") - - /** This describes more details regarding the connection.type. It may be the - * type of cell technology connection, but it could be used for describing - * details about a wifi connection. - */ - val NetworkConnectionSubtype: AttributeKey[String] = string( - "network.connection.subtype" - ) - - /** The internet connection type. - */ - val NetworkConnectionType: AttributeKey[String] = string( - "network.connection.type" - ) - - /** Local address of the network connection - IP address or Unix domain socket - * name. - */ - val NetworkLocalAddress: AttributeKey[String] = string( - "network.local.address" - ) - - /** Local port number of the network connection. - */ - val NetworkLocalPort: AttributeKey[Long] = long("network.local.port") - - /** Peer address of the network connection - IP address or Unix domain socket - * name. - */ - val NetworkPeerAddress: AttributeKey[String] = string("network.peer.address") - - /** Peer port number of the network connection. - */ - val NetworkPeerPort: AttributeKey[Long] = long("network.peer.port") - - /** OSI application - * layer or non-OSI equivalent. - * - *

    Notes:

    • The value SHOULD be normalized to lowercase.
    - */ - val NetworkProtocolName: AttributeKey[String] = string( - "network.protocol.name" - ) - - /** Version of the protocol specified in `network.protocol.name`. - * - *

    Notes:

    • `network.protocol.version` refers to the version of the - * protocol used and might be different from the protocol client's version. - * If the HTTP client has a version of `0.27.2`, but sends HTTP version - * `1.1`, this attribute should be set to `1.1`.
    - */ - val NetworkProtocolVersion: AttributeKey[String] = string( - "network.protocol.version" - ) - - /** OSI transport layer - * or inter-process - * communication method. - * - *

    Notes:

    • The value SHOULD be normalized to - * lowercase.
    • Consider always setting the transport when setting a - * port number, since a port number is ambiguous without knowing the - * transport. For example different processes could be listening on TCP port - * 12345 and UDP port 12345.
    - */ - val NetworkTransport: AttributeKey[String] = string("network.transport") - - /** OSI network layer or - * non-OSI equivalent. - * - *

    Notes:

    • The value SHOULD be normalized to lowercase.
    - */ - val NetworkType: AttributeKey[String] = string("network.type") - - /** The error - * codes of the Connect request. Error codes are always string values. - */ - val RpcConnectRpcErrorCode: AttributeKey[String] = string( - "rpc.connect_rpc.error_code" - ) - - /** The numeric - * status code of the gRPC request. - */ - val RpcGrpcStatusCode: AttributeKey[Long] = long("rpc.grpc.status_code") - - /** `error.code` property of response if it is an error response. - */ - val RpcJsonrpcErrorCode: AttributeKey[Long] = long("rpc.jsonrpc.error_code") - - /** `error.message` property of response if it is an error response. - */ - val RpcJsonrpcErrorMessage: AttributeKey[String] = string( - "rpc.jsonrpc.error_message" - ) - - /** `id` property of request or response. Since protocol allows id to be int, - * string, `null` or missing (for notifications), value is expected to be - * cast to string for simplicity. Use empty string in case of `null` value. - * Omit entirely if this is a notification. - */ - val RpcJsonrpcRequestId: AttributeKey[String] = string( - "rpc.jsonrpc.request_id" - ) - - /** Protocol version as in `jsonrpc` property of request/response. Since - * JSON-RPC 1.0 doesn't specify this, the value can be omitted. - */ - val RpcJsonrpcVersion: AttributeKey[String] = string("rpc.jsonrpc.version") - - /** The name of the (logical) method being called, must be equal to the method - * part in the span name. - * - *

    Notes:

    • This is the logical name of the method from the RPC - * interface perspective, which can be different from the name of any - * implementing method/function. The `code.function` attribute may be used to - * store the latter (e.g., method actually executing the call on the server - * side, RPC client stub method on the client side).
    - */ - val RpcMethod: AttributeKey[String] = string("rpc.method") - - /** The full (logical) name of the service being called, including its package - * name, if applicable. - * - *

    Notes:

    • This is the logical name of the service from the RPC - * interface perspective, which can be different from the name of any - * implementing class. The `code.namespace` attribute may be used to store - * the latter (despite the attribute name, it may include a class name; e.g., - * class with method actually executing the call on the server side, RPC - * client stub class on the client side).
    - */ - val RpcService: AttributeKey[String] = string("rpc.service") - - /** A string identifying the remoting system. See below for a list of - * well-known identifiers. - */ - val RpcSystem: AttributeKey[String] = string("rpc.system") - - /** Current "managed" thread ID (as opposed to OS thread ID). - */ - val ThreadId: AttributeKey[Long] = long("thread.id") - - /** Current thread name. - */ - val ThreadName: AttributeKey[String] = string("thread.name") - - /** The URI - * fragment component - */ - val UrlFragment: AttributeKey[String] = string("url.fragment") - - /** Absolute URL describing a network resource according to RFC3986 - * - *

    Notes:

    • For network calls, URL usually has - * `scheme://host[:port][path][?query][#fragment]` format, where the fragment - * is not transmitted over HTTP, but if it is known, it SHOULD be included - * nevertheless. `url.full` MUST NOT contain credentials passed via URL in - * form of `https://username:password@www.example.com/`. In such case - * username and password SHOULD be redacted and attribute's value SHOULD be - * `https://REDACTED:REDACTED@www.example.com/`. `url.full` SHOULD capture - * the absolute URL when it is available (or can be reconstructed) and SHOULD - * NOT be validated or modified except for sanitizing purposes.
    - */ - val UrlFull: AttributeKey[String] = string("url.full") - - /** The URI - * path component - */ - val UrlPath: AttributeKey[String] = string("url.path") - - /** The URI - * query component - * - *

    Notes:

    • Sensitive content provided in query string SHOULD be - * scrubbed when instrumentations can identify it.
    - */ - val UrlQuery: AttributeKey[String] = string("url.query") - - /** The URI - * scheme component identifying the used protocol. - */ - val UrlScheme: AttributeKey[String] = string("url.scheme") - - /** Value of the HTTP - * User-Agent header sent by the client. - */ - val UserAgentOriginal: AttributeKey[String] = string("user_agent.original") - - /** Server domain name if available without reverse DNS lookup; otherwise, IP - * address or Unix domain socket name. - * - *

    Notes:

    • When observed from the client side, and when - * communicating through an intermediary, `server.address` SHOULD represent - * the server address behind any intermediaries, for example proxies, if it's - * available.
    - */ - val ServerAddress: AttributeKey[String] = string("server.address") - - /** Server port number. - * - *

    Notes:

    • When observed from the client side, and when - * communicating through an intermediary, `server.port` SHOULD represent the - * server port behind any intermediaries, for example proxies, if it's - * available.
    - */ - val ServerPort: AttributeKey[Long] = long("server.port") - - /** A unique id to identify a session. - */ - val SessionId: AttributeKey[String] = string("session.id") - - /** The previous `session.id` for this user, when known. - */ - val SessionPreviousId: AttributeKey[String] = string("session.previous_id") - - /** Source address - domain name if available without reverse DNS lookup; - * otherwise, IP address or Unix domain socket name. - * - *

    Notes:

    • When observed from the destination side, and when - * communicating through an intermediary, `source.address` SHOULD represent - * the source address behind any intermediaries, for example proxies, if it's - * available.
    - */ - val SourceAddress: AttributeKey[String] = string("source.address") - - /** Source port number - */ - val SourcePort: AttributeKey[Long] = long("source.port") - - /** The full invoked ARN as provided on the `Context` passed to the function - * (`Lambda-Runtime-Invoked-Function-Arn` header on the - * `/runtime/invocation/next` applicable). - * - *

    Notes:

    • This may be different from `cloud.resource_id` if an - * alias is involved.
    - */ - val AwsLambdaInvokedArn: AttributeKey[String] = string( - "aws.lambda.invoked_arn" - ) - - /** The event_id - * uniquely identifies the event. - */ - val CloudeventsEventId: AttributeKey[String] = string("cloudevents.event_id") - - /** The source - * identifies the context in which an event happened. - */ - val CloudeventsEventSource: AttributeKey[String] = string( - "cloudevents.event_source" - ) - - /** The version - * of the CloudEvents specification which the event uses. - */ - val CloudeventsEventSpecVersion: AttributeKey[String] = string( - "cloudevents.event_spec_version" - ) - - /** The subject - * of the event in the context of the event producer (identified by source). - */ - val CloudeventsEventSubject: AttributeKey[String] = string( - "cloudevents.event_subject" - ) - - /** The event_type - * contains a value describing the type of event related to the originating - * occurrence. - */ - val CloudeventsEventType: AttributeKey[String] = string( - "cloudevents.event_type" - ) - - /** Parent-child Reference type - * - *

    Notes:

    • The causal relationship between a child Span and a - * parent Span.
    - */ - val OpentracingRefType: AttributeKey[String] = string("opentracing.ref_type") - - /** The connection string used to connect to the database. It is recommended - * to remove embedded credentials. - */ - val DbConnectionString: AttributeKey[String] = string("db.connection_string") - - /** The fully-qualified class name of the Java - * Database Connectivity (JDBC) driver used to connect. - */ - val DbJdbcDriverClassname: AttributeKey[String] = string( - "db.jdbc.driver_classname" - ) - - /** This attribute is used to report the name of the database being accessed. - * For commands that switch the database, this should be set to the target - * database (even if the command fails). - * - *

    Notes:

    • In some SQL databases, the database name to be used is - * called "schema name". In case there are multiple layers that - * could be considered for database name (e.g. Oracle instance name and - * schema name), the database name to be used is the more specific layer - * (e.g. Oracle schema name).
    - */ - val DbName: AttributeKey[String] = string("db.name") - - /** The name of the operation being executed, e.g. the MongoDB - * command name such as `findAndModify`, or the SQL keyword. - * - *

    Notes:

    • When setting this to an SQL keyword, it is not - * recommended to attempt any client-side parsing of `db.statement` just to - * get this property, but it should be set if the operation name is provided - * by the library being instrumented. If the SQL statement has an ambiguous - * operation, or performs more than one operation, this value may be - * omitted.
    - */ - val DbOperation: AttributeKey[String] = string("db.operation") - - /** The database statement being executed. - */ - val DbStatement: AttributeKey[String] = string("db.statement") - - /** An identifier for the database management system (DBMS) product being - * used. See below for a list of well-known identifiers. - */ - val DbSystem: AttributeKey[String] = string("db.system") - - /** Username for accessing the database. - */ - val DbUser: AttributeKey[String] = string("db.user") - - /** The Microsoft SQL Server instance - * name connecting to. This name is used to determine the port of a named - * instance. - * - *

    Notes:

    • If setting a `db.mssql.instance_name`, `server.port` is - * no longer required (but still recommended if non-standard).
    - */ - val DbMssqlInstanceName: AttributeKey[String] = string( - "db.mssql.instance_name" - ) - - /** The consistency level of the query. Based on consistency values from CQL. - */ - val DbCassandraConsistencyLevel: AttributeKey[String] = string( - "db.cassandra.consistency_level" - ) - - /** The data center of the coordinating node for a query. - */ - val DbCassandraCoordinatorDc: AttributeKey[String] = string( - "db.cassandra.coordinator.dc" - ) - - /** The ID of the coordinating node for a query. - */ - val DbCassandraCoordinatorId: AttributeKey[String] = string( - "db.cassandra.coordinator.id" - ) - - /** Whether or not the query is idempotent. - */ - val DbCassandraIdempotence: AttributeKey[Boolean] = boolean( - "db.cassandra.idempotence" - ) - - /** The fetch size used for paging, i.e. how many rows will be returned at - * once. - */ - val DbCassandraPageSize: AttributeKey[Long] = long("db.cassandra.page_size") - - /** The number of times a query was speculatively executed. Not set or `0` if - * the query was not executed speculatively. - */ - val DbCassandraSpeculativeExecutionCount: AttributeKey[Long] = long( - "db.cassandra.speculative_execution_count" - ) - - /** The name of the primary table that the operation is acting upon, including - * the keyspace name (if applicable). - * - *

    Notes:

    • This mirrors the db.sql.table attribute but references - * cassandra rather than sql. It is not recommended to attempt any - * client-side parsing of `db.statement` just to get this property, but it - * should be set if it is provided by the library being instrumented. If the - * operation is acting upon an anonymous table, or more than one table, this - * value MUST NOT be set.
    - */ - val DbCassandraTable: AttributeKey[String] = string("db.cassandra.table") - - /** The index of the database being accessed as used in the `SELECT` command, provided as - * an integer. To be used instead of the generic `db.name` attribute. - */ - val DbRedisDatabaseIndex: AttributeKey[Long] = long("db.redis.database_index") - - /** The collection being accessed within the database stated in `db.name`. - */ - val DbMongodbCollection: AttributeKey[String] = string( - "db.mongodb.collection" - ) - - /** Represents the identifier of an Elasticsearch cluster. - */ - val DbElasticsearchClusterName: AttributeKey[String] = string( - "db.elasticsearch.cluster.name" - ) - - /** Represents the human-readable identifier of the node/instance to which a - * request was routed. - */ - val DbElasticsearchNodeName: AttributeKey[String] = string( - "db.elasticsearch.node.name" - ) - - /** The name of the primary table that the operation is acting upon, including - * the database name (if applicable). - * - *

    Notes:

    • It is not recommended to attempt any client-side - * parsing of `db.statement` just to get this property, but it should be set - * if it is provided by the library being instrumented. If the operation is - * acting upon an anonymous table, or more than one table, this value MUST - * NOT be set.
    - */ - val DbSqlTable: AttributeKey[String] = string("db.sql.table") - - /** Unique Cosmos client instance id. - */ - val DbCosmosdbClientId: AttributeKey[String] = string("db.cosmosdb.client_id") - - /** Cosmos client connection mode. - */ - val DbCosmosdbConnectionMode: AttributeKey[String] = string( - "db.cosmosdb.connection_mode" - ) - - /** Cosmos DB container name. - */ - val DbCosmosdbContainer: AttributeKey[String] = string( - "db.cosmosdb.container" - ) - - /** CosmosDB Operation Type. - */ - val DbCosmosdbOperationType: AttributeKey[String] = string( - "db.cosmosdb.operation_type" - ) - - /** RU consumed for that operation - */ - val DbCosmosdbRequestCharge: AttributeKey[Double] = double( - "db.cosmosdb.request_charge" - ) - - /** Request payload size in bytes - */ - val DbCosmosdbRequestContentLength: AttributeKey[Long] = long( - "db.cosmosdb.request_content_length" - ) - - /** Cosmos DB status code. - */ - val DbCosmosdbStatusCode: AttributeKey[Long] = long("db.cosmosdb.status_code") - - /** Cosmos DB sub status code. - */ - val DbCosmosdbSubStatusCode: AttributeKey[Long] = long( - "db.cosmosdb.sub_status_code" - ) - - /** Name of the code, either "OK" or "ERROR". MUST NOT be - * set if the status code is UNSET. - */ - val OtelStatusCode: AttributeKey[String] = string("otel.status_code") - - /** Description of the Status if it has a value, otherwise not set. - */ - val OtelStatusDescription: AttributeKey[String] = string( - "otel.status_description" - ) - - /** The invocation ID of the current function invocation. - */ - val FaasInvocationId: AttributeKey[String] = string("faas.invocation_id") - - /** The name of the source on which the triggering operation was performed. - * For example, in Cloud Storage or S3 corresponds to the bucket name, and in - * Cosmos DB to the database name. - */ - val FaasDocumentCollection: AttributeKey[String] = string( - "faas.document.collection" - ) - - /** The document name/table subjected to the operation. For example, in Cloud - * Storage or S3 is the name of the file, and in Cosmos DB the table name. - */ - val FaasDocumentName: AttributeKey[String] = string("faas.document.name") - - /** Describes the type of the operation that was performed on the data. - */ - val FaasDocumentOperation: AttributeKey[String] = string( - "faas.document.operation" - ) - - /** A string containing the time when the data was accessed in the ISO 8601 - * format expressed in UTC. - */ - val FaasDocumentTime: AttributeKey[String] = string("faas.document.time") - - /** A string containing the schedule period as Cron - * Expression. - */ - val FaasCron: AttributeKey[String] = string("faas.cron") - - /** A string containing the function invocation time in the ISO 8601 - * format expressed in UTC. - */ - val FaasTime: AttributeKey[String] = string("faas.time") - - /** A boolean that is true if the serverless function is executed for the - * first time (aka cold-start). - */ - val FaasColdstart: AttributeKey[Boolean] = boolean("faas.coldstart") - - /** The unique identifier of the feature flag. - */ - val FeatureFlagKey: AttributeKey[String] = string("feature_flag.key") - - /** The name of the service provider that performs the flag evaluation. - */ - val FeatureFlagProviderName: AttributeKey[String] = string( - "feature_flag.provider_name" - ) - - /** SHOULD be a semantic identifier for a value. If one is unavailable, a - * stringified version of the value can be used. - * - *

    Notes:

    • A semantic identifier, commonly referred to as a - * variant, provides a means for referring to a value without including the - * value itself. This can provide additional context for understanding the - * meaning behind a value. For example, the variant `red` maybe be used for - * the value `#c05543`.
    • A stringified version of the value can be - * used in situations where a semantic identifier is unavailable. String - * representation of the value should be determined by the implementer.
    • - *
    - */ - val FeatureFlagVariant: AttributeKey[String] = string("feature_flag.variant") - - /** The AWS request ID as returned in the response headers `x-amz-request-id` - * or `x-amz-requestid`. - */ - val AwsRequestId: AttributeKey[String] = string("aws.request_id") - - /** The value of the `AttributesToGet` request parameter. - */ - val AwsDynamodbAttributesToGet: AttributeKey[Seq[String]] = stringSeq( - "aws.dynamodb.attributes_to_get" - ) - - /** The value of the `ConsistentRead` request parameter. - */ - val AwsDynamodbConsistentRead: AttributeKey[Boolean] = boolean( - "aws.dynamodb.consistent_read" - ) - - /** The JSON-serialized value of each item in the `ConsumedCapacity` response - * field. - */ - val AwsDynamodbConsumedCapacity: AttributeKey[Seq[String]] = stringSeq( - "aws.dynamodb.consumed_capacity" - ) - - /** The value of the `IndexName` request parameter. - */ - val AwsDynamodbIndexName: AttributeKey[String] = string( - "aws.dynamodb.index_name" - ) - - /** The JSON-serialized value of the `ItemCollectionMetrics` response field. - */ - val AwsDynamodbItemCollectionMetrics: AttributeKey[String] = string( - "aws.dynamodb.item_collection_metrics" - ) - - /** The value of the `Limit` request parameter. - */ - val AwsDynamodbLimit: AttributeKey[Long] = long("aws.dynamodb.limit") - - /** The value of the `ProjectionExpression` request parameter. - */ - val AwsDynamodbProjection: AttributeKey[String] = string( - "aws.dynamodb.projection" - ) - - /** The value of the `ProvisionedThroughput.ReadCapacityUnits` request - * parameter. - */ - val AwsDynamodbProvisionedReadCapacity: AttributeKey[Double] = double( - "aws.dynamodb.provisioned_read_capacity" - ) - - /** The value of the `ProvisionedThroughput.WriteCapacityUnits` request - * parameter. - */ - val AwsDynamodbProvisionedWriteCapacity: AttributeKey[Double] = double( - "aws.dynamodb.provisioned_write_capacity" - ) - - /** The value of the `Select` request parameter. - */ - val AwsDynamodbSelect: AttributeKey[String] = string("aws.dynamodb.select") - - /** The keys in the `RequestItems` object field. - */ - val AwsDynamodbTableNames: AttributeKey[Seq[String]] = stringSeq( - "aws.dynamodb.table_names" - ) - - /** The JSON-serialized value of each item of the `GlobalSecondaryIndexes` - * request field - */ - val AwsDynamodbGlobalSecondaryIndexes: AttributeKey[Seq[String]] = stringSeq( - "aws.dynamodb.global_secondary_indexes" - ) - - /** The JSON-serialized value of each item of the `LocalSecondaryIndexes` - * request field. - */ - val AwsDynamodbLocalSecondaryIndexes: AttributeKey[Seq[String]] = stringSeq( - "aws.dynamodb.local_secondary_indexes" - ) - - /** The value of the `ExclusiveStartTableName` request parameter. - */ - val AwsDynamodbExclusiveStartTable: AttributeKey[String] = string( - "aws.dynamodb.exclusive_start_table" - ) - - /** The the number of items in the `TableNames` response parameter. - */ - val AwsDynamodbTableCount: AttributeKey[Long] = long( - "aws.dynamodb.table_count" - ) - - /** The value of the `ScanIndexForward` request parameter. - */ - val AwsDynamodbScanForward: AttributeKey[Boolean] = boolean( - "aws.dynamodb.scan_forward" - ) - - /** The value of the `Count` response parameter. - */ - val AwsDynamodbCount: AttributeKey[Long] = long("aws.dynamodb.count") - - /** The value of the `ScannedCount` response parameter. - */ - val AwsDynamodbScannedCount: AttributeKey[Long] = long( - "aws.dynamodb.scanned_count" - ) - - /** The value of the `Segment` request parameter. - */ - val AwsDynamodbSegment: AttributeKey[Long] = long("aws.dynamodb.segment") - - /** The value of the `TotalSegments` request parameter. - */ - val AwsDynamodbTotalSegments: AttributeKey[Long] = long( - "aws.dynamodb.total_segments" - ) - - /** The JSON-serialized value of each item in the `AttributeDefinitions` - * request field. - */ - val AwsDynamodbAttributeDefinitions: AttributeKey[Seq[String]] = stringSeq( - "aws.dynamodb.attribute_definitions" - ) - - /** The JSON-serialized value of each item in the the - * `GlobalSecondaryIndexUpdates` request field. - */ - val AwsDynamodbGlobalSecondaryIndexUpdates: AttributeKey[Seq[String]] = - stringSeq("aws.dynamodb.global_secondary_index_updates") - - /** The S3 bucket name the request refers to. Corresponds to the `--bucket` - * parameter of the S3 - * API operations. - * - *

    Notes:

    • The `bucket` attribute is applicable to all S3 - * operations that reference a bucket, i.e. that require the bucket name as a - * mandatory parameter. This applies to almost all S3 operations except - * `list-buckets`.
    - */ - val AwsS3Bucket: AttributeKey[String] = string("aws.s3.bucket") - - /** The source object (in the form `bucket`/`key`) for the copy operation. - * - *

    Notes:

    - */ - val AwsS3CopySource: AttributeKey[String] = string("aws.s3.copy_source") - - /** The delete request container that specifies the objects to be deleted. - * - *

    Notes:

    - */ - val AwsS3Delete: AttributeKey[String] = string("aws.s3.delete") - - /** The S3 object key the request refers to. Corresponds to the `--key` - * parameter of the S3 - * API operations. - * - *

    Notes:

    - */ - val AwsS3Key: AttributeKey[String] = string("aws.s3.key") - - /** The part number of the part being uploaded in a multipart-upload - * operation. This is a positive integer between 1 and 10,000. - * - *

    Notes:

    - */ - val AwsS3PartNumber: AttributeKey[Long] = long("aws.s3.part_number") - - /** Upload ID that identifies the multipart upload. - * - *

    Notes:

    - */ - val AwsS3UploadId: AttributeKey[String] = string("aws.s3.upload_id") - - /** The GraphQL document being executed. - * - *

    Notes:

    • The value may be sanitized to exclude sensitive - * information.
    - */ - val GraphqlDocument: AttributeKey[String] = string("graphql.document") - - /** The name of the operation being executed. - */ - val GraphqlOperationName: AttributeKey[String] = string( - "graphql.operation.name" - ) - - /** The type of the operation being executed. - */ - val GraphqlOperationType: AttributeKey[String] = string( - "graphql.operation.type" - ) - - /** Compressed size of the message in bytes. - */ - val MessageCompressedSize: AttributeKey[Long] = long( - "message.compressed_size" - ) - - /** MUST be calculated as two different counters starting from `1` one for - * sent messages and one for received message. - * - *

    Notes:

    • This way we guarantee that the values will be - * consistent between different implementations.
    - */ - val MessageId: AttributeKey[Long] = long("message.id") - - /** Whether this is a received or sent message. - */ - val MessageType: AttributeKey[String] = string("message.type") - - /** Uncompressed size of the message in bytes. - */ - val MessageUncompressedSize: AttributeKey[Long] = long( - "message.uncompressed_size" - ) - - /** SHOULD be set to true if the exception event is recorded at a point where - * it is known that the exception is escaping the scope of the span. - * - *

    Notes:

    • An exception is considered to have escaped (or left) - * the scope of a span, if that span is ended while the exception is still - * logically "in flight". This may be actually "in - * flight" in some languages (e.g. if the exception is passed to a - * Context manager's `__exit__` method in Python) but will usually be caught - * at the point of recording the exception in most languages.
    • 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 example above.
    • It follows that - * an exception may still escape the scope of the span even if the - * `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.
    - */ - val ExceptionEscaped: AttributeKey[Boolean] = boolean("exception.escaped") - - // Enum definitions - abstract class ErrorTypeValue(val value: String) - object ErrorTypeValue { - - /** A fallback error value to be used when the instrumentation doesn't - * define a custom value. - */ - case object Other extends ErrorTypeValue("_OTHER") - - } - - abstract class FaasInvokedProviderValue(val value: String) - object FaasInvokedProviderValue { - - /** Alibaba Cloud. */ - case object AlibabaCloud extends FaasInvokedProviderValue("alibaba_cloud") - - /** Amazon Web Services. */ - case object Aws extends FaasInvokedProviderValue("aws") - - /** Microsoft Azure. */ - case object Azure extends FaasInvokedProviderValue("azure") - - /** Google Cloud Platform. */ - case object Gcp extends FaasInvokedProviderValue("gcp") - - /** Tencent Cloud. */ - case object TencentCloud extends FaasInvokedProviderValue("tencent_cloud") - - } - - abstract class FaasTriggerValue(val value: String) - object FaasTriggerValue { - - /** A response to some data source operation such as a database or - * filesystem read/write. - */ - case object Datasource extends FaasTriggerValue("datasource") - - /** To provide an answer to an inbound HTTP request. */ - case object Http extends FaasTriggerValue("http") - - /** A function is set to be executed when messages are sent to a messaging - * system. - */ - case object Pubsub extends FaasTriggerValue("pubsub") - - /** A function is scheduled to be executed regularly. */ - case object Timer extends FaasTriggerValue("timer") - - /** If none of the others apply. */ - case object Other extends FaasTriggerValue("other") - - } - - abstract class EventDomainValue(val value: String) - object EventDomainValue { - - /** Events from browser apps. */ - case object Browser extends EventDomainValue("browser") - - /** Events from mobile apps. */ - case object Device extends EventDomainValue("device") - - /** Events from Kubernetes. */ - case object K8s extends EventDomainValue("k8s") - - } - - abstract class LogIostreamValue(val value: String) - object LogIostreamValue { - - /** Logs from stdout stream. */ - case object Stdout extends LogIostreamValue("stdout") - - /** Events from stderr stream. */ - case object Stderr extends LogIostreamValue("stderr") - - } - - abstract class IosStateValue(val value: String) - object IosStateValue { - - /** The app has become `active`. Associated with UIKit notification - * `applicationDidBecomeActive`. - */ - case object Active extends IosStateValue("active") - - /** The app is now `inactive`. Associated with UIKit notification - * `applicationWillResignActive`. - */ - case object Inactive extends IosStateValue("inactive") - - /** The app is now in the background. This value is associated with UIKit - * notification `applicationDidEnterBackground`. - */ - case object Background extends IosStateValue("background") - - /** The app is now in the foreground. This value is associated with UIKit - * notification `applicationWillEnterForeground`. - */ - case object Foreground extends IosStateValue("foreground") - - /** The app is about to terminate. Associated with UIKit notification - * `applicationWillTerminate`. - */ - case object Terminate extends IosStateValue("terminate") - - } - - abstract class AndroidStateValue(val value: String) - object AndroidStateValue { - - /** Any time before Activity.onResume() or, if the app has no Activity, - * Context.startService() has been called in the app for the first time. - */ - case object Created extends AndroidStateValue("created") - - /** Any time after Activity.onPause() or, if the app has no Activity, - * Context.stopService() has been called when the app was in the foreground - * state. - */ - case object Background extends AndroidStateValue("background") - - /** Any time after Activity.onResume() or, if the app has no Activity, - * Context.startService() has been called when the app was in either the - * created or background states. - */ - case object Foreground extends AndroidStateValue("foreground") - - } - - abstract class StateValue(val value: String) - object StateValue { - - /** idle. */ - case object Idle extends StateValue("idle") - - /** used. */ - case object Used extends StateValue("used") - - } - - abstract class JvmMemoryTypeValue(val value: String) - object JvmMemoryTypeValue { - - /** Heap memory. */ - case object Heap extends JvmMemoryTypeValue("heap") - - /** Non-heap memory. */ - case object NonHeap extends JvmMemoryTypeValue("non_heap") - - } - - abstract class SystemCpuStateValue(val value: String) - object SystemCpuStateValue { - - /** user. */ - case object User extends SystemCpuStateValue("user") - - /** system. */ - case object System extends SystemCpuStateValue("system") - - /** nice. */ - case object Nice extends SystemCpuStateValue("nice") - - /** idle. */ - case object Idle extends SystemCpuStateValue("idle") - - /** iowait. */ - case object Iowait extends SystemCpuStateValue("iowait") - - /** interrupt. */ - case object Interrupt extends SystemCpuStateValue("interrupt") - - /** steal. */ - case object Steal extends SystemCpuStateValue("steal") - - } - - abstract class SystemMemoryStateValue(val value: String) - object SystemMemoryStateValue { - - /** used. */ - case object Used extends SystemMemoryStateValue("used") - - /** free. */ - case object Free extends SystemMemoryStateValue("free") - - /** shared. */ - case object Shared extends SystemMemoryStateValue("shared") - - /** buffers. */ - case object Buffers extends SystemMemoryStateValue("buffers") - - /** cached. */ - case object Cached extends SystemMemoryStateValue("cached") - - /** total. - * - * @deprecated - * this value has been removed as of 1.23.1 of the semantic conventions. - */ - @deprecated("The item has been removed", "0.4.0") - case object Total extends SystemMemoryStateValue("total") - - } - - abstract class SystemPagingDirectionValue(val value: String) - object SystemPagingDirectionValue { - - /** in. */ - case object In extends SystemPagingDirectionValue("in") - - /** out. */ - case object Out extends SystemPagingDirectionValue("out") - - } - - abstract class SystemPagingStateValue(val value: String) - object SystemPagingStateValue { - - /** used. */ - case object Used extends SystemPagingStateValue("used") - - /** free. */ - case object Free extends SystemPagingStateValue("free") - - } - - abstract class SystemPagingTypeValue(val value: String) - object SystemPagingTypeValue { - - /** major. */ - case object Major extends SystemPagingTypeValue("major") - - /** minor. */ - case object Minor extends SystemPagingTypeValue("minor") - - } - - abstract class SystemDiskDirectionValue(val value: String) - object SystemDiskDirectionValue { - - /** read. */ - case object Read extends SystemDiskDirectionValue("read") - - /** write. */ - case object Write extends SystemDiskDirectionValue("write") - - } - - abstract class SystemFilesystemStateValue(val value: String) - object SystemFilesystemStateValue { - - /** used. */ - case object Used extends SystemFilesystemStateValue("used") - - /** free. */ - case object Free extends SystemFilesystemStateValue("free") - - /** reserved. */ - case object Reserved extends SystemFilesystemStateValue("reserved") - - } - - abstract class SystemFilesystemTypeValue(val value: String) - object SystemFilesystemTypeValue { - - /** fat32. */ - case object Fat32 extends SystemFilesystemTypeValue("fat32") - - /** exfat. */ - case object Exfat extends SystemFilesystemTypeValue("exfat") - - /** ntfs. */ - case object Ntfs extends SystemFilesystemTypeValue("ntfs") - - /** refs. */ - case object Refs extends SystemFilesystemTypeValue("refs") - - /** hfsplus. */ - case object Hfsplus extends SystemFilesystemTypeValue("hfsplus") - - /** ext4. */ - case object Ext4 extends SystemFilesystemTypeValue("ext4") - - } - - abstract class SystemNetworkDirectionValue(val value: String) - object SystemNetworkDirectionValue { - - /** transmit. */ - case object Transmit extends SystemNetworkDirectionValue("transmit") - - /** receive. */ - case object Receive extends SystemNetworkDirectionValue("receive") - - } - - abstract class SystemNetworkStateValue(val value: String) - object SystemNetworkStateValue { - - /** close. */ - case object Close extends SystemNetworkStateValue("close") - - /** close_wait. */ - case object CloseWait extends SystemNetworkStateValue("close_wait") - - /** closing. */ - case object Closing extends SystemNetworkStateValue("closing") - - /** delete. */ - case object Delete extends SystemNetworkStateValue("delete") - - /** established. */ - case object Established extends SystemNetworkStateValue("established") - - /** fin_wait_1. */ - case object FinWait1 extends SystemNetworkStateValue("fin_wait_1") - - /** fin_wait_2. */ - case object FinWait2 extends SystemNetworkStateValue("fin_wait_2") - - /** last_ack. */ - case object LastAck extends SystemNetworkStateValue("last_ack") - - /** listen. */ - case object Listen extends SystemNetworkStateValue("listen") - - /** syn_recv. */ - case object SynRecv extends SystemNetworkStateValue("syn_recv") - - /** syn_sent. */ - case object SynSent extends SystemNetworkStateValue("syn_sent") - - /** time_wait. */ - case object TimeWait extends SystemNetworkStateValue("time_wait") - - } - - abstract class SystemProcessesStatusValue(val value: String) - object SystemProcessesStatusValue { - - /** running. */ - case object Running extends SystemProcessesStatusValue("running") - - /** sleeping. */ - case object Sleeping extends SystemProcessesStatusValue("sleeping") - - /** stopped. */ - case object Stopped extends SystemProcessesStatusValue("stopped") - - /** defunct. */ - case object Defunct extends SystemProcessesStatusValue("defunct") - - } - - abstract class NetSockFamilyValue(val value: String) - object NetSockFamilyValue { - - /** IPv4 address. */ - case object Inet extends NetSockFamilyValue("inet") - - /** IPv6 address. */ - case object Inet6 extends NetSockFamilyValue("inet6") - - /** Unix domain socket path. */ - case object Unix extends NetSockFamilyValue("unix") - - } - - abstract class NetTransportValue(val value: String) - object NetTransportValue { - - /** ip_tcp. */ - case object IpTcp extends NetTransportValue("ip_tcp") - - /** ip_udp. */ - case object IpUdp extends NetTransportValue("ip_udp") - - /** Named or anonymous pipe. */ - case object Pipe extends NetTransportValue("pipe") - - /** In-process communication. */ - case object Inproc extends NetTransportValue("inproc") - - /** Something else (non IP-based). */ - case object Other extends NetTransportValue("other") - - /** @deprecated - * This item has been removed as of 1.13.0 of the semantic conventions. - */ - @deprecated("This item has been removed", "0.3.0") - case object Ip extends NetTransportValue("ip") - - /** @deprecated - * This item has been removed as of 1.13.0 of the semantic conventions. - */ - @deprecated("This item has been removed", "0.3.0") - case object Unix extends NetTransportValue("unix") - - } - - abstract class HttpRequestMethodValue(val value: String) - object HttpRequestMethodValue { - - /** CONNECT method. */ - case object Connect extends HttpRequestMethodValue("CONNECT") - - /** DELETE method. */ - case object Delete extends HttpRequestMethodValue("DELETE") - - /** GET method. */ - case object Get extends HttpRequestMethodValue("GET") - - /** HEAD method. */ - case object Head extends HttpRequestMethodValue("HEAD") - - /** OPTIONS method. */ - case object Options extends HttpRequestMethodValue("OPTIONS") - - /** PATCH method. */ - case object Patch extends HttpRequestMethodValue("PATCH") - - /** POST method. */ - case object Post extends HttpRequestMethodValue("POST") - - /** PUT method. */ - case object Put extends HttpRequestMethodValue("PUT") - - /** TRACE method. */ - case object Trace extends HttpRequestMethodValue("TRACE") - - /** Any HTTP method that the instrumentation has no prior knowledge of. */ - case object Other extends HttpRequestMethodValue("_OTHER") - - } - - abstract class MessagingOperationValue(val value: String) - object MessagingOperationValue { - - /** One or more messages are provided for publishing to an intermediary. If - * a single message is published, the context of the "Publish" span - * can be used as the creation context and no "Create" span needs - * to be created. - */ - case object Publish extends MessagingOperationValue("publish") - - /** A message is created. "Create" spans always refer to a single - * message and are used to provide a unique creation context for messages - * in batch publishing scenarios. - */ - case object Create extends MessagingOperationValue("create") - - /** One or more messages are requested by a consumer. This operation refers - * to pull-based scenarios, where consumers explicitly call methods of - * messaging SDKs to receive messages. - */ - case object Receive extends MessagingOperationValue("receive") - - /** One or more messages are passed to a consumer. This operation refers to - * push-based scenarios, where consumer register callbacks which get called - * by messaging SDKs. - */ - case object Deliver extends MessagingOperationValue("deliver") - - /** process. - * - * @deprecated - * this value has been removed as of 1.23.1 of the semantic conventions. - */ - @deprecated("The item has been removed", "0.4.0") - case object Process extends MessagingOperationValue("process") - - } - - abstract class MessagingRocketmqConsumptionModelValue(val value: String) - object MessagingRocketmqConsumptionModelValue { - - /** Clustering consumption model. */ - case object Clustering - extends MessagingRocketmqConsumptionModelValue("clustering") - - /** Broadcasting consumption model. */ - case object Broadcasting - extends MessagingRocketmqConsumptionModelValue("broadcasting") - - } - - abstract class MessagingRocketmqMessageTypeValue(val value: String) - object MessagingRocketmqMessageTypeValue { - - /** Normal message. */ - case object Normal extends MessagingRocketmqMessageTypeValue("normal") - - /** FIFO message. */ - case object Fifo extends MessagingRocketmqMessageTypeValue("fifo") - - /** Delay message. */ - case object Delay extends MessagingRocketmqMessageTypeValue("delay") - - /** Transaction message. */ - case object Transaction - extends MessagingRocketmqMessageTypeValue("transaction") - - } - - abstract class NetworkConnectionSubtypeValue(val value: String) - object NetworkConnectionSubtypeValue { - - /** GPRS. */ - case object Gprs extends NetworkConnectionSubtypeValue("gprs") - - /** EDGE. */ - case object Edge extends NetworkConnectionSubtypeValue("edge") - - /** UMTS. */ - case object Umts extends NetworkConnectionSubtypeValue("umts") - - /** CDMA. */ - case object Cdma extends NetworkConnectionSubtypeValue("cdma") - - /** EVDO Rel. 0. */ - case object Evdo0 extends NetworkConnectionSubtypeValue("evdo_0") - - /** EVDO Rev. A. */ - case object EvdoA extends NetworkConnectionSubtypeValue("evdo_a") - - /** CDMA2000 1XRTT. */ - case object Cdma20001xrtt - extends NetworkConnectionSubtypeValue("cdma2000_1xrtt") - - /** HSDPA. */ - case object Hsdpa extends NetworkConnectionSubtypeValue("hsdpa") - - /** HSUPA. */ - case object Hsupa extends NetworkConnectionSubtypeValue("hsupa") - - /** HSPA. */ - case object Hspa extends NetworkConnectionSubtypeValue("hspa") - - /** IDEN. */ - case object Iden extends NetworkConnectionSubtypeValue("iden") - - /** EVDO Rev. B. */ - case object EvdoB extends NetworkConnectionSubtypeValue("evdo_b") - - /** LTE. */ - case object Lte extends NetworkConnectionSubtypeValue("lte") - - /** EHRPD. */ - case object Ehrpd extends NetworkConnectionSubtypeValue("ehrpd") - - /** HSPAP. */ - case object Hspap extends NetworkConnectionSubtypeValue("hspap") - - /** GSM. */ - case object Gsm extends NetworkConnectionSubtypeValue("gsm") - - /** TD-SCDMA. */ - case object TdScdma extends NetworkConnectionSubtypeValue("td_scdma") - - /** IWLAN. */ - case object Iwlan extends NetworkConnectionSubtypeValue("iwlan") - - /** 5G NR (New Radio). */ - case object Nr extends NetworkConnectionSubtypeValue("nr") - - /** 5G NRNSA (New Radio Non-Standalone). */ - case object Nrnsa extends NetworkConnectionSubtypeValue("nrnsa") - - /** LTE CA. */ - case object LteCa extends NetworkConnectionSubtypeValue("lte_ca") - - } - - abstract class NetworkConnectionTypeValue(val value: String) - object NetworkConnectionTypeValue { - - /** wifi. */ - case object Wifi extends NetworkConnectionTypeValue("wifi") - - /** wired. */ - case object Wired extends NetworkConnectionTypeValue("wired") - - /** cell. */ - case object Cell extends NetworkConnectionTypeValue("cell") - - /** unavailable. */ - case object Unavailable extends NetworkConnectionTypeValue("unavailable") - - /** unknown. */ - case object Unknown extends NetworkConnectionTypeValue("unknown") - - } - - abstract class NetworkTransportValue(val value: String) - object NetworkTransportValue { - - /** TCP. */ - case object Tcp extends NetworkTransportValue("tcp") - - /** UDP. */ - case object Udp extends NetworkTransportValue("udp") - - /** Named or anonymous pipe. */ - case object Pipe extends NetworkTransportValue("pipe") - - /** Unix domain socket. */ - case object Unix extends NetworkTransportValue("unix") - - } - - abstract class NetworkTypeValue(val value: String) - object NetworkTypeValue { - - /** IPv4. */ - case object Ipv4 extends NetworkTypeValue("ipv4") - - /** IPv6. */ - case object Ipv6 extends NetworkTypeValue("ipv6") - - } - - abstract class RpcConnectRpcErrorCodeValue(val value: String) - object RpcConnectRpcErrorCodeValue { - - /** cancelled. */ - case object Cancelled extends RpcConnectRpcErrorCodeValue("cancelled") - - /** unknown. */ - case object Unknown extends RpcConnectRpcErrorCodeValue("unknown") - - /** invalid_argument. */ - case object InvalidArgument - extends RpcConnectRpcErrorCodeValue("invalid_argument") - - /** deadline_exceeded. */ - case object DeadlineExceeded - extends RpcConnectRpcErrorCodeValue("deadline_exceeded") - - /** not_found. */ - case object NotFound extends RpcConnectRpcErrorCodeValue("not_found") - - /** already_exists. */ - case object AlreadyExists - extends RpcConnectRpcErrorCodeValue("already_exists") - - /** permission_denied. */ - case object PermissionDenied - extends RpcConnectRpcErrorCodeValue("permission_denied") - - /** resource_exhausted. */ - case object ResourceExhausted - extends RpcConnectRpcErrorCodeValue("resource_exhausted") - - /** failed_precondition. */ - case object FailedPrecondition - extends RpcConnectRpcErrorCodeValue("failed_precondition") - - /** aborted. */ - case object Aborted extends RpcConnectRpcErrorCodeValue("aborted") - - /** out_of_range. */ - case object OutOfRange extends RpcConnectRpcErrorCodeValue("out_of_range") - - /** unimplemented. */ - case object Unimplemented - extends RpcConnectRpcErrorCodeValue("unimplemented") - - /** internal. */ - case object Internal extends RpcConnectRpcErrorCodeValue("internal") - - /** unavailable. */ - case object Unavailable extends RpcConnectRpcErrorCodeValue("unavailable") - - /** data_loss. */ - case object DataLoss extends RpcConnectRpcErrorCodeValue("data_loss") - - /** unauthenticated. */ - case object Unauthenticated - extends RpcConnectRpcErrorCodeValue("unauthenticated") - - } - - abstract class RpcGrpcStatusCodeValue(val value: Long) - object RpcGrpcStatusCodeValue { - - /** OK. */ - case object Ok extends RpcGrpcStatusCodeValue(0) - - /** CANCELLED. */ - case object Cancelled extends RpcGrpcStatusCodeValue(1) - - /** UNKNOWN. */ - case object Unknown extends RpcGrpcStatusCodeValue(2) - - /** INVALID_ARGUMENT. */ - case object InvalidArgument extends RpcGrpcStatusCodeValue(3) - - /** DEADLINE_EXCEEDED. */ - case object DeadlineExceeded extends RpcGrpcStatusCodeValue(4) - - /** NOT_FOUND. */ - case object NotFound extends RpcGrpcStatusCodeValue(5) - - /** ALREADY_EXISTS. */ - case object AlreadyExists extends RpcGrpcStatusCodeValue(6) - - /** PERMISSION_DENIED. */ - case object PermissionDenied extends RpcGrpcStatusCodeValue(7) - - /** RESOURCE_EXHAUSTED. */ - case object ResourceExhausted extends RpcGrpcStatusCodeValue(8) - - /** FAILED_PRECONDITION. */ - case object FailedPrecondition extends RpcGrpcStatusCodeValue(9) - - /** ABORTED. */ - case object Aborted extends RpcGrpcStatusCodeValue(10) - - /** OUT_OF_RANGE. */ - case object OutOfRange extends RpcGrpcStatusCodeValue(11) - - /** UNIMPLEMENTED. */ - case object Unimplemented extends RpcGrpcStatusCodeValue(12) - - /** INTERNAL. */ - case object Internal extends RpcGrpcStatusCodeValue(13) - - /** UNAVAILABLE. */ - case object Unavailable extends RpcGrpcStatusCodeValue(14) - - /** DATA_LOSS. */ - case object DataLoss extends RpcGrpcStatusCodeValue(15) - - /** UNAUTHENTICATED. */ - case object Unauthenticated extends RpcGrpcStatusCodeValue(16) - - } - - abstract class RpcSystemValue(val value: String) - object RpcSystemValue { - - /** gRPC. */ - case object Grpc extends RpcSystemValue("grpc") - - /** Java RMI. */ - case object JavaRmi extends RpcSystemValue("java_rmi") - - /** .NET WCF. */ - case object DotnetWcf extends RpcSystemValue("dotnet_wcf") - - /** Apache Dubbo. */ - case object ApacheDubbo extends RpcSystemValue("apache_dubbo") - - /** Connect RPC. */ - case object ConnectRpc extends RpcSystemValue("connect_rpc") - - } - - abstract class OpentracingRefTypeValue(val value: String) - object OpentracingRefTypeValue { - - /** The parent Span depends on the child Span in some capacity. */ - case object ChildOf extends OpentracingRefTypeValue("child_of") - - /** The parent Span doesn't depend in any way on the result of the child - * Span. - */ - case object FollowsFrom extends OpentracingRefTypeValue("follows_from") - - } - - abstract class DbSystemValue(val value: String) - object DbSystemValue { - - /** Some other SQL database. Fallback only. See notes. */ - case object OtherSql extends DbSystemValue("other_sql") - - /** Microsoft SQL Server. */ - case object Mssql extends DbSystemValue("mssql") - - /** Microsoft SQL Server Compact. */ - case object Mssqlcompact extends DbSystemValue("mssqlcompact") - - /** MySQL. */ - case object Mysql extends DbSystemValue("mysql") - - /** Oracle Database. */ - case object Oracle extends DbSystemValue("oracle") - - /** IBM Db2. */ - case object Db2 extends DbSystemValue("db2") - - /** PostgreSQL. */ - case object Postgresql extends DbSystemValue("postgresql") - - /** Amazon Redshift. */ - case object Redshift extends DbSystemValue("redshift") - - /** Apache Hive. */ - case object Hive extends DbSystemValue("hive") - - /** Cloudscape. */ - case object Cloudscape extends DbSystemValue("cloudscape") - - /** HyperSQL DataBase. */ - case object Hsqldb extends DbSystemValue("hsqldb") - - /** Progress Database. */ - case object Progress extends DbSystemValue("progress") - - /** SAP MaxDB. */ - case object Maxdb extends DbSystemValue("maxdb") - - /** SAP HANA. */ - case object Hanadb extends DbSystemValue("hanadb") - - /** Ingres. */ - case object Ingres extends DbSystemValue("ingres") - - /** FirstSQL. */ - case object Firstsql extends DbSystemValue("firstsql") - - /** EnterpriseDB. */ - case object Edb extends DbSystemValue("edb") - - /** InterSystems Caché. */ - case object Cache extends DbSystemValue("cache") - - /** Adabas (Adaptable Database System). */ - case object Adabas extends DbSystemValue("adabas") - - /** Firebird. */ - case object Firebird extends DbSystemValue("firebird") - - /** Apache Derby. */ - case object Derby extends DbSystemValue("derby") - - /** FileMaker. */ - case object Filemaker extends DbSystemValue("filemaker") - - /** Informix. */ - case object Informix extends DbSystemValue("informix") - - /** InstantDB. */ - case object Instantdb extends DbSystemValue("instantdb") - - /** InterBase. */ - case object Interbase extends DbSystemValue("interbase") - - /** MariaDB. */ - case object Mariadb extends DbSystemValue("mariadb") - - /** Netezza. */ - case object Netezza extends DbSystemValue("netezza") - - /** Pervasive PSQL. */ - case object Pervasive extends DbSystemValue("pervasive") - - /** PointBase. */ - case object Pointbase extends DbSystemValue("pointbase") - - /** SQLite. */ - case object Sqlite extends DbSystemValue("sqlite") - - /** Sybase. */ - case object Sybase extends DbSystemValue("sybase") - - /** Teradata. */ - case object Teradata extends DbSystemValue("teradata") - - /** Vertica. */ - case object Vertica extends DbSystemValue("vertica") - - /** H2. */ - case object H2 extends DbSystemValue("h2") - - /** ColdFusion IMQ. */ - case object Coldfusion extends DbSystemValue("coldfusion") - - /** Apache Cassandra. */ - case object Cassandra extends DbSystemValue("cassandra") - - /** Apache HBase. */ - case object Hbase extends DbSystemValue("hbase") - - /** MongoDB. */ - case object Mongodb extends DbSystemValue("mongodb") - - /** Redis. */ - case object Redis extends DbSystemValue("redis") - - /** Couchbase. */ - case object Couchbase extends DbSystemValue("couchbase") - - /** CouchDB. */ - case object Couchdb extends DbSystemValue("couchdb") - - /** Microsoft Azure Cosmos DB. */ - case object Cosmosdb extends DbSystemValue("cosmosdb") - - /** Amazon DynamoDB. */ - case object Dynamodb extends DbSystemValue("dynamodb") - - /** Neo4j. */ - case object Neo4j extends DbSystemValue("neo4j") - - /** Apache Geode. */ - case object Geode extends DbSystemValue("geode") - - /** Elasticsearch. */ - case object Elasticsearch extends DbSystemValue("elasticsearch") - - /** Memcached. */ - case object Memcached extends DbSystemValue("memcached") - - /** CockroachDB. */ - case object Cockroachdb extends DbSystemValue("cockroachdb") - - /** OpenSearch. */ - case object Opensearch extends DbSystemValue("opensearch") - - /** ClickHouse. */ - case object Clickhouse extends DbSystemValue("clickhouse") - - /** Cloud Spanner. */ - case object Spanner extends DbSystemValue("spanner") - - /** Trino. */ - case object Trino extends DbSystemValue("trino") - - } - - abstract class DbCassandraConsistencyLevelValue(val value: String) - object DbCassandraConsistencyLevelValue { - - /** all. */ - case object All extends DbCassandraConsistencyLevelValue("all") - - /** each_quorum. */ - case object EachQuorum - extends DbCassandraConsistencyLevelValue("each_quorum") - - /** quorum. */ - case object Quorum extends DbCassandraConsistencyLevelValue("quorum") - - /** local_quorum. */ - case object LocalQuorum - extends DbCassandraConsistencyLevelValue("local_quorum") - - /** one. */ - case object One extends DbCassandraConsistencyLevelValue("one") - - /** two. */ - case object Two extends DbCassandraConsistencyLevelValue("two") - - /** three. */ - case object Three extends DbCassandraConsistencyLevelValue("three") - - /** local_one. */ - case object LocalOne extends DbCassandraConsistencyLevelValue("local_one") - - /** any. */ - case object Any extends DbCassandraConsistencyLevelValue("any") - - /** serial. */ - case object Serial extends DbCassandraConsistencyLevelValue("serial") - - /** local_serial. */ - case object LocalSerial - extends DbCassandraConsistencyLevelValue("local_serial") - - } - - abstract class DbCosmosdbConnectionModeValue(val value: String) - object DbCosmosdbConnectionModeValue { - - /** Gateway (HTTP) connections mode. */ - case object Gateway extends DbCosmosdbConnectionModeValue("gateway") - - /** Direct connection. */ - case object Direct extends DbCosmosdbConnectionModeValue("direct") - - } - - abstract class DbCosmosdbOperationTypeValue(val value: String) - object DbCosmosdbOperationTypeValue { - - /** invalid. */ - case object Invalid extends DbCosmosdbOperationTypeValue("Invalid") - - /** create. */ - case object Create extends DbCosmosdbOperationTypeValue("Create") - - /** patch. */ - case object Patch extends DbCosmosdbOperationTypeValue("Patch") - - /** read. */ - case object Read extends DbCosmosdbOperationTypeValue("Read") - - /** read_feed. */ - case object ReadFeed extends DbCosmosdbOperationTypeValue("ReadFeed") - - /** delete. */ - case object Delete extends DbCosmosdbOperationTypeValue("Delete") - - /** replace. */ - case object Replace extends DbCosmosdbOperationTypeValue("Replace") - - /** execute. */ - case object Execute extends DbCosmosdbOperationTypeValue("Execute") - - /** query. */ - case object Query extends DbCosmosdbOperationTypeValue("Query") - - /** head. */ - case object Head extends DbCosmosdbOperationTypeValue("Head") - - /** head_feed. */ - case object HeadFeed extends DbCosmosdbOperationTypeValue("HeadFeed") - - /** upsert. */ - case object Upsert extends DbCosmosdbOperationTypeValue("Upsert") - - /** batch. */ - case object Batch extends DbCosmosdbOperationTypeValue("Batch") - - /** query_plan. */ - case object QueryPlan extends DbCosmosdbOperationTypeValue("QueryPlan") - - /** execute_javascript. */ - case object ExecuteJavascript - extends DbCosmosdbOperationTypeValue("ExecuteJavaScript") - - } - - abstract class OtelStatusCodeValue(val value: String) - object OtelStatusCodeValue { - - /** The operation has been validated by an Application developer or Operator - * to have completed successfully. - */ - case object Ok extends OtelStatusCodeValue("OK") - - /** The operation contains an error. */ - case object Error extends OtelStatusCodeValue("ERROR") - - } - - abstract class FaasDocumentOperationValue(val value: String) - object FaasDocumentOperationValue { - - /** When a new object is created. */ - case object Insert extends FaasDocumentOperationValue("insert") - - /** When an object is modified. */ - case object Edit extends FaasDocumentOperationValue("edit") - - /** When an object is deleted. */ - case object Delete extends FaasDocumentOperationValue("delete") - - } - - abstract class GraphqlOperationTypeValue(val value: String) - object GraphqlOperationTypeValue { - - /** GraphQL query. */ - case object Query extends GraphqlOperationTypeValue("query") - - /** GraphQL mutation. */ - case object Mutation extends GraphqlOperationTypeValue("mutation") - - /** GraphQL subscription. */ - case object Subscription extends GraphqlOperationTypeValue("subscription") - - } - - abstract class MessageTypeValue(val value: String) - object MessageTypeValue { - - /** sent. */ - case object Sent extends MessageTypeValue("SENT") - - /** received. */ - case object Received extends MessageTypeValue("RECEIVED") - - } - - // Manually defined and not YET in the YAML - /** The name of an event describing an exception. - * - *

    Typically an event with that name should not be manually created. - * Instead `org.typelevel.otel4s.trace.Span#recordException(Throwable)` - * should be used. - */ - final val ExceptionEventName = "exception" - - /** The name of the keyspace being accessed. - * - * @deprecated - * this item has been removed as of 1.8.0 of the semantic conventions. - * Please use [[SemanticAttributes.DbName]] instead. - */ - @deprecated("Use SemanticAttributes.DbName instead", "0.3.0") - val DbCassandraKeyspace = string("db.cassandra.keyspace") - - /** The HBase - * namespace being accessed. - * - * @deprecated - * this item has been removed as of 1.8.0 of the semantic conventions. - * Please use [[SemanticAttributes.DbName]] instead. - */ - @deprecated("Use SemanticAttributes.DbName instead", "0.3.0") - val DbHbaseNameSpace = string("db.hbase.namespace") - - /** The size of the uncompressed request payload body after transport - * decoding. Not set if transport encoding not used. - * - * @deprecated - * this item has been removed as of 1.13.0 of the semantic conventions. - * Please use [[SemanticAttributes.HttpRequestContentLength]] instead. - */ - @deprecated( - "Use SemanticAttributes.HttpRequestContentLength instead", - "0.3.0" - ) - val HttpRequestContentLengthUncompressed = long( - "http.request_content_length_uncompressed" - ) - - /** @deprecated - * This item has been removed as of 1.13.0 of the semantic conventions. - * Please use [[SemanticAttributes.HttpResponseContentLength]] instead. - */ - @deprecated( - "Use SemanticAttributes.HttpResponseContentLength instead", - "0.3.0" - ) - val HttpResponseContentLengthUncompressed = long( - "http.response_content_length_uncompressed" - ) - - /** @deprecated - * This item has been removed as of 1.13.0 of the semantic conventions. - * Please use [[SemanticAttributes.NetHostName]] instead. - */ - @deprecated("Use SemanticAttributes.NetHostName instead", "0.3.0") - val HttpServerName = string("http.server_name") - - /** @deprecated - * This item has been removed as of 1.13.0 of the semantic conventions. - * Please use [[SemanticAttributes.NetHostName]] instead. - */ - @deprecated("Use SemanticAttributes.NetHostName instead", "0.3.0") - val HttpHost = string("http.host") - - /** @deprecated - * This item has been removed as of 1.13.0 of the semantic conventions. - * Please use [[SemanticAttributes.NetSockPeerAddr]] instead. - */ - @deprecated("Use SemanticAttributes.NetSockPeerAddr instead", "0.3.0") - val NetPeerIp = string("net.peer.ip") - - /** @deprecated - * This item has been removed as of 1.13.0 of the semantic conventions. - * Please use [[SemanticAttributes.NetSockHostAddr]] instead. - */ - @deprecated("Use SemanticAttributes.NetSockHostAddr instead", "0.3.0") - val NetHostIp = string("net.host.ip") - - /** The ordinal number of request re-sending attempt. - * @deprecated - * This item has been removed as of 1.15.0 of the semantic conventions. Use - * [[SemanticAttributes.HttpResendCount]] instead. - */ - @deprecated("Use SemanticAttributes.HttpResendCount instead", "0.3.0") - val HttpRetryCount = long("http.retry_count") - - /** A string identifying the messaging system. - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. Use - * [[SemanticAttributes.MessagingDestinationName]] instead. - */ - @deprecated( - "Use SemanticAttributes.MessagingDestinationName instead", - "0.3.0" - ) - val MessagingDestination = string("messaging.destination") - - /** A boolean that is true if the message destination is temporary. - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. Use - * [[SemanticAttributes.MessagingDestinationTemporary]] instead. - */ - @deprecated( - "Use SemanticAttributes.MessagingDestinationTemporary instead", - "0.3.0" - ) - val MessagingTempDestination = boolean("messaging.temp_destination") - - /** The name of the transport protocol. - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. Use - * [[SemanticAttributes.NetAppProtocolName]] instead. - */ - @deprecated("Use SemanticAttributes.NetAppProtocolName instead", "0.3.0") - val MessagingProtocol = string("messaging.protocol") - - /** The version of the transport protocol. - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. Use - * [[SemanticAttributes.NetAppProtocolVersion]] instead. - */ - @deprecated("Use SemanticAttributes.NetAppProtocolVersion instead", "0.3.0") - val MessagingProtocolVersion = string("messaging.protocol_version") - - /** Connection string. - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. - * There is no replacement. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingUrl = string("messaging.url") - - /** The conversation ID identifying the - * conversation to which the message belongs, represented as a string. - * Sometimes called "Correlation ID". - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. Use - * [[SemanticAttributes.MessagingMessageConversationId]] instead. - */ - @deprecated( - "Use SemanticAttributes.MessagingMessageConversationId instead", - "0.3.0" - ) - val MessagingConversationId = string("messaging.conversation_id") - - /** RabbitMQ message routing key. - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. Use - * [[SemanticAttributes.MessagingRabbitmqDestinationRoutingKey]] instead. - */ - @deprecated( - "Use SemanticAttributes.MessagingRabbitmqDestinationRoutingKey instead", - "0.3.0" - ) - val MessagingRabbitmqRoutingKey = string("messaging.rabbitmq.routing_key") - - /** Partition the message is received from. - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. Use - * [[SemanticAttributes.MessagingKafkaSourcePartition]] instead. - */ - @deprecated( - "Use SemanticAttributes.MessagingKafkaSourcePartition instead", - "0.3.0" - ) - val MessagingKafkaPartition = long("messaging.kafka.partition") - - /** A boolean that is true if the message is a tombstone. - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. Use - * [[SemanticAttributes.MessagingKafkaMessageTombstone]] instead. - */ - @deprecated( - "Use SemanticAttributes.MessagingKafkaMessageTombstone instead", - "0.3.0" - ) - val MessagingKafkaTombstone = boolean("messaging.kafka.tombstone") - - /** The timestamp in milliseconds that the delay message is expected to be - * delivered to consumer. - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. Use - * [[SemanticAttributes.MessagingRocketmqMessageDeliveryTimestamp]] - * instead. - */ - @deprecated( - "Use SemanticAttributes.MessagingRocketmqMessageDeliveryTimestamp instead", - "0.3.0" - ) - val MessagingRocketmqDeliveryTimestamp = long( - "messaging.rocketmq.delivery_timestamp" - ) - - /** The delay time level for delay message, which determines the message delay - * time. - * @deprecated - * This item has been removed as of 1.17.0 of the semantic conventions. Use - * [[SemanticAttributes.MessagingRocketmqMessageDelayTimeLevel]] instead. - */ - @deprecated( - "Use SemanticAttributes.MessagingRocketmqMessageDelayTimeLevel instead", - "0.3.0" - ) - val MessagingRocketmqDelayTimeLevel = long( - "messaging.rocketmq.delay_time_level" - ) - - /** The name of the instrumentation scope - (`InstrumentationScope.Name` in - * OTLP). - * @deprecated - * This item has been moved, use - * [[org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes.OtelScopeName ResourceAttributes.OtelScopeName]] - * instead. - */ - @deprecated("Use ResourceAttributes.OtelScopeName instead", "0.3.0") - val OtelScopeName = string("otel.scope.name") - - /** The version of the instrumentation scope - (`InstrumentationScope.Version` - * in OTLP). - * @deprecated - * This item has been moved, use - * [[org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes.OtelScopeVersion ResourceAttributes.OtelScopeVersion]] - * instead. - */ - @deprecated("Use ResourceAttributes.OtelScopeVersion instead", "0.3.0") - val OtelScopeVersion = string("otel.scope.version") - - /** The execution ID of the current function execution. - * @deprecated - * This item has been renamed in 1.19.0 version of the semantic - * conventions. Use [[SemanticAttributes.FaasInvocationId]] instead. - */ - @deprecated("Use SemanticAttributes.FaasInvocationId instead", "0.3.0") - val FaasExecution = string("faas.execution") - - /** Value of the HTTP - * User-Agent header sent by the client. - * @deprecated - * This item has been renamed in 1.19.0 version of the semantic - * conventions. Use [[SemanticAttributes.UserAgentOriginal]] instead. - */ - @deprecated("Use SemanticAttributes.UserAgentOriginal instead", "0.3.0") - val HttpUserAgent = string("http.user_agent") - - /** Deprecated. - * - * @deprecated - * Deprecated, use the - * [[org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes.OtelScopeName ResourceAttributes.OtelScopeName]] - * attribute. - */ - @deprecated("Use ResourceAttributes.OtelScopeName instead", "0.3.0") - val OtelLibraryName = string("otel.library.name") - - /** Deprecated. - * - * @deprecated - * Deprecated, use the - * [[org.typelevel.otel4s.semconv.resource.attributes.ResourceAttributes.OtelScopeVersion ResourceAttributes.OtelScopeVersion]] - * attribute. - */ - @deprecated("Use ResourceAttributes.OtelScopeVersion instead", "0.3.0") - val OtelLibraryVersion = string("otel.library.version") - - /** Kind of HTTP protocol used. - * @deprecated - * This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val HttpFlavor = string("http.flavor") - - /** Values for [[SemanticAttributes.HttpFlavor]]. - * @deprecated - * This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - abstract class HttpFlavorValue(val value: String) - @annotation.nowarn("cat=deprecation") - object HttpFlavorValue { - - /** HTTP/1.0. */ - case object Http10 extends HttpFlavorValue("1.0") - - /** HTTP/1.1. */ - case object Http11 extends HttpFlavorValue("1.1") - - /** HTTP/2. */ - case object Http20 extends HttpFlavorValue("2.0") - - /** HTTP/3. */ - case object Http30 extends HttpFlavorValue("3.0") - - /** SPDY protocol. */ - case object Spdy extends HttpFlavorValue("SPDY") - - /** QUIC protocol. */ - case object Quic extends HttpFlavorValue("QUIC") - } - - /** Application layer protocol used. The value SHOULD be normalized to - * lowercase. - * @deprecated - * This item has been removed as of 1.20.0 of the semantic conventions. Use - * [[SemanticAttributes.NetProtocolName]] instead. - */ - @deprecated("Use SemanticAttributes.NetProtocolName instead", "0.3.0") - val NetAppProtocolName = string("net.app.protocol.name") - - /** Version of the application layer protocol used. See note below. - * - *

    Notes: - * - *

    • `net.app.protocol.version` refers to the version of the protocol - * used and might be different from the protocol client's version. If the - * HTTP client used has a version of `0.27.2`, but sends HTTP version `1.1`, - * this attribute should be set to `1.1`.
    - * @deprecated - * This item has been removed as of 1.20.0 of the semantic conventions. Use - * [[SemanticAttributes.NetProtocolVersion]] instead. - */ - @deprecated("Use SemanticAttributes.NetProtocolVersion instead", "0.3.0") - val NetAppProtocolVersion = string("net.app.protocol.version") - - /** The kind of message destination. - * @deprecated - * This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingDestinationKind = string("messaging.destination.kind") - - /** Enum values for [[SemanticAttributes.MessagingDestinationKind]]. - * @deprecated - * This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is not replacement", "0.3.0") - abstract class MessagingDestinationKindValue(val value: String) - @annotation.nowarn("cat=deprecation") - object MessagingDestinationKindValue { - - /** A message sent to a queue. */ - case object Queue extends MessagingDestinationKindValue("queue") - - /** A message sent to a topic. */ - case object Topic extends MessagingDestinationKindValue("topic") - } - - /** The kind of message source. - * @deprecated - * This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is not replacement", "0.3.0") - val MessagingSourceKind = string("messaging.source.kind") - - /** Values for [[SemanticAttributes.MessagingSourceKind]]. - * @deprecated - * This item has been removed as of 1.20.0 of the semantic conventions. - */ - @deprecated("There is not replacement", "0.3.0") - abstract class MessagingSourceKindValue(val value: String) - @annotation.nowarn("cat=deprecation") - object MessagingSourceKindValue { - - /** A message received from a queue. */ - case object Queue extends MessagingSourceKindValue("queue") - - /** A message received from a topic. */ - case object Topic extends MessagingSourceKindValue("topic") - } - - /** The internet connection type currently being used by the host. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. Use [[SemanticAttributes.NetworkConnectionType]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkConnectionType instead", "0.3.0") - val NetHostConnectionType = string("net.host.connection.type") - - /** This describes more details regarding the connection.type. It may be the - * type of cell technology connection, but it could be used for describing - * details about a wifi connection. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. Use [[SemanticAttributes.NetworkConnectionSubtype]] - * instead. - */ - @deprecated( - "Use SemanticAttributes.NetworkConnectionSubtype instead", - "0.3.0" - ) - val NetHostConnectionSubtype = string("net.host.connection.subtype") - - /** The name of the mobile carrier. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. Use [[SemanticAttributes.NetworkCarrierName]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkCarrierName instead", "0.3.0") - val NetHostCarrierName = string("net.host.carrier.name") - - /** The mobile carrier country code. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. Use [[SemanticAttributes.NetworkCarrierMcc]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkCarrierMcc instead", "0.3.0") - val NetHostCarrierMcc = string("net.host.carrier.mcc") - - /** The mobile carrier network code. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. Use [[SemanticAttributes.NetworkCarrierMnc]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkCarrierMnc instead", "0.3.0") - val NetHostCarrierMnc = string("net.host.carrier.mnc") - - /** The ISO 3166-1 alpha-2 2-character country code associated with the mobile - * carrier network. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. Use [[SemanticAttributes.NetworkCarrierIcc]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkCarrierIcc instead", "0.3.0") - val NetHostCarrierIcc = string("net.host.carrier.icc") - - /** The IP address of the original client behind all proxies, if known (e.g. - * from X-Forwarded-For). - * - *

    Notes: - * - *

    • This is not necessarily the same as `net.sock.peer.addr`, which - * would identify the network-level peer, which may be a proxy.
    • This - * attribute should be set when a source of information different from the - * one used for `net.sock.peer.addr`, is available even if that other source - * just confirms the same value as `net.sock.peer.addr`. Rationale: For - * `net.sock.peer.addr`, one typically does not know if it comes from a - * proxy, reverse proxy, or the actual client. Setting `http.client_ip` when - * it's the same as `net.sock.peer.addr` means that one is at least somewhat - * confident that the address is not that of the closest proxy.
    - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. Use [[SemanticAttributes.ClientAddress]] instead. - */ - @deprecated("Use SemanticAttributes.ClientAddress instead", "0.3.0") - val HttpClientIp = string("http.client_ip") - - /** The message source name. - * - *

    Notes: - * - *

    • Source name SHOULD uniquely identify a specific queue, topic, or - * other entity within the broker. If the broker does not have such notion, - * the source name SHOULD uniquely identify the broker.
    - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingSourceName = string("messaging.source.name") - - /** Low cardinality representation of the messaging source name. - * - *

    Notes: - * - *

    • Source names could be constructed from templates. An example - * would be a source name involving a user name or product id. Although the - * source name in this case is of high cardinality, the underlying template - * is of low cardinality and can be effectively used for grouping and - * aggregation.
    - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingSourceTemplate = string("messaging.source.template") - - /** A boolean that is true if the message source is temporary and might not - * exist anymore after messages are processed. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingSourceTemporary = boolean("messaging.source.temporary") - - /** A boolean that is true if the message source is anonymous (could be - * unnamed or have auto-generated name). - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingSourceAnonymous = boolean("messaging.source.anonymous") - - /** The identifier for the consumer receiving a message. For Kafka, set it to - * `{messaging.kafka.consumer.group} - {messaging.kafka.client_id}`, if both - * are present, or only `messaging.kafka.consumer.group`. For brokers, such - * as RabbitMQ and Artemis, set it to the `client_id` of the client consuming - * the message. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. See [[SemanticAttributes.MessagingClientId]]. - */ - @deprecated("Use SemanticAttributes.MessagingClientId instead", "0.3.0") - val MessagingConsumerId = string("messaging.consumer.id") - - /** Client Id for the Consumer or Producer that is handling the message. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. See [[SemanticAttributes.MessagingClientId]]. - */ - @deprecated("Use SemanticAttributes.MessagingClientId instead", "0.3.0") - val MessagingKafkaClientId = string("messaging.kafka.client_id") - - /** Partition the message is received from. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. - */ - @deprecated("There is no replacement", "0.3.0") - val MessagingKafkaSourcePartition = long("messaging.kafka.source.partition") - - /** The unique identifier for each client. - * @deprecated - * This item has been removed in 1.21.0 version of the semantic - * conventions. See [[SemanticAttributes.MessagingClientId]]. - */ - @deprecated("Use SemanticAttributes.MessagingClientId instead", "0.3.0") - val MessagingRocketmqClientId = string("messaging.rocketmq.client_id") - - /** Values for [[SemanticAttributes.NetHostConnectionType]]. - * @deprecated - * This item has been removed as of 1.21.0 of the semantic conventions. Use - * [[SemanticAttributes.NetworkConnectionTypeValue]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkConnectionTypeValue", "0.3.0") - abstract class NetHostConnectionTypeValue(val value: String) - @annotation.nowarn("cat=deprecation") - object NetHostConnectionTypeValue { - - /** wifi. */ - case object Wifi extends NetHostConnectionTypeValue("wifi") - - /** wired. */ - case object Wired extends NetHostConnectionTypeValue("wired") - - /** cell. */ - case object Cell extends NetHostConnectionTypeValue("cell") - - /** unavailable. */ - case object Unavailable extends NetHostConnectionTypeValue("unavailable") - - /** unknown. */ - case object Unknown extends NetHostConnectionTypeValue("unknown") - } - - /** Values for [[SemanticAttributes.NetHostConnectionSubtype]]. - * @deprecated - * This item has been removed as of 1.21.0 of the semantic conventions. Use - * [[SemanticAttributes.NetworkConnectionSubtypeValue]] instead. - */ - @deprecated("Use SemanticAttributes.NetworkConnectionSubtypeValue", "0.3.0") - abstract class NetHostConnectionSubtypeValue(val value: String) - @annotation.nowarn("cat=deprecation") - object NetHostConnectionSubtypeValue { - - /** GPRS. */ - case object Gprs extends NetHostConnectionSubtypeValue("gprs") - - /** EDGE. */ - case object Edge extends NetHostConnectionSubtypeValue("edge") - - /** UMTS. */ - case object Umts extends NetHostConnectionSubtypeValue("umts") - - /** CDMA. */ - case object Cdma extends NetHostConnectionSubtypeValue("cdma") - - /** EVDO Rel. 0. */ - case object Evdo0 extends NetHostConnectionSubtypeValue("evdo_0") - - /** EVDO Rev. A. */ - case object EvdoA extends NetHostConnectionSubtypeValue("evdo_a") - - /** CDMA2000 1XRTT. */ - case object Cdma20001xrtt - extends NetHostConnectionSubtypeValue("cdma2000_1xrtt") - - /** HSDPA. */ - case object Hsdpa extends NetHostConnectionSubtypeValue("hsdpa") - - /** HSUPA. */ - case object Hsupa extends NetHostConnectionSubtypeValue("hsupa") - - /** HSPA. */ - case object Hspa extends NetHostConnectionSubtypeValue("hspa") - - /** IDEN. */ - case object Iden extends NetHostConnectionSubtypeValue("iden") - - /** EVDO Rev. B. */ - case object EvdoB extends NetHostConnectionSubtypeValue("evdo_b") - - /** LTE. */ - case object Lte extends NetHostConnectionSubtypeValue("lte") - - /** EHRPD. */ - case object Ehrpd extends NetHostConnectionSubtypeValue("ehrpd") - - /** HSPAP. */ - case object Hspap extends NetHostConnectionSubtypeValue("hspap") - - /** GSM. */ - case object Gsm extends NetHostConnectionSubtypeValue("gsm") - - /** TD-SCDMA. */ - case object TdScdma extends NetHostConnectionSubtypeValue("td_scdma") - - /** IWLAN. */ - case object Iwlan extends NetHostConnectionSubtypeValue("iwlan") - - /** 5G NR (New Radio). */ - case object Nr extends NetHostConnectionSubtypeValue("nr") - - /** 5G NRNSA (New Radio Non-Standalone). */ - case object Nrnsa extends NetHostConnectionSubtypeValue("nrnsa") - - /** LTE CA. */ - case object LteCa extends NetHostConnectionSubtypeValue("lte_ca") - } - - /** Immediate client peer port number. - * - * @deprecated - * This item has been renamed in 1.22.0 of the semantic conventions. Use - * [[SemanticAttributes.NetworkPeerPort]] on server telemetry and - * [[SemanticAttributes.NetworkLocalPort]] on client telemetry instead. - */ - @deprecated( - "Use SemanticAttributes.NetworkPeerPort or SemanticAttributes.NetworkLocalPort instead", - "0.4.0" - ) - val ClientSocketPort = long("client.socket.port") - - /** Name of the memory pool. - * - *

    Notes: - * - *

    - * @deprecated - * This item has been renamed in 1.22.0 of the semantic conventions. Use - * [[SemanticAttributes.JvmMemoryPoolName]] instead. - */ - @deprecated("Use SemanticAttributes.JvmMemoryPoolName instead", "0.4.0") - val Pool = string("pool") - - /** The domain name of the source system. - * - *

    Notes: - * - *

    • This value may be a host name, a fully qualified domain name, or - * another host naming format.
    - * @deprecated - * This item has been removed in 1.22.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.4.0") - val SourceDomain = string("source.domain") - - /** Physical server IP address or Unix socket address. If set from the client, - * should simply use the socket's peer address, and not attempt to find any - * actual server IP (i.e., if set from client, this may represent some proxy - * server instead of the logical server). - * - * @deprecated - * This item has been renamed in 1.22.0 of the semantic conventions. Use - * [[SemanticAttributes.NetworkLocalAddress]] on server telemetry and - * [[SemanticAttributes.NetworkPeerAddress]] on client telemetry instead. - */ - @deprecated( - "Use SemanticAttributes.NetworkLocalAddress or SemanticAttributes.NetworkPeerAddress instead", - "0.4.0" - ) - val ServerSocketAddress = string("server.socket.address") - - /** The (uncompressed) size of the message payload in bytes. Also use this - * attribute if it is unknown whether the compressed or uncompressed payload - * size is reported. - * - * @deprecated - * This item has been renamed in 1.22.0 of the semantic conventions. Use - * [[SemanticAttributes.MessagingMessageBodySize]] instead. - */ - @deprecated( - "Use SemanticAttributes.MessagingMessageBodySize instead", - "0.4.0" - ) - val MessagingMessagePayloadSizeBytes = long( - "messaging.message.payload_size_bytes" - ) - - /** The domain name of the destination system. - * - * @deprecated - * This item has been removed in 1.22.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.4.0") - val DestinationDomain = string("destination.domain") - - /** The compressed size of the message payload in bytes. - * - * @deprecated - * This item has been removed in 1.22.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.4.0") - val MessagingMessagePayloadCompressedSizeBytes = long( - "messaging.message.payload_compressed_size_bytes" - ) - - /** The domain name of an immediate peer. - * - *

    Notes: - * - *

    • Typically observed from the client side, and represents a proxy - * or other intermediary domain name.
    - * - * @deprecated - * This item has been removed in 1.22.0 of the semantic conventions. - */ - @deprecated("There is no replacement", "0.4.0") - val ServerSocketDomain = string("server.socket.domain") - - /** The type of memory. - * - * @deprecated - * This item has been renamed in 1.22.0 of the semantic conventions. Use - * [[SemanticAttributes.JvmMemoryType]] instead. - */ - @deprecated("Use SemanticAttributes.JvmMemoryType instead", "0.4.0") - val Type = string("type") - - /** Physical server port. - * - * @deprecated - * This item has been renamed in 1.22.0 of the semantic conventions. Use - * [[SemanticAttributes.NetworkLocalPort]] on server telemetry and - * [[SemanticAttributes.NetworkPeerPort]] on client telemetry instead. - */ - @deprecated( - "Use SemanticAttributes.NetworkLocalPort or SemanticAttributes.NetworkPeerPort instead", - "0.4.0" - ) - val ServerSocketPort = long("server.socket.port") - - /** Immediate client peer address - unix domain socket name, IPv4 or IPv6 - * address. - * - * @deprecated - * This item has been renamed in 1.22.0 of the semantic conventions. Use - * [[SemanticAttributes.NetworkPeerAddress]] on server telemetry and - * [[SemanticAttributes.NetworkLocalAddress]] on client telemetry instead. - */ - @deprecated( - "Use SemanticAttributes.NetworkPeerAddress or SemanticAttributes.NetworkLocalAddress instead", - "0.4.0" - ) - val ClientSocketAddress = string("client.socket.address") - - /** @deprecated - * This item has been renamed as of 1.21.0 of the semantic conventions. Use - * [[SemanticAttributes.JvmMemoryTypeValue]] instead. - */ - @deprecated("Use SemanticAttributes.JvmMemoryTypeValue instead", "0.4.0") - abstract class TypeValue(val value: String) - @annotation.nowarn("cat=deprecation") - object TypeValue { - - /** Heap memory. */ - case object Heap extends TypeValue("heap") - - /** Non-heap memory. */ - case object NonHeap extends TypeValue("non_heap") - } - - /** Whether the thread is daemon or not. - * - * @deprecated - * This item has been renamed in 1.23.1 of the semantic conventions. Use - * [[SemanticAttributes.JvmThreadDaemon]] instead. - */ - @deprecated("Use SemanticAttributes.JvmThreadDaemon instead", "0.4.0") - val ThreadDaemon = boolean("thread.daemon") - - /** The ordinal number of request resending attempt (for any reason, including - * redirects). - * - *

    Notes: - * - *

    • The resend count SHOULD be updated each time an HTTP request gets - * resent by the client, regardless of what was the cause of the resending - * (e.g. redirection, authorization failure, 503 Server Unavailable, network - * issues, or any other).
    - * - * @deprecated - * This item has been renamed in 1.23.1 of the semantic conventions. Use - * [[SemanticAttributes.HttpRequestResendCount]] instead. - */ - @deprecated("Use SemanticAttributes.HttpRequestResendCount instead", "0.4.0") - val HttpResendCount = long("http.resend_count") - -} diff --git a/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ClientAttributes.scala b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ClientAttributes.scala new file mode 100644 index 000000000..bdcec0dcc --- /dev/null +++ b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ClientAttributes.scala @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ClientAttributes { + + /** Client address - domain name if available without reverse DNS lookup; + * otherwise, IP address or Unix domain socket name. + * + * @note + * - When observed from the server side, and when communicating through an + * intermediary, `client.address` SHOULD represent the client address + * behind any intermediaries, for example proxies, if it's available. + */ + val ClientAddress: AttributeKey[String] = string("client.address") + + /** Client port number. + * + * @note + * - When observed from the server side, and when communicating through an + * intermediary, `client.port` SHOULD represent the client port behind + * any intermediaries, for example proxies, if it's available. + */ + val ClientPort: AttributeKey[Long] = long("client.port") + +} diff --git a/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ErrorAttributes.scala b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ErrorAttributes.scala new file mode 100644 index 000000000..d924f697c --- /dev/null +++ b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ErrorAttributes.scala @@ -0,0 +1,58 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ErrorAttributes { + + /** Describes a class of error the operation ended with. + * + * @note + * - The `error.type` SHOULD be predictable and SHOULD have low + * cardinality. Instrumentations SHOULD document the list of errors they + * report. + * - The cardinality of `error.type` within one instrumentation library + * SHOULD be low. Telemetry consumers that aggregate data from multiple + * instrumentation libraries and applications should be prepared for + * `error.type` to have high cardinality at query time when no additional + * filters are applied. + * - If the operation has completed successfully, instrumentations SHOULD + * NOT set `error.type`. + * - If a specific domain defines its own set of error identifiers (such as + * HTTP or gRPC status codes), it's RECOMMENDED to:
  • Use a + * domain-specific attribute
  • Set `error.type` to capture all + * errors, regardless of whether they are defined within the + * domain-specific set or not.
  • + */ + val ErrorType: AttributeKey[String] = string("error.type") + // Enum definitions + + /** Values for [[ErrorType]]. + */ + abstract class ErrorTypeValue(val value: String) + object ErrorTypeValue { + + /** A fallback error value to be used when the instrumentation doesn't + * define a custom value. + */ + case object Other extends ErrorTypeValue("_OTHER") + } + +} diff --git a/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/HttpAttributes.scala b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/HttpAttributes.scala new file mode 100644 index 000000000..061dbb044 --- /dev/null +++ b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/HttpAttributes.scala @@ -0,0 +1,165 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object HttpAttributes { + + /** HTTP request headers, `` being the normalized HTTP Header name + * (lowercase), the value being the header values. + * + * @note + * - Instrumentations SHOULD require an explicit configuration of which + * headers are to be captured. Including all request headers can be a + * security risk - explicit configuration helps avoid leaking sensitive + * information. The `User-Agent` header is already captured in the + * `user_agent.original` attribute. Users MAY explicitly configure + * instrumentations to capture them even though it is not recommended. + * The attribute value MUST consist of either multiple header values as + * an array of strings or a single-item array containing a possibly + * comma-concatenated string, depending on the way the HTTP library + * provides access to headers. + */ + val HttpRequestHeader: AttributeKey[Seq[String]] = stringSeq( + "http.request.header" + ) + + /** HTTP request method. + * + * @note + * - HTTP request method value SHOULD be "known" to the + * instrumentation. By default, this convention defines "known" + * methods as the ones listed in RFC9110 + * and the PATCH method defined in RFC5789. + * - If the HTTP request method is not known to instrumentation, it MUST + * set the `http.request.method` attribute to `_OTHER`. + * - If the HTTP instrumentation could end up converting valid HTTP request + * methods to `_OTHER`, then it MUST provide a way to override the list + * of known HTTP methods. If this override is done via environment + * variable, then the environment variable MUST be named + * OTEL_INSTRUMENTATION_HTTP_KNOWN_METHODS and support a comma-separated + * list of case-sensitive known HTTP methods (this list MUST be a full + * override of the default known method, it is not a list of known + * methods in addition to the defaults). + * - HTTP method names are case-sensitive and `http.request.method` + * attribute value MUST match a known HTTP method name exactly. + * Instrumentations for specific web frameworks that consider HTTP + * methods to be case insensitive, SHOULD populate a canonical + * equivalent. Tracing instrumentations that do so, MUST also set + * `http.request.method_original` to the original value. + */ + val HttpRequestMethod: AttributeKey[String] = string("http.request.method") + + /** Original HTTP method sent by the client in the request line. + */ + val HttpRequestMethodOriginal: AttributeKey[String] = string( + "http.request.method_original" + ) + + /** The ordinal number of request resending attempt (for any reason, including + * redirects). + * + * @note + * - The resend count SHOULD be updated each time an HTTP request gets + * resent by the client, regardless of what was the cause of the + * resending (e.g. redirection, authorization failure, 503 Server + * Unavailable, network issues, or any other). + */ + val HttpRequestResendCount: AttributeKey[Long] = long( + "http.request.resend_count" + ) + + /** HTTP response headers, `` being the normalized HTTP Header name + * (lowercase), the value being the header values. + * + * @note + * - Instrumentations SHOULD require an explicit configuration of which + * headers are to be captured. Including all response headers can be a + * security risk - explicit configuration helps avoid leaking sensitive + * information. Users MAY explicitly configure instrumentations to + * capture them even though it is not recommended. The attribute value + * MUST consist of either multiple header values as an array of strings + * or a single-item array containing a possibly comma-concatenated + * string, depending on the way the HTTP library provides access to + * headers. + */ + val HttpResponseHeader: AttributeKey[Seq[String]] = stringSeq( + "http.response.header" + ) + + /** HTTP response + * status code. + */ + val HttpResponseStatusCode: AttributeKey[Long] = long( + "http.response.status_code" + ) + + /** The matched route, that is, the path template in the format used by the + * respective server framework. + * + * @note + * - MUST NOT be populated when this is not supported by the HTTP server + * framework as the route attribute should have low-cardinality and the + * URI path can NOT substitute it. SHOULD include the application + * root if there is one. + */ + val HttpRoute: AttributeKey[String] = string("http.route") + // Enum definitions + + /** Values for [[HttpRequestMethod]]. + */ + abstract class HttpRequestMethodValue(val value: String) + object HttpRequestMethodValue { + + /** CONNECT method. */ + case object Connect extends HttpRequestMethodValue("CONNECT") + + /** DELETE method. */ + case object Delete extends HttpRequestMethodValue("DELETE") + + /** GET method. */ + case object Get extends HttpRequestMethodValue("GET") + + /** HEAD method. */ + case object Head extends HttpRequestMethodValue("HEAD") + + /** OPTIONS method. */ + case object Options extends HttpRequestMethodValue("OPTIONS") + + /** PATCH method. */ + case object Patch extends HttpRequestMethodValue("PATCH") + + /** POST method. */ + case object Post extends HttpRequestMethodValue("POST") + + /** PUT method. */ + case object Put extends HttpRequestMethodValue("PUT") + + /** TRACE method. */ + case object Trace extends HttpRequestMethodValue("TRACE") + + /** Any HTTP method that the instrumentation has no prior knowledge of. */ + case object Other extends HttpRequestMethodValue("_OTHER") + } + +} diff --git a/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/JvmAttributes.scala b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/JvmAttributes.scala new file mode 100644 index 000000000..dc61a94ad --- /dev/null +++ b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/JvmAttributes.scala @@ -0,0 +1,102 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object JvmAttributes { + + /** Name of the garbage collector action. + * + * @note + * - Garbage collector action is generally obtained via GarbageCollectionNotificationInfo#getGcAction(). + */ + val JvmGcAction: AttributeKey[String] = string("jvm.gc.action") + + /** Name of the garbage collector. + * + * @note + * - Garbage collector name is generally obtained via GarbageCollectionNotificationInfo#getGcName(). + */ + val JvmGcName: AttributeKey[String] = string("jvm.gc.name") + + /** Name of the memory pool. + * + * @note + * - Pool names are generally obtained via MemoryPoolMXBean#getName(). + */ + val JvmMemoryPoolName: AttributeKey[String] = string("jvm.memory.pool.name") + + /** The type of memory. + */ + val JvmMemoryType: AttributeKey[String] = string("jvm.memory.type") + + /** Whether the thread is daemon or not. + */ + val JvmThreadDaemon: AttributeKey[Boolean] = boolean("jvm.thread.daemon") + + /** State of the thread. + */ + val JvmThreadState: AttributeKey[String] = string("jvm.thread.state") + // Enum definitions + + /** Values for [[JvmMemoryType]]. + */ + abstract class JvmMemoryTypeValue(val value: String) + object JvmMemoryTypeValue { + + /** Heap memory. */ + case object Heap extends JvmMemoryTypeValue("heap") + + /** Non-heap memory. */ + case object NonHeap extends JvmMemoryTypeValue("non_heap") + } + + /** Values for [[JvmThreadState]]. + */ + abstract class JvmThreadStateValue(val value: String) + object JvmThreadStateValue { + + /** A thread that has not yet started is in this state. */ + case object New extends JvmThreadStateValue("new") + + /** A thread executing in the Java virtual machine is in this state. */ + case object Runnable extends JvmThreadStateValue("runnable") + + /** A thread that is blocked waiting for a monitor lock is in this state. */ + case object Blocked extends JvmThreadStateValue("blocked") + + /** A thread that is waiting indefinitely for another thread to perform a + * particular action is in this state. + */ + case object Waiting extends JvmThreadStateValue("waiting") + + /** A thread that is waiting for another thread to perform an action for up + * to a specified waiting time is in this state. + */ + case object TimedWaiting extends JvmThreadStateValue("timed_waiting") + + /** A thread that has exited is in this state. */ + case object Terminated extends JvmThreadStateValue("terminated") + } + +} diff --git a/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/NetworkAttributes.scala b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/NetworkAttributes.scala new file mode 100644 index 000000000..8c80f8ea9 --- /dev/null +++ b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/NetworkAttributes.scala @@ -0,0 +1,120 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object NetworkAttributes { + + /** Local address of the network connection - IP address or Unix domain socket + * name. + */ + val NetworkLocalAddress: AttributeKey[String] = string( + "network.local.address" + ) + + /** Local port number of the network connection. + */ + val NetworkLocalPort: AttributeKey[Long] = long("network.local.port") + + /** Peer address of the network connection - IP address or Unix domain socket + * name. + */ + val NetworkPeerAddress: AttributeKey[String] = string("network.peer.address") + + /** Peer port number of the network connection. + */ + val NetworkPeerPort: AttributeKey[Long] = long("network.peer.port") + + /** OSI application + * layer or non-OSI equivalent. + * + * @note + * - The value SHOULD be normalized to lowercase. + */ + val NetworkProtocolName: AttributeKey[String] = string( + "network.protocol.name" + ) + + /** Version of the protocol specified in `network.protocol.name`. + * + * @note + * - `network.protocol.version` refers to the version of the protocol used + * and might be different from the protocol client's version. If the HTTP + * client has a version of `0.27.2`, but sends HTTP version `1.1`, this + * attribute should be set to `1.1`. + */ + val NetworkProtocolVersion: AttributeKey[String] = string( + "network.protocol.version" + ) + + /** OSI transport layer + * or inter-process + * communication method. + * + * @note + * - The value SHOULD be normalized to lowercase. + * - Consider always setting the transport when setting a port number, + * since a port number is ambiguous without knowing the transport. For + * example different processes could be listening on TCP port 12345 and + * UDP port 12345. + */ + val NetworkTransport: AttributeKey[String] = string("network.transport") + + /** OSI network layer or + * non-OSI equivalent. + * + * @note + * - The value SHOULD be normalized to lowercase. + */ + val NetworkType: AttributeKey[String] = string("network.type") + // Enum definitions + + /** Values for [[NetworkTransport]]. + */ + abstract class NetworkTransportValue(val value: String) + object NetworkTransportValue { + + /** TCP. */ + case object Tcp extends NetworkTransportValue("tcp") + + /** UDP. */ + case object Udp extends NetworkTransportValue("udp") + + /** Named or anonymous pipe. */ + case object Pipe extends NetworkTransportValue("pipe") + + /** Unix domain socket. */ + case object Unix extends NetworkTransportValue("unix") + } + + /** Values for [[NetworkType]]. + */ + abstract class NetworkTypeValue(val value: String) + object NetworkTypeValue { + + /** IPv4. */ + case object Ipv4 extends NetworkTypeValue("ipv4") + + /** IPv6. */ + case object Ipv6 extends NetworkTypeValue("ipv6") + } + +} diff --git a/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ServerAttributes.scala b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ServerAttributes.scala new file mode 100644 index 000000000..0b730805f --- /dev/null +++ b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/ServerAttributes.scala @@ -0,0 +1,44 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object ServerAttributes { + + /** Server domain name if available without reverse DNS lookup; otherwise, IP + * address or Unix domain socket name. + * + * @note + * - When observed from the client side, and when communicating through an + * intermediary, `server.address` SHOULD represent the server address + * behind any intermediaries, for example proxies, if it's available. + */ + val ServerAddress: AttributeKey[String] = string("server.address") + + /** Server port number. + * + * @note + * - When observed from the client side, and when communicating through an + * intermediary, `server.port` SHOULD represent the server port behind + * any intermediaries, for example proxies, if it's available. + */ + val ServerPort: AttributeKey[Long] = long("server.port") + +} diff --git a/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/UrlAttributes.scala b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/UrlAttributes.scala new file mode 100644 index 000000000..b1a1aee36 --- /dev/null +++ b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/UrlAttributes.scala @@ -0,0 +1,67 @@ +/* + * Copyright 2023 Typelevel + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.typelevel.otel4s.semconv.attributes + +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ + +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object UrlAttributes { + + /** The URI + * fragment component + */ + val UrlFragment: AttributeKey[String] = string("url.fragment") + + /** Absolute URL describing a network resource according to RFC3986 + * + * @note + * - For network calls, URL usually has + * `scheme://host[:port][path][?query][#fragment]` format, where the + * fragment is not transmitted over HTTP, but if it is known, it SHOULD + * be included nevertheless. `url.full` MUST NOT contain credentials + * passed via URL in form of + * `https://username:password@www.example.com/`. In such case username + * and password SHOULD be redacted and attribute's value SHOULD be + * `https://REDACTED:REDACTED@www.example.com/`. `url.full` SHOULD + * capture the absolute URL when it is available (or can be + * reconstructed) and SHOULD NOT be validated or modified except for + * sanitizing purposes. + */ + val UrlFull: AttributeKey[String] = string("url.full") + + /** The URI + * path component + */ + val UrlPath: AttributeKey[String] = string("url.path") + + /** The URI + * query component + * + * @note + * - Sensitive content provided in query string SHOULD be scrubbed when + * instrumentations can identify it. + */ + val UrlQuery: AttributeKey[String] = string("url.query") + + /** The URI + * scheme component identifying the used protocol. + */ + val UrlScheme: AttributeKey[String] = string("url.scheme") + +} diff --git a/semconv/src/test/scala/org/typelevel/otel4s/semconv/resource/attributes/ResourceAttributesSuite.scala b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/UserAgentAttributes.scala similarity index 53% rename from semconv/src/test/scala/org/typelevel/otel4s/semconv/resource/attributes/ResourceAttributesSuite.scala rename to semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/UserAgentAttributes.scala index 374e853ab..aced41e92 100644 --- a/semconv/src/test/scala/org/typelevel/otel4s/semconv/resource/attributes/ResourceAttributesSuite.scala +++ b/semconv/stable/src/main/scala/org/typelevel/otel4s/semconv/UserAgentAttributes.scala @@ -14,21 +14,18 @@ * limitations under the License. */ -package org.typelevel.otel4s.semconv -package resource.attributes +package org.typelevel.otel4s.semconv.attributes -import munit._ +import org.typelevel.otel4s.AttributeKey +import org.typelevel.otel4s.AttributeKey._ -class ResourceAttributesSuite extends FunSuite { +// DO NOT EDIT, this is an Auto-generated file from buildscripts/semantic-convention/templates/SemanticAttributes.scala.j2 +object UserAgentAttributes { - test("the schema url should match with the sem conv version") { - val version = - BuildInfo.openTelemetrySemanticConventionsVersion.stripSuffix("-alpha") - - assertEquals( - ResourceAttributes.SchemaUrl, - s"https://opentelemetry.io/schemas/$version" - ) - } + /** Value of the HTTP + * User-Agent header sent by the client. + */ + val UserAgentOriginal: AttributeKey[String] = string("user_agent.original") }