#### 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
#### 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
<!--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>
#### 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
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>
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>
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>
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>
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>
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>
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>
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>