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 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
42 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
e9aa0ee
Merge branch 'main' into sdk-telemetry
JonasKunz Jan 22, 2025
53ecd6c
Merge branch 'main' into sdk-telemetry
AlexanderWert Jan 23, 2025
1a82268
Remove leftover unused attributes
JonasKunz Jan 23, 2025
37d5810
Merge branch 'main' into sdk-telemetry
JonasKunz Jan 23, 2025
e737b7d
Added back reworked otel.sdk.component.type attribute
JonasKunz Jan 24, 2025
772d29a
Fix lint
JonasKunz Jan 24, 2025
c99e3ae
Merge branch 'main' into sdk-telemetry
JonasKunz Jan 24, 2025
935c01c
Fix otel.sdk.component.type enum value descriptions
JonasKunz Jan 24, 2025
04c0085
Fix missing _span prefixes
JonasKunz Jan 24, 2025
667028d
Fix another missing _span prefix
JonasKunz Jan 24, 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
22 changes: 22 additions & 0 deletions .chloggen/sdk-telemetry-span-metrics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: 'enhancement'

# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: 'telemetry'
JonasKunz marked this conversation as resolved.
Show resolved Hide resolved

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Adds SDK self-monitoring metrics for span processing

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [1631]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
23 changes: 21 additions & 2 deletions docs/attributes-registry/telemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,39 @@ 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. [3] | `otlp-grpc`; `jaeger` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <a id="telemetry-sdk-failure-reason" href="#telemetry-sdk-failure-reason">`telemetry.sdk.failure_reason`</a> | string | A low-cardinality for why this component failed to process a record. [4] | `queue full`; `exporter failed` | ![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. [2] | `opentelemetry` | ![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. [5] | `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. [6] | `batch-span`; `MyCustomProcessor` | ![Experimental](https://img.shields.io/badge/-experimental-blue) |
| <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.name`:** The OpenTelemetry SDK MUST set the `telemetry.sdk.name` attribute to `opentelemetry`.
**[2] `telemetry.sdk.component.id`:** The SDK MAY allow users to provide an id for the component instances. If no id is provided by the user,
the SDK SHOULD automatically assign an id. Because this attribute is used in metrics, the SDK 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 created.
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.exporter.type`:** For OTLP, the values `otlp-grpc`, `otlp-http` or `otlp-http-json` MUST be used, based on the transport and serialization format.

**[4] `telemetry.sdk.failure_reason`:** For the SDK Batch Span Processor `queue full` MUST be used for when items are dropped due to a full queue.

**[5] `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.
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.

**[6] `telemetry.sdk.processor.type`:** The value `batch-span` MUST be used for the SDK builtin Batch Span Processor.

---

`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.
Expand Down
1 change: 1 addition & 0 deletions docs/general/metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ The following semantic conventions surrounding metrics are defined:
* [Hardware](/docs/system/hardware-metrics.md): For hardware-related metrics.
* [Process](/docs/system/process-metrics.md): For standard process metrics.
* [Runtime Environment](/docs/runtime/README.md#metrics): For runtime environment metrics.
* [SDK Telemetry](/docs/telemetry/telemetry-sdk-metrics.md): Metrics emitted by the OpenTelemetry SDK components.

Apart from semantic conventions for metrics, [traces](trace.md), [logs](logs.md), and [events](events.md), OpenTelemetry also
defines the concept of overarching [Resources](https://github.com/open-telemetry/opentelemetry-specification/tree/v1.39.0/specification/resource/sdk.md) with
Expand Down
Loading
Loading