* Wrap TCP listener
The mock collector listener now signals when it receives a connection
instead of waiting an arbitrary time an hoping the event happens.
* Only close the listener C chan once
* Apply PR feedback
* Backwards compatible support for closed listener check
* Cleanup
* Fix flaky OTLP exporter reconnect test
The tests that check the OTLP exporter will reconnect wait for the
reconnect loop to complete, in theory. However, they do not yield the
active goroutine scheduling. The reconnect loop is in its own goroutine
meaning it is unlikely for that loop to be re-entered, especially on
slow systems. This updates the tests call runtime.Gosched when waiting
for the reconnect loop and yield the scheduling to other goroutines.
* Add changes to changelog
* Use time.After instead of Timer
* Remove changelog entry
* Changes stdout to expose the actual tracerProvider
This enables flushing and stopping the exporter.
* updated changelog
* Update CHANGELOG.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* docs: update InstallNewPipeline example comment
* docs: update changelog after PR submit
* fix: wrap issue number in parens
* docs: use test example to document prometheus.InstallNewPipeline
* fix: update CHANGELOG to reflect PR state
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Adjust instrumentation lib name / version key
* Adjust array attribute serialization
* Adjust span status mapping
- remove `otel.status_description`; use `error` instead for description
- do not report status code if unset
- do not report description if OK or unset
- omit tags if no tag has been mapped
- adjust tests
* Set remote endpoint according to the spec
- See
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk_exporters/zipkin.md#remote-endpoint
* Fix remaining tests
* Update CHANGELOG
* Add some more tests
* Address PR feedback
- Simplify deletion of redundant error code
- Simplify endpoint rank determination
* More tests for remote endpoint
* remove process config for Jaeger exporter
* remove process config for Jaeger exporter
* Add CHANGELOG.md back
* Add CHANGLOG.md changes back
* fill in PR number in CHANGELOG
* Update CHANGELOG.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Make ExportSpans for Jaeger honor deadline
* Make variable name more descriptive
* new commit
* Revert "new commit"
This reverts commit 06e24cc38d.
* Change PR number in changelog
* Take out separate goroutine and add back TODO
* Check error string
* Fix error assert
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Make TraceFlags spec-compliant
* Remove `trace.FlagsDebug` and `trace.FlagsDeferred`
* These are used only by the B3 propagator and will be handled there in the `context.Context`
* Make `trace.TraceFlags` a defined type, aliasing `byte`
* Move `IsSampled` method from `trace.SpanContext` to `trace.TraceFlags`
* Add `Sampled(bool)` method to `trace.TraceFlags`
* Implement `Stringer` and `json.Marshaler` for `trace.TraceFlags`
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
* Rename `TraceFlags.Sampled()` to `TraceFlags.WithSampled()` for consistency
* Restore `SpanContext.IsSampled()` method.
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
* Update precedence of event name in Jaeger exporter
The OTel specification states that the event needs to be recorded as a
log with its name set to a tag having the "event" key. That key needs to
be overridden when there is an attribute with the same key. This updates
to implement this.
Resolves#1767
* Add changes to changelog
* Update PR number in changelog
* lint
* Fix testCollectorEndpoint typo and add tag assertions in jaeger_test
* add PR number for CHANGLOG
* add tag and sevicename assetions in TestExporter_ExportSpan
* update assert.Equal to assert.Len and revert CHANGLOG
* update assert.Len to require.Len
* Fix Jaeger span status reporting and unify tag keys
Move all tag key strings to be consts defined in a unified location.
Fix the status code and message tag keys to conform with the
specification.
Do not set the span status message if it is not set to conform with the
specification.
* Add changes to changelog
* Update CHANGELOG.md
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
* Fix misspell
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
* Update SpanSnapshot to use parent SpanContext
Having only the parent span ID and a separate field to communicate if
the parent was remote does not provide a comprehensive view of the
parent span nor is it an efficient way to transmit this information.
Update the SpanSnapshot to have a `Parent` field that contains the
parent span context. This field replaces the ParentSpanID and
HasRemoteParent fields.
* Revert SamplingParameters span change
* Update CHANGELOG with PR number
This patch removes `ApplyConfig` method and `Config` struct from
`go.opentelemetry.io/otel/sdk/trace` package. To ensure valid config
for TracerProvider, it adds `ensureValidTracerProviderConfig` private
function.
Jaeger and Zipkin have been used the `Config` directly across package
boundaries. Since `Config` is removed, they can't use it. This change,
thus, replaces `WithSDK` with `WithSDKOptions`.
Resolves#1636, #1705.
* Rename WithDefaultSampler TracerProvider option to WithSampler
The term "DefaultSampler" comes from early ideas of this project where
there would be overriding samplers lower in the trace SDK. This
overriding does not exist and if it is going to be introduced in the
future the sampler associated with the TracerProvider is already scoped
based on that association (no need to scope with a name). This renames
the TracerProvider option to not include this anachronism.
* Update PR number in CHANGELOG
* Propagate rename
* Update defaults documentation for TracerProvider
* Update sdk/trace/provider.go
Co-authored-by: Steven E. Harris <seh@panix.com>
* Update sdk/trace/provider.go
Co-authored-by: Steven E. Harris <seh@panix.com>
* Add remote property to SpanContext
* Set SpanContext.remote when extracting context in TraceContext propagator
* Ensure remote flag is set when inserting remote SpanContext into context
* Ensure tests are expecting remote flag in SpanContext where appropriate
* Update CHANGELOG.md
* Apply PR feedback
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Jaeger exporter now populate Jaeger's Span Process from Resource
* Remove jaeger.WithProcess
* Fix tests
* Change the type of default service name into string
* Add tests
* Update CHANGELOG
* Use the API from `Set` to fetch service name in exporter
* Fix nits
* Add more test cases for jaegerBatchList function
* precommit
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
* Rename resource pkg label vars and methods
The former `labels` package is now named `attributes` to conform with
the specification requirement. This removes the lingering `label` term
from the `resource` package.
Resolve https://github.com/open-telemetry/opentelemetry-go/issues/1691
* Update PR number in CHANGELOG
* Propagate rename to the prometheus exporter pkg
* Make SpanContext Immutable
* Adds NewSpanContext() constructor and SpanContextConfig{} struct for
constructing a new SpanContext when all fields are known
* Adds With<field>() methods to SpanContext for deriving a SpanContext
with a single field changed.
* Updates all uses of SpanContext to use the new API
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
* Update CHANGELOG.md
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
* Add tests for new SpanContext constructor and derivation
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
* Address PR feedback
* Fix new uses of SpanContext from main
* 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>