Commit Graph

13 Commits

Author SHA1 Message Date
Andrew Wilkins 4c24b49532
[chore] service/telemetry: improve test coverage (#13558)
#### Description

Improve coverage of config validation, TracerProvider creation, and
trace context propagator configuration.
Simplify some other tests.

#### Link to tracking issue

N/A

#### Testing

N/A

#### Documentation

N/A
2025-08-07 15:33:00 +00:00
Andrew Wilkins f1aa3dba91
[chore] service: move SDK creation to service/telemetry (#13536)
#### Description

Move SDK construction into service/telemetry. This is a step towards
fully encapsulating the otelconf SDK in the service/telemetry package,
so we can have different telemetry provider implementations that can be
injected.

#### Link to tracking issue

Preparation work for
https://github.com/open-telemetry/opentelemetry-collector/issues/4970

#### Testing

N/A, non-functional change.

#### Documentation

N/A
2025-08-04 16:07:24 +00:00
Antoine Toulme 2655e760c2
[service] move service.noopTraceProvider feature gate to deprecated stage (#13521)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
move service.noopTraceProvider feature gate to deprecated stage
<!-- Issue number if applicable -->
#### Link to tracking issue
Fixes #13492

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2025-07-29 18:52:03 +00:00
Matthew Sainsbury ab63cdff96
[chore] bump otel-go deps (#12575)
#### Description
Upgrading the collector to use opentelemetry-go-contrib
v1.35.0/v0.60.0/v0.29.0/v0.15.0/v0.10.0/v0.8.0/v0.7.0

See changelog here:
https://github.com/open-telemetry/opentelemetry-go-contrib/releases/tag/v1.35.0

<!-- Issue number if applicable -->
#### Link to tracking issue
none available

<!--Describe what testing was performed and which tests were added.-->
#### Testing
I ran `make all` but happy to run other targets if needed
2025-03-06 20:20:20 +00:00
Alex Boten 4edaacddf9
update config dependency (#11611)
This PR does a couple of things that I couldn't quite split up so I put
together a PR w/ individual commits to help reviewers get through it.
This PR does the following:

1. update `go.opentelemetry.io/contrib/config` package to latest. this
brings in breaking changes. in order to prevent those breaking changes
from impacting end users, i've also added a layer of config unmarshaling
2. updates the collector to instantiate the meter provider (and
exporters) via the config package. this allows us to remove all the code
in `otelinit`. the reason for including this change was that
unmarshaling the config was causing circular dependencies i didn't want
to address by moving code that could be deleted around.


Replacement for
https://github.com/open-telemetry/opentelemetry-collector/pull/11458.

Fixes
https://github.com/open-telemetry/opentelemetry-collector/issues/12021

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2025-01-24 17:47:00 +00:00
Alex Boten 2d9d376ee2
[service] fix bug with inconsistent resources (#11578)
The tracer and logger provider were instantiating different resources
objects that didn't have a `service.instance.id` attribute. This change
fixes that by instantiating the SDK in the service and passing it to the
factory via the telemetry.Settings struct.

This also removes the duplicate code to instantiate the SDK multiple
times, which will be useful when we move to instantiating MeterProvider
via the config SDK. This bug is blocking the change to bump up the
dependency on the config package.

There are a few alternatives that were considered:
1. could set the resource's service.instance.id on the config object
instead. this seemed messy as it would be editing the config struct and
the instantiation of the SDK would remain duplicated.
2. update the factory to pass in a resource object option, i didn't want
to update the NewFactory func.
3. update the CreateLogger, CreateTracerProvider to receive either a
resource or sdk parameter, both of those seemed incorrect as well.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-10-31 10:27:36 -07:00
Bogdan Drutu be5fc23088
[chore] Remove unnecessary globalgates (#11418)
This package is no longer necessary, but if in the future we need to
have gates shared between modules we may re-create this module.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2024-10-12 10:37:07 -07:00
Bogdan Drutu 7253ab8ef8
[chore] Remove use of alias types in service/telemetry (#11182)
This PR moves internal definitions that were aliased publicly to the
public package, and makes sure that hides any other type so that the API
surface is the same.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-09-20 06:58:37 -07:00
Alex Boten ec5d94af32
[chore] move attributes func into separate file (#11065)
No functional change, just moving it into its own file to clean up the
tracer config since the meter provider will also use attributes.

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-09-06 06:10:44 -07:00
Alex Boten e99074da2f
[service] implement a noop tracer provider (#11026)
This is to address some of the memory concerns around the SDK's noop
tracer provider. Instead of using the published noop tracer provider, we
implement our own to avoid the cost of context propagation, which has
been proven to be high enough to cause issues for end users.

Part of #10858

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-09-05 11:38:49 -07:00
Alex Boten b33913ba52
[service] add level for trace configuration (#10892)
This allows users to configure a Noop TracerProvider if needed. Note
that this configuration option breaks the zpages extension, which relies
on a SDK implementation.

Fixes #10890

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-08-26 12:19:28 -07:00
Alex Boten 998412ced7
[service] Allow users to disable the tracer provider via the feature gate `service.noopTracerProvider` (#10859)
Previously the service was returning an instance of a SDK tracer
provider regardless of whether there were any processors configured
causing resources to be consumed unnecessarily.

Fixes #10858

---------

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-08-12 16:26:27 -07:00
Alex Boten d628b963a5
[chore] adding minimal test for attributes (#10666)
This isn't as good as emitting telemetry w/ the service but at least it
ensures resource attributes are set.

Follow up to
https://github.com/open-telemetry/opentelemetry-collector/pull/10490 and
https://github.com/open-telemetry/opentelemetry-collector/pull/10645

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
2024-07-22 06:43:57 -07:00