Commit Graph

548 Commits

Author SHA1 Message Date
Anuraag Agrawal 8697de9afa
Detect GC leaks of scopes in StrictContextStorage. (#2164)
* Detect GC leaks of scopes in StrictContextStorage.

* More

* Finish

* Force GC more aggressively

* Cleanup

* Vendor code directly

* Copy test too

* Try waiting more

* ep

* oops

* Remove from build.gradle

* Drift

* Log on multiple

* Cleaner ourselves.

* EP

* Move into if

* Revert accidental
2020-12-04 13:04:27 +09:00
Anuraag Agrawal 643b697106
Add TraceState.asMap (#2190)
* Add TraceState.asMap

* Javadoc

* Spot
2020-12-04 12:40:11 +09:00
Anuraag Agrawal 4762c6a25d
Remove ReadableAttributes (#2187)
* Remove ReadableAttributes

* Don't rewrite history

* Drift
2020-12-03 11:26:24 -08:00
Anuraag Agrawal f8b9f0ac6a
Expose BaggageEntry / Metadata as interfaces and add asMap (#2177)
* Expose BaggageEntry / Metadata as interfaces and add asMap

* Disclaimer
2020-12-02 10:40:46 -08:00
Armin Ruech 5585e73611
Remove "semver" prefix from instrumentation library version (#2180) 2020-12-02 10:29:11 -08:00
John Watson ba9f9c09a2
Fix a bug with all tracers & meters being delegated to the global tracer. (#2176) 2020-12-02 18:06:28 +09:00
Anuraag Agrawal cf5b582c5b
Replace AttributeConsumer with BiConsumer (#2174)
* Replace AttributeConsumer with BiConsumer

* Forgot to delete
2020-12-02 16:52:06 +09:00
John Watson e90a6a886b
Convert Attributes to an interface (#2134)
* Convert Attributes to an interface

* Add javadoc explaining Attributes implementation requirements.

* Convert the AttributesBuilder into an interface.

* update from upstream changes

* move the implementation class out of the interface

* clean up some javadoc that referenced non-public classes
2020-12-01 15:54:07 -08:00
Mateusz Rzeszutek dc91c95e63
Fix buildscripts/semantic-convention/generate.sh script (#2144)
* Fix buildscripts/semantic-convention/generate.sh script

Including:
* update spec version to latest commit
* regenerate SemanticAttributes

* Code review comments

* Reference spec date
2020-12-01 11:18:32 -08:00
Anuraag Agrawal 0163a8c121
Split SpanContext into interface / impl (#1935)
* Split SpanContext into interface / impl

* Remove javadoc from impl to reduce drift change.

* Add warning

* More
2020-12-01 11:06:48 -08:00
John Watson 6be633701f
Convert Labels to be an interface. (#2137)
* Convert Labels to be an interface.

* Convert the LabelsBuilder into an interface.
2020-12-01 08:46:34 -08:00
John Watson 036f7f1477
Convert TraceState to be an interface (#2138)
* convert TraceState to an interface

* don't expose the impl

* Remove the un-needed TraceState Entry objects.

* Add additional javadoc documenting requirements for interface implementors.

* make the implementation non-public

* remove un-needed test docs

* Update api/src/main/java/io/opentelemetry/api/trace/TraceState.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update api/src/main/java/io/opentelemetry/api/trace/TraceState.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* formatting fix

* Convert the TraceStateBuilder into an interface.

* Introduce an intermediate class to get around classloading cycles.

* extract a method to remove an entry from the builder

* add a comment about the possible inefficiency in the implementation

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-12-01 08:21:36 -08:00
Anuraag Agrawal 7ed6d8d4e4
Remove Status.value (#2147)
* Remove Status.value

* Deprecate for now
2020-12-01 13:46:26 +09:00
Anuraag Agrawal 052b17f9b1
Add asMap for Attributes. (#2145)
* Add asMap for Attributes.

* AttributesMap too

* Test empty too.

* checkstyle
2020-12-01 13:27:14 +09:00
Chris Burns e0989d75e7
Changes return type from List to Collection (#2156)
- changes the return type of the fields() method in TextMapPropagator from List<String> to Collection<String>
and updated all implementations for consistency
2020-11-30 14:26:24 -08:00
John Watson 73bad773dd
Move the AsynchronousInstrument callbacks to the builders. (#2120)
Deprecate the existing setCallback method.
Update the code in the SDK to use the new API.
2020-11-30 14:12:49 -08:00
Christian Neumüller bbe8702257
Rename HttpTraceContext to W3CTraceContextPropagator. (#2116)
* Rename HttpTraceContext to W3CTraceContextPropagator.

* Add javadoc.
2020-11-25 10:27:07 +09:00
John Watson 3782def5dd
Add a static builder method to the OpenTelemetry interface. (#2118) 2020-11-24 09:22:15 -08:00
Anuraag Agrawal 96c7f404b4
Don't repeat Java 8 support among all the subproject READMEs and at top level, clarify that published artifacts are Java 8, but building requires additional instructions. (#2124) 2020-11-24 09:04:40 -08:00
Anuraag Agrawal ac672e56bf
Update dependencies (#2115) 2020-11-21 09:39:27 -08:00
Anuraag Agrawal 1828938263
Disallow null attribute array values. (#2105) 2020-11-21 09:28:58 -08:00
Anuraag Agrawal 0e013e5c73
Hide default context propagators implementation behind interface. (#2089)
* Hide default context propagators implementation behind interface.

* Deprecate

* Revamp
2020-11-20 10:58:34 +09:00
John Watson 96b480cd35
Deprecate the toBuilder methods on the OpenTelemetry classes, and add a method to set the propagators on an instance. (#2094) 2020-11-19 12:39:21 +09:00
Anuraag Agrawal a68b0bf864
Ignore invalid usage of TraceState instead of throwing. (#2084)
CHANGELOG: Invalid TraceState entries will now be ignored, rather than causing the entire TraceState to be invalidated.

* Ignore invalid usage of TraceState instead of throwing.

* Format

* Missed a test
2020-11-18 09:22:24 -08:00
Anuraag Agrawal 46408ef3fd
Don't throw exceptions for invalid baggage like other APIs (#1964)
* Don't throw exceptions for invalid baggage like other APIs

* Remove redundant null check

* Remove redundant null checks
2020-11-16 18:30:16 -08:00
John Watson 7a5d8df148
Make the OpenTelemetrySdk a subclass of DefaultOpenTelemetry (#2069)
* Make the OpenTelemetrySdk a subclass of DefaultOpenTelemetry

* Remove SPI from the explicit OpenTelemetrySdk builder usage.
Add a (super ugly) test to make sure that the clock and resource are getting set.

* Update sdk/all/src/test/java/io/opentelemetry/sdk/OpenTelemetrySdkTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update sdk/all/src/test/java/io/opentelemetry/sdk/OpenTelemetrySdkTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* address code review comments; add tests

* Require the MeterProvider to be a MeterSdkProvider

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-11-16 16:06:43 -08:00
John Watson 1fe334ff12
Some cleanup in span land. (#2062)
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>
2020-11-11 18:34:07 -08:00
John Watson 58ccf97929
Switch the key/value pair sorting to mergesort, because it is stable (#2049) 2020-11-11 08:04:42 -08:00
Anuraag Agrawal b5efbcf187
Move builders to top level. (#1958)
* Move builders (and TraceStateEntry) to top level.

* Revert Entry

* Fix and more revert

* Drift
2020-11-10 14:50:37 +09:00
Anuraag Agrawal 1883c578bd
Add unit to start, end and event timestamp accepting methods in Span. (#1969)
* Add unit to timestamp accepting methods in Span.

* end timestamp

* Merge

* Merge

* Add Instant versions too
2020-11-09 16:19:52 -08:00
Anuraag Agrawal 9063c385d9
Implement baggage using array of key/value pairs instead of Map. (#2016)
* Implement baggage using array of key/value pairs instead of Map.

* Cleanup
2020-11-09 08:54:22 -08:00
Marius Volkhart 3e31fd91aa
Replace all assertions with AssetJ's assertThat (#2042)
* 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
2020-11-07 14:48:00 -08:00
John Watson d69752a6be
Move the SPI interfaces to .spi.* packages (#2005) 2020-11-06 11:08:35 +09:00
Anuraag Agrawal 9c4c52dfee
Switch animal sniffer signature to gummy bears. (#2015) 2020-11-06 08:56:26 +09:00
Carlos Alberto Cortez 5195622181
Add Getter.Keys() with Jaeger Baggage support. (#1549) 2020-11-05 12:51:07 +01:00
Anuraag Agrawal 28905b7e05
Expose foreach consumer instead of Entry for baggage. (#1982) 2020-11-04 13:41:30 -08:00
Anuraag Agrawal 5be613a3f0
Replace EndSpanOptions.Builder with factory. (#1934)
* Replace EndSpanOptions.Builder with factory.

* create

* Remove class completely
2020-11-04 13:33:10 +09:00
Anuraag Agrawal e5cf181ed9
Expose foreach consumer instead of entries for trace state. (#1979)
* Expose foreach consumer instead of entries for trace state.

* o-public
2020-11-03 16:41:27 -08:00
Anuraag Agrawal 37cce8dbca
Replace LabelConsumer with BiConsumer (#1980) 2020-11-03 15:21:52 -08:00
Anuraag Agrawal 23392d9052
Make Attribute/LabelConsumer consistent with Java 8 BiConsumer (#1983)
* Make Attribute/LabelConsumer consistent with Java 8 BiConsumer

* more

* Spot
2020-11-03 10:03:52 -08:00
John Watson d958f2ba0c
Add a Jaeger exporter which exports via the thrift-over-http format (#1875)
* Initial implementation of a jaeger thrift exporter.

* some cleanups/renaming

* fix? the formatting

* Fix the default endpoint.

* Update exporters/jaeger_thrift/README.md

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update exporters/jaeger_thrift/README.md

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update exporters/jaeger_thrift/src/main/java/io/opentelemetry/exporters/jaeger/Adapter.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* Update exporters/jaeger_thrift/src/main/java/io/opentelemetry/exporters/jaeger/JaegerThriftSpanExporter.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>

* cleanup from PR review

* fix from upstream change

* add assertions about the results of the exports
and fix the code to make sure the results were included.

* update for api repackaging

* add some fuzzing tests for the id <-> long conversions

* change SpanId interface to match the TraceId one.

* Made a test method non-public

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-11-03 09:41:39 -08:00
Trask Stalnaker 4699191495
Add doc explaining the restriction on return type (#1977)
* Add doc explaining the restriction on return type

* In more places
2020-11-03 14:20:16 +09:00
Tyler Benson 9c446490af
Fix outdated javadoc (#1975) 2020-11-02 11:03:42 -08:00
Anuraag Agrawal 0e937d4c55
Use fine logging in w3c/b3 propagator instead of info. (#1966)
* Use fine logging in w3c propagator instead of info.

* Fine for b3 too
2020-11-02 07:47:11 -08:00
John Watson f034adb03b
Misc. cleanup: (#1942)
Rename TraceShim factory to OpenTracingShim
Remove factory method from OpenTracingShim which used mixed pieces of the openTelemetry components.
Made the constructor for W3CBaggagePropagator private.
Updated OpenTracingShim README
2020-10-31 13:42:00 -07:00
John Watson e581182147
Create classes to hold on to the context keys. (#1945)
Inline methods in TCU and get rid of it.
2020-10-31 08:47:37 -07:00
Anuraag Agrawal c723de5b05
Merge context_prop into context artifact. (#1928) 2020-10-31 08:47:07 -07:00
Anuraag Agrawal e8c6b1dac8
Remove BaggageUtils (#1931) 2020-10-30 11:25:12 -07:00
Anuraag Agrawal d430e11421
Add test cases for array attributes with null inside. (#1933) 2020-10-30 08:19:37 -07:00
Anuraag Agrawal c6f111a48d
Add comments to all package-private methods being used by auto-instrumentation. (#1930) 2020-10-29 20:42:43 -07:00