Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define semantic conventions yaml for non-otlp conventions #2850

Merged
merged 6 commits into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions semantic_conventions/scope/exporter/exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
groups:
- id: otel.scope
prefix: otel.scope
type: resource
brief: Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts.
attributes:
- id: name
bogdandrutu marked this conversation as resolved.
Show resolved Hide resolved
type: string
brief: The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP).
examples: ['io.opentelemetry.contrib.mongodb']
- id: version
type: string
brief: The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP).
examples: ['1.0.0']
- id: otel.library
prefix: otel.library
type: resource
brief: >
Span attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concepts.
attributes:
- id: name
type: string
stability: "deprecated"
brief: Deprecated, use the `otel.scope.name` attribute.
examples: ['io.opentelemetry.contrib.mongodb']
- id: version
type: string
stability: "deprecated"
brief: Deprecated, use the `otel.scope.version` attribute.
examples: ['1.0.0']
21 changes: 21 additions & 0 deletions semantic_conventions/trace/exporter/exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
groups:
- id: otel_span
prefix: otel
type: span
brief: Span attributes used by non-OTLP exporters to represent OpenTelemetry Span's concepts.
attributes:
- id: status_code
type:
allow_custom_values: false
members:
- id: ok
value: OK
brief: 'The operation has been validated by an Application developer or Operator to have completed successfully.'
- id: error
value: ERROR
brief: 'The operation contains an error.'
brief: Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET.
- id: status_description
type: string
brief: Description of the Status if it has a value, otherwise not set.
examples: ['resource not found']
37 changes: 25 additions & 12 deletions specification/common/mapping-to-non-otlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,22 @@ in this document.
OpenTelemetry `InstrumentationScope`'s fields MUST be reported as key-value
pairs associated with the Span, Metric Data Point or LogRecord using the following mapping:

| OpenTelemetry InstrumentationScope Field | non-OTLP Key | Notes |
| ------------------- | --- | --- |
| `InstrumentationScope.name`|`otel.scope.name`|since 1.10.0|
| `InstrumentationScope.version`|`otel.scope.version`|since 1.10.0|
<!-- semconv otel.scope -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `otel.scope.name` | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | Recommended |
| `otel.scope.version` | string | The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). | `1.0.0` | Recommended |
<!-- endsemconv -->

The following deprecated aliases MUST also be reported with exact same values for
backward compatibility reasons:

| non-OTLP Key | Alias for | Notes |
| --- | --- | --- |
|`otel.library.name`|`otel.scope.name`|deprecated since 1.10.0|
|`otel.library.version`|`otel.scope.version`|deprecated since 1.10.0|
<!-- semconv otel.library -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `otel.library.name` | string | Deprecated, use the `otel.scope.name` attribute. | `io.opentelemetry.contrib.mongodb` | Recommended |
| `otel.library.version` | string | Deprecated, use the `otel.scope.version` attribute. | `1.0.0` | Recommended |
<!-- endsemconv -->

### Span Status

Expand All @@ -48,10 +52,19 @@ unless the `Status` is `UNSET`. In the latter case it MUST NOT be reported.
The following table defines the OpenTelemetry `Status`'s mapping to Span's
key-value pairs:

|OpenTelemetry Status Field|non-OTLP Key|non-OTLP Value|
|--|--|--|
|Code | `otel.status_code` | Name of the code, either `OK` or `ERROR`. MUST NOT be set if the code is `UNSET`. |
|Description | `otel.status_description` | Description of the `Status` if it has a value otherwise not set. |
<!-- semconv otel_span -->
| Attribute | Type | Description | Examples | Requirement Level |
|---|---|---|---|---|
| `otel.status_code` | string | Name of the code, either "OK" or "ERROR". MUST NOT be set if the status code is UNSET. | `OK` | Recommended |
| `otel.status_description` | string | Description of the Status if it has a value, otherwise not set. | `resource not found` | Recommended |

`otel.status_code` MUST be one of the following:

| Value | Description |
|---|---|
| `OK` | The operation has been validated by an Application developer or Operator to have completed successfully. |
| `ERROR` | The operation contains an error. |
<!-- endsemconv -->

### Dropped Attributes Count

Expand Down