Commit Graph

10 Commits

Author SHA1 Message Date
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
Pablo Baeyens 29aaad3dfe
[chore] Generate codecov badge for all READMEs (#12962)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

<!-- Issue number if applicable -->

Adds a CodeCov status badge unless explicitly disabled.

I have disabled this in core until we roll this out in contrib to show
the Go SIG and move codecovgen to build tools

#### Link to tracking issue

Updates open-telemetry/opentelemetry-collector-contrib/issues/39583
2025-05-05 15:26:50 +00:00
Alex Boten f74890a388
[service] update telemetry level to reflect their state (#11729)
This sets the level of all metrics that where not previously stabilized
as alpha. Since many of these metrics will change as a result of
https://github.com/open-telemetry/opentelemetry-collector/pull/11406, it
made sense to me to set their stability as alpha.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-11-22 09:53:18 -08:00
Antoine Toulme 0b7b1bca0d
[mdatagen] support using a different github project in mdatagen README issues list (#10677)
#### Description
[mdatagen] support using a different github project in mdatagen README
issues list

Uses a a new configuration property `github_project` on mdatagen
configuration.

#### Link to tracking issue
Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/9240

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-08-22 13:18:16 -07:00
Curtis Robert c1c8fcd6cc
[service] Fix memory leaks and enable goleak check in tests (#9241)
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
This change adds `goleak` to check for memory leaks. Originally there
were 3 failing tests in the `service` package, so I'll describe changes
in relation to resolving each test's failing goleak check.

1. `TestServiceTelemetryRestart`: Simplest fix, close the response body
to make sure goroutines aren't leaked by reopening a server on the same
port. This was just a test issue
2. `TestTelemetryInit.UseOTelWithSDKConfiguration`: The [meter
provider](fb3ed1b0d6/service/telemetry.go (L57-L58))
was being started in the initialization process ([metrics
reference](fb3ed1b0d6/service/internal/proctelemetry/config.go (L135))),
but never shutdown. The type originally being used
(`meter.MetricProvider`) was the base interface which didn't provide a
`Shutdown` method. I changed this to use the `sdk` interfaces that
provide the required `Shutdown` method. The actual functionality of
starting the providers was already using and returning the `sdk`
interface, so the actual underlying type remains the same. Since `mp` is
a private member and `sdkmetric` and implement the original type, I
don't believe changing the type is a breaking change.
3. `TestServiceTelemetryCleanupOnError`: This test starts a server using
a sub-goroutine, cancels it, starts again in a subroutine, and cancels
again in the main goroutine. This test showed the racing behavior of the
subroutine running
[`server.ListenAndServe`](fb3ed1b0d6/service/internal/proctelemetry/config.go (L148))
and the main goroutine's functionality of [calling
close](fb3ed1b0d6/service/telemetry.go (L219))
and then starting the server again [right
away](fb3ed1b0d6/service/service_test.go (L244)).
The solution here is to add a `sync.WaitGroup` variable that can
properly block until all servers are closed before returning from
`shutdown`. This will allow us to ensure it's safe to proceed knowing
the ports are free, and server is fully closed.

The first test fix was just a test issue, but 2 and 3 were real bugs. I
realize it's a bit hard to read with them all together, but I assumed
adding PR dependency notes would be more complicated.

**Link to tracking Issue:** <Issue number if applicable>
#9165

**Testing:** <Describe what testing was performed and which tests were
added.>
All tests are passing as well as goleak check.

---------

Co-authored-by: Pablo Baeyens <pablo.baeyens@datadoghq.com>
2024-08-13 12:24:54 +02:00
Alex Boten eebb96b7ec
remove opencensus bridge support (#10406)
This removes the configuration of the OpenCensus bridge from the
Collector. This means that any metric still relying on it will no longer
be emitting metrics.

Closes #10414
Closes #8945

This is blocked until
https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/29867
is completed.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-07-31 14:36:58 -07:00
Alex Boten a2289fd910
[service] use mdatagen for service metrics (#10273)
This reverts the reverts
https://github.com/open-telemetry/opentelemetry-collector/pull/10271 and
adds a mechanism to skip adding a create settings method for the service
package component test. Will need to figure out if
servicetelemetry.TelemetrySettings should be renamed to fit w/ the other
CreateSettings structs before removing this check.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-06-10 09:04:29 -07:00
Alex Boten 1749a8f19d
Revert "[chore] use mdatagen to generate service metrics (#10160)" (#10271)
This reverts commit 10bcef33e6.
2024-05-30 11:45:17 -07:00
Alex Boten 10bcef33e6
[chore] use mdatagen to generate service metrics (#10160)
This PR follows
https://github.com/open-telemetry/opentelemetry-collector/pull/10159 and
uses the new mdatagen functionality to generate async metrics in the
service.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-05-30 09:40:47 -07:00