Commit Graph

5 Commits

Author SHA1 Message Date
Jade Guiton 545866fcf8
Emit `outcome: failure` in obsconsumer (#13234)
#### Description
The last remaining part of #12676 is to implement the `outcome: failure`
part of the Pipeline Component Telemetry RFC ([see
here](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/rfcs/component-universal-telemetry.md#auto-instrumented-metrics)).
This is done by introducing a `downstream` error wrapper struct, to
distinguish between errors coming from the next component from errors
bubbled from further downstream.

#### Important note
This PR implements things slightly differently from what the text of the
RFC describes.

If a pipeline contains components `A → B` and an error occurs in B, this
PR records:
- `otelcol.component.outcome = failure` in the `otelcol.*.consumed.*`
metric for B
- `otelcol.component.outcome = refused` in the `otelcol.*.produced.*`
metric for A

whereas the RFC would set both `outcome`s to `failure`.

This is programmatically simpler — no need to have different behavior
between the `obsconsumer` around the output of A and the one around the
input of B — but more importantly, I think it is clearer for users as
well: `outcome = failure` only occurs on metrics associated with the
component where the failure actually occurred.

This subtlety wasn't discussed in-depth in #11956 which introduced
`outcome = refused`, so I took the liberty to make this change. If
necessary, I can file another RFC amendment to match, or, if there are
objections, implement the RFC as-is instead.

#### Link to tracking issue
Fixes #12676

#### Testing
I've updated the existing tests in `obsconsumer` to expect a
`downstream`-wrapped error to exit the `obsconsumer` layer. I may add
more tests later.

#### Documentation
None.

---------

Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2025-07-25 10:19:48 +00:00
Daniel Jaglowski 178caa125e
[service/internal/graph] Add size throughput metrics (#13032)
Follows #12812

This PR adds the `size` metrics defined in the [Pipeline Component
Telemetry
RFC](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/rfcs/component-universal-telemetry.md).
2025-05-20 11:45:33 +00:00
Daniel Jaglowski 279752c11f
[service/internal/graph] Measure telemetry as it is passed between pipeline components (#12812)
Depends on
https://github.com/open-telemetry/opentelemetry-collector/pull/12856

Resolves #12676

This is a reboot of #11311, incorporating metrics defined in the
[component telemetry
RFC](https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/rfcs/component-universal-telemetry.md)
and attributes added in #12617.

The basic pattern is:
- When building any pipeline component which produces data, wrap the
"next consumer" with instrumentation to measure the number of items
being passed. This wrapped consumer is then passed into the constructor
of the component.
- When building any pipeline component which consumes data, wrap the
component itself. This wrapped consumer is saved onto the graph node so
that it can be retrieved during graph assembly.

---------

Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2025-05-12 08:33:02 +00:00
Daniel Jaglowski 56c7da2107
[chore] Update obsconsumer to use new attribute name (#12959)
Implements new name for attribute as documented in #12951.

Note: The obsconsumer package is unused until #12812 is merged so this
is not a breaking change.
2025-05-05 15:27:26 +00:00
Daniel Jaglowski 55f569d83e
[chore] Create service/internal/obsconsumer package (#12817)
Subset of #12812

This internal package defines wrappers around consumers. These are
useful for instrumenting the component graph, so that we can generate
telemetry describing data as it is passed in between components.

Currently, this supports only a single counter metric, but in the near
future it can be enhanced to automatically capture multiple metrics
(e.g. item count & size), and potentially spans and/or logs as well.
2025-04-15 10:40:55 +00:00