* Report BatchSpanProcessor current queue size
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
* class name and span processor label to static fields
Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
CHANGELOG: the SDK will no longer throw an exception with a null instrumentation name on tracers or meters, but this is still not recommended usage.
* Provide a default Tracer and Meter for invalid instrumentation names
According to the spec, https://github.com/open-telemetry/opentelemetry-specification/blob/v0.6.0/specification/trace/api.md#tracerprovider-operations both a null and empty instrumentation name are invalid and a default implementation should be provided.
However, the spec is vague on what default means. See https://github.com/open-telemetry/opentelemetry-specification/issues/586#issuecomment-669856711
This change interprets "default" as meaning, "it should still work, but it's not ideal". Accordingly, a real Tracer or Meter implementation from the SDK is used. It meets the requirements of exporters and such by using a valid instrumentation name. It meets the requirements of application developers by producing valid tracing data. It also warns library and application developers by logging at the WARN level that an invalid value has been given.
The rational for this interpretation is that things should always work for the application developer. If an app developer doesn't provide a name, they should be chided, but they are instrumenting their own app, and likely don't care about the lack of name. If an app developer incorporates a library that doesn't specify the instrumentation name, the instrumentation should still be made available to application devs, but they should be able to turn if off (hence a valid name) and be made aware of something not being right (hence the logging) so they can report it to the library maintainers.
Fies #1879
* Mark instrumentation version nullable in MeterProvider and TracerProvider
The spec dictates this to be optional, and the implementations treat it as nullable already.
* Remove ComponentRegistry#get(String) overload
This overload is not no longer used by our code.
* fixup! Mark instrumentation version nullable in MeterProvider and TracerProvider
* fixup! Provide a default Tracer and Meter for invalid instrumentation names
* fixup! Provide a default Tracer and Meter for invalid instrumentation names
* fixup! Remove ComponentRegistry#get(String) overload
This reverts commit db56814c
* Revert "Mark instrumentation version nullable in MeterProvider and TracerProvider"
This reverts commit 7e92b396
CHANGELOG: Deprecated the `getCanonicalCode` method on `SpanBuilder` ; replaced with `getStatusCode`
* Some cleanup in span land.
* Clean up the SpanBuilder javadoc to match the current APIs
* Scrub mentions of canonical status code
* Deprecate the getCanonicalCode method on SpanBuilder and replace with getStatusCode
* rename an internal method to make more sense
* Update api/src/main/java/io/opentelemetry/api/trace/SpanBuilder.java
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
* Update api/src/main/java/io/opentelemetry/api/trace/SpanBuilder.java
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
* Update api/src/main/java/io/opentelemetry/api/trace/SpanBuilder.java
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
* add tests for the deprecated method
Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
* Replace all assertions with AssetJ's assertThat
Remove uses of JUnit 4 and JUnit 5 assert* where a functional equivalent exists in AssertJ. JUnit 5's assertThrows remains.
Fixes#1994
* fixup! Replace all assertions with AssetJ's assertThat
* Remove getCurrentContext and withSpan from Tracer
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Remove old java7 example
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
* Change the Sampler interface to have the SamplingResult contain the TraceState to use.
* revert errant change from another PR
* Change the SamplingResult API to allow a Function that will update the TraceState.
* revert an odd change from a rebase
* Change the SamplingResult to not have a functional response a concrete one.
* Add an additional bit of javadoc to the new method.