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

Add SDK span telemetry metrics #1631

Open
wants to merge 32 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
8f2b666
Added SDK span telemetry metrics
JonasKunz Nov 29, 2024
8b2a1db
Fix formatting
JonasKunz Nov 29, 2024
8bbea82
Fix yamllint
JonasKunz Nov 29, 2024
e15696f
Merge remote-tracking branch 'otel/main' into sdk-telemetry
JonasKunz Nov 29, 2024
cef63f2
Changelog
JonasKunz Nov 29, 2024
c24bccc
Reuse error.type
JonasKunz Nov 29, 2024
34e56e7
Use enum for processor and exporter type attributes
JonasKunz Nov 29, 2024
4248917
Renamed trace to span namespace
JonasKunz Nov 29, 2024
2174d24
Fixed invalid metric name
JonasKunz Nov 29, 2024
0e54b96
fix lots of dumb mistakes
JonasKunz Nov 29, 2024
c62be64
Added queue_capacity metric
JonasKunz Nov 29, 2024
2f491df
Clarified meaning of submitted
JonasKunz Dec 3, 2024
1388eac
replaced spans_failed with spans_processed metric
JonasKunz Dec 3, 2024
2c60a71
Tried clarifying elemetry.sdk.component.id
JonasKunz Dec 3, 2024
0cfb94d
Merge branch 'main' into sdk-telemetry
JonasKunz Dec 6, 2024
15b37aa
Merge branch 'main' into sdk-telemetry
JonasKunz Jan 2, 2025
8ae4b58
Merge branch 'main' into sdk-telemetry
JonasKunz Jan 13, 2025
67ab2d0
Moved from telemetry. to otel. namespace
JonasKunz Jan 14, 2025
598636f
mend
JonasKunz Jan 14, 2025
b0fd83d
Rename spans_submitted to spans_exported
JonasKunz Jan 14, 2025
27f7690
Cleanup metrics with review suggestions
JonasKunz Jan 14, 2025
f1e1404
Clarify rejected data handling
JonasKunz Jan 14, 2025
4db7605
removed type in favor of component.name
JonasKunz Jan 14, 2025
26e21b2
Use {span} as unit
JonasKunz Jan 14, 2025
0ce6583
Merge branch 'main' into sdk-telemetry
JonasKunz Jan 14, 2025
820c5c6
Lint fixes
JonasKunz Jan 14, 2025
ef5bd53
Remove trailing empty line
JonasKunz Jan 14, 2025
8c10557
Merge branch 'main' into sdk-telemetry
JonasKunz Jan 16, 2025
ff663de
Merge branch 'main' into sdk-telemetry
JonasKunz Jan 17, 2025
833352b
Fix attribute registry name
JonasKunz Jan 20, 2025
226b42f
Renamed otel.is_sampled to otel.span.is_sampled
JonasKunz Jan 20, 2025
a5374c3
Merge branch 'main' into sdk-telemetry
JonasKunz Jan 20, 2025
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
Prev Previous commit
Next Next commit
Moved from telemetry. to otel. namespace
  • Loading branch information
JonasKunz committed Jan 14, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 67ab2d072c228fcb5dbb7873bbe0e02c6f769619
39 changes: 39 additions & 0 deletions docs/attributes-registry/otel.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@

- [OTel Attributes](#otel-attributes)
- [OTel Scope Attributes](#otel-scope-attributes)
- [OTel Scope Attributes](#otel-scope-attributes)
- [Deprecated OTel Library Attributes](#deprecated-otel-library-attributes)

## OTel Attributes
@@ -37,6 +38,44 @@ Attributes used by non-OTLP exporters to represent OpenTelemetry Scope's concept
| <a id="otel-scope-name" href="#otel-scope-name">`otel.scope.name`</a> | string | The name of the instrumentation scope - (`InstrumentationScope.Name` in OTLP). | `io.opentelemetry.contrib.mongodb` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="otel-scope-version" href="#otel-scope-version">`otel.scope.version`</a> | string | The version of the instrumentation scope - (`InstrumentationScope.Version` in OTLP). | `1.0.0` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

## OTel Scope Attributes

Attributes used for OpenTelemetry SDK self-monitoring

| Attribute | Type | Description | Examples | Stability |
|---|---|---|---|---|
| <a id="otel-sdk-component-id" href="#otel-sdk-component-id">`otel.sdk.component.id`</a> | string | A name uniquely identifying the instance of the OpenTelemetry SDK component within its containing SDK instance. [1] | `batch-span-0`; `custom-name` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="otel-sdk-exporter-type" href="#otel-sdk-exporter-type">`otel.sdk.exporter.type`</a> | string | A name identifying the type of the OpenTelemetry SDK exporter. | `otlp-grpc`; `jaeger` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="otel-sdk-processor-type" href="#otel-sdk-processor-type">`otel.sdk.processor.type`</a> | string | A name identifying the type of the OpenTelemetry SDK processor. | `batch-span`; `MyCustomProcessor` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

**[1] `otel.sdk.component.id`:** The SDK components MAY allow users to provide an id for the component instances. If no id is provided by the user,
the components SHOULD automatically assign an id. Because this attribute is used in metrics, the component implementation MUST ensure a low cardinality in that case.
E.g. it MUST NOT use a UUID.
It instead MAY do that by using the following pattern as value: `<otel.sdk.processor/exporter.type>-<instance-counter>`:
Hereby, `<instance-counter>` is a monotonically increasing counter (starting with `0`), which is incremented every time an
instance of the given component type is started.
For example, the first Batch Span Processor will have `batch-span-0` as `otel.sdk.component.id`, the second one `batch-span-1` and so one.
These values will therefore be reused in the case of an application restart.

---

`otel.sdk.exporter.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
| `otlp-grpc` | OTLP exporter over gRPC with protobuf serialization | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `otlp-http` | OTLP exporter over HTTP with protobuf serialization | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `otlp-http-json` | OTLP exporter over HTTP with JSON serialization | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

---

`otel.sdk.processor.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
| `batch-span` | The builtin SDK Batching Span Processor | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `simple-span` | The builtin SDK Simple Span Processor | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

## Deprecated OTel Library Attributes

Describes deprecated otel.library attributes.
35 changes: 2 additions & 33 deletions docs/attributes-registry/telemetry.md
Original file line number Diff line number Diff line change
@@ -14,26 +14,14 @@ This document defines attributes for telemetry SDK.
|---|---|---|---|---|
| <a id="telemetry-distro-name" href="#telemetry-distro-name">`telemetry.distro.name`</a> | string | The name of the auto instrumentation agent or distribution, if used. [1] | `parts-unlimited-java` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="telemetry-distro-version" href="#telemetry-distro-version">`telemetry.distro.version`</a> | string | The version string of the auto instrumentation agent or distribution, if used. | `1.2.3` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="telemetry-sdk-component-id" href="#telemetry-sdk-component-id">`telemetry.sdk.component.id`</a> | string | A name uniquely identifying the instance of the OpenTelemetry SDK component within its containing SDK instance. [2] | `batch-span-0`; `custom-name` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="telemetry-sdk-exporter-type" href="#telemetry-sdk-exporter-type">`telemetry.sdk.exporter.type`</a> | string | A name identifying the type of the OpenTelemetry SDK exporter. | `otlp-grpc`; `jaeger` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="telemetry-sdk-language" href="#telemetry-sdk-language">`telemetry.sdk.language`</a> | string | The language of the telemetry SDK. | `cpp`; `dotnet`; `erlang` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="telemetry-sdk-name" href="#telemetry-sdk-name">`telemetry.sdk.name`</a> | string | The name of the telemetry SDK as defined above. [3] | `opentelemetry` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="telemetry-sdk-processor-type" href="#telemetry-sdk-processor-type">`telemetry.sdk.processor.type`</a> | string | A name identifying the type of the OpenTelemetry SDK processor. | `batch-span`; `MyCustomProcessor` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="telemetry-sdk-name" href="#telemetry-sdk-name">`telemetry.sdk.name`</a> | string | The name of the telemetry SDK as defined above. [2] | `opentelemetry` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| <a id="telemetry-sdk-version" href="#telemetry-sdk-version">`telemetry.sdk.version`</a> | string | The version string of the telemetry SDK. | `1.2.3` | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

**[1] `telemetry.distro.name`:** Official auto instrumentation agents and distributions SHOULD set the `telemetry.distro.name` attribute to
a string starting with `opentelemetry-`, e.g. `opentelemetry-java-instrumentation`.

**[2] `telemetry.sdk.component.id`:** The SDK components MAY allow users to provide an id for the component instances. If no id is provided by the user,
the components SHOULD automatically assign an id. Because this attribute is used in metrics, the component implementation MUST ensure a low cardinality in that case.
E.g. it MUST NOT use a UUID.
It instead MAY do that by using the following pattern as value: `<telemetry.sdk.processor/exporter.type>-<instance-counter>`:
Hereby, `<instance-counter>` is a monotonically increasing counter (starting with `0`), which is incremented every time an
instance of the given component type is started.
For example, the first Batch Span Processor will have `batch-span-0` as `telemetry.sdk.component.id`, the second one `batch-span-1` and so one.
These values will therefore be reused in the case of an application restart.

**[3] `telemetry.sdk.name`:** The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`.
**[2] `telemetry.sdk.name`:** 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.
@@ -42,16 +30,6 @@ All custom identifiers SHOULD be stable across different versions of an implemen

---

`telemetry.sdk.exporter.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
| `otlp-grpc` | OTLP exporter over gRPC with protobuf serialization | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `otlp-http` | OTLP exporter over HTTP with protobuf serialization | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `otlp-http-json` | OTLP exporter over HTTP with JSON serialization | ![Experimental](https://img.shields.io/badge/-experimental-blue) |

---

`telemetry.sdk.language` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
@@ -68,12 +46,3 @@ All custom identifiers SHOULD be stable across different versions of an implemen
| `rust` | rust | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `swift` | swift | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |
| `webjs` | webjs | ![Stable](https://img.shields.io/badge/-stable-lightgreen) |

---

`telemetry.sdk.processor.type` has the following list of well-known values. If one of them applies, then the respective value MUST be used; otherwise, a custom value MAY be used.

| Value | Description | Stability |
|---|---|---|
| `batch-span` | The builtin SDK Batching Span Processor | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| `simple-span` | The builtin SDK Simple Span Processor | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
Loading