1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-05 22:54:18 +02:00
opentelemetry-go/sdk/trace
Injun Song d75e268053
Avoid overriding configuration of tracer provider (#1633)
* sdk/trace: add missing options to tracer provider

This change adds `WithDefaultSampler` and `WithSpanLimits` to the tracer
provider and removed `WithConfig` from it.

Before this change, `WithConfig` is the only way to set sampler or
limits of a span. However, it is prone to misuse, since `WithConfig` can
override tracing configurations that are configured by `WithResource` or
`WithIDGenerator`.  Thus to fix this, it adds new functional options -
`WithDefaultSampler` and `WithSpanLimits` and removes `WithConfig`.

Resolves #1631.

* Update sdk/trace/provider.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update sdk/trace/provider.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* rebase and remove WithConfig

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2021-03-08 13:43:11 -08:00
..
attributesmap_test.go Rename otel/label -> otel/attribute (#1541) 2021-02-18 12:59:37 -05:00
attributesmap.go Rename otel/label -> otel/attribute (#1541) 2021-02-18 12:59:37 -05:00
batch_span_processor_test.go Add ForceFlush method to TracerProvider (#1608) 2021-03-08 11:12:13 -08:00
batch_span_processor.go Add ForceFlush method to TracerProvider (#1608) 2021-03-08 11:12:13 -08:00
benchmark_test.go Avoid overriding configuration of tracer provider (#1633) 2021-03-08 13:43:11 -08:00
config.go Update span limits to conform with OpenTelemetry specification (#1535) 2021-02-18 11:31:35 -08:00
doc.go Update README and documentation to better communicate pre-GA state (#1281) 2020-10-29 09:23:13 -07:00
evictedqueue_test.go Update License header for all source files (#586) 2020-03-23 22:41:10 -07:00
evictedqueue.go chore: adds vanity import for files that don't have it. (#1297) 2020-11-04 09:10:58 -08:00
id_generator.go Enable support for externally-defined ID generators (#1363) 2020-12-09 20:30:32 -05:00
provider_test.go Add ForceFlush method to TracerProvider (#1608) 2021-03-08 11:12:13 -08:00
provider.go Avoid overriding configuration of tracer provider (#1633) 2021-03-08 13:43:11 -08:00
sampling_test.go Rename otel/label -> otel/attribute (#1541) 2021-02-18 12:59:37 -05:00
sampling.go revent end-users from implementing some interfaces (#1575) 2021-02-24 10:03:35 -08:00
simple_span_processor_test.go Update the SimpleSpanProcessor (#1612) 2021-03-08 09:50:15 -08:00
simple_span_processor.go Add ForceFlush method to TracerProvider (#1608) 2021-03-08 11:12:13 -08:00
span_processor_example_test.go Add ForceFlush method to TracerProvider (#1608) 2021-03-08 11:12:13 -08:00
span_processor_test.go Add ForceFlush method to TracerProvider (#1608) 2021-03-08 11:12:13 -08:00
span_processor.go Add ForceFlush method to TracerProvider (#1608) 2021-03-08 11:12:13 -08:00
span.go Removed setting error status while recording err as span event (#1663) 2021-03-08 11:31:01 -08:00
trace_test.go Avoid overriding configuration of tracer provider (#1633) 2021-03-08 13:43:11 -08:00
tracer.go Remove build flags for runtime/trace support (#1498) 2021-01-29 12:41:49 -08:00
util_test.go Avoid overriding configuration of tracer provider (#1633) 2021-03-08 13:43:11 -08:00