Commit Graph

564 Commits

Author SHA1 Message Date
Bogdan Drutu a439ca6da1
Move small internal package under common (#2219)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-09 13:45:10 +09:00
Bogdan Drutu 087f58da1d
Remove references to TracingContextUtils (#2238)
* Remove references to TracingContextUtils

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

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

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-12-08 16:56:49 -08:00
John Watson 704dfe270b
add some basic benchmarks for various baggage operations (#2197)
* add some basic benchmarks for various baggage operations

* update for changes from upstream; pre-allocate the strings in the benchmark.

* allocate the strings statically because we can
2020-12-08 11:00:54 -08:00
Bogdan Drutu efd6b9f3e4
Remove deprecated setCallback, change SDK to avoid volatile (#2216)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-07 18:37:45 -08:00
Bogdan Drutu 67b6339c70
Small nits in api packages (#2220)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-07 18:10:58 -08:00
Bogdan Drutu 65acc09c46
Add unit tests for isValidMetricName (#2218)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-08 09:22:20 +09:00
Bogdan Drutu be9c31ecad
Remove internal public validateLabelPairs, move to the class that uses it (#2215)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-07 14:42:23 -08:00
Bogdan Drutu 69208f8f79
Remove version of checkArgument not used (#2213)
This PR fixes an inconsistency that MaxLengthOfAttributeValues was allowed to be set to 0, then thrown internal exception.
We should check for arguments only at public APIs.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-07 13:39:33 -08:00
Bogdan Drutu 50c8f1f5c6
Move obfuscated to sdk, make it package protected (#2208)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-07 12:47:01 -08:00
Bogdan Drutu 7460f92bc8
Remove deprecated methods/classes before 1.0 release (#2205)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-07 11:33:17 -08:00
Bogdan Drutu 57263bf44a
Move TemporaryBuffers to be a package protected class, no need to expose this class (#2206)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-07 11:31:03 -08:00
Bogdan Drutu 3a7c0086c2
Remove deadcode from internal package (#2209)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-07 11:30:39 -08:00
Anuraag Agrawal 2770d46191
Add array implementation of Context. (#2191)
* Add array implementation of Context.

* More test
2020-12-07 12:39:35 +09:00
Anuraag Agrawal 469900eb34
Add a system property that can enable strict context checking for staging environments. (#2195) 2020-12-07 12:38:27 +09:00
Anuraag Agrawal f51332bd25
Add Labels.asMap and hide the builder implementation. (#2189)
* Add Labels.asMap and hide the builder implementation.

* Not public

* Spot

* More merge
2020-12-07 11:35:41 +09:00
Bogdan Drutu 26124ad075
Split API packages, move context in the same directory (#2199)
There are some things left to be done:
* Decide if context package should also be opentelemetry-api-context.
* Cleanup internal packages, things that are used by only one artifact should be moved there.

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-12-05 08:33:20 -08:00
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