Commit Graph

567 Commits

Author SHA1 Message Date
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
Anuraag Agrawal e6f6f19cc9
Remove BaggageManager for real. (#1929)
* Remove BaggageManager for real.

* Spot
2020-10-29 20:42:00 -07:00
John Watson 338acd4816
Add some simplistic fuzz-based tests for the 2 built-in W3C propagators. (#1926)
* Add some simplistic fuzz-based tests for the 2 built-in propagators.

* remove unused gradle plugin
2020-10-29 17:57:25 -07:00
Bogdan Drutu 972c89a2ef
Make BaggageUtils and TracingContextUtils package protected (#1923)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-29 14:05:51 -07:00
Bogdan Drutu da7ff3da20
Ensure all public classes in the API are final (#1924)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-29 14:05:29 -07:00
Anuraag Agrawal 604aee25fa
Have Baggage context interaction API mirror Span. (#1916) 2020-10-29 12:49:54 -07:00
Anuraag Agrawal 3d69aa19a8
Restore source/targetCompatibility declarations for intellij to set version correctly and remo… (#1920)
* Restore source/targetCompatibility declarations for intellij and remove animalsniffer for java 8.

* Newer syntax
2020-10-29 08:11:15 -07:00
Anuraag Agrawal ba1fabeb64
Hide Default* implementations behind interface factory methods. (#1904)
* Hide Default* implementations behind interface factory methods.

* Renames
2020-10-29 08:02:44 -07:00
Anuraag Agrawal 34953d5fee
Add MustBeClosed to Context.makeCurrent (#1914) 2020-10-29 11:36:46 +09:00
John Watson ed75175578
Add a method to the Baggage interface to return the current baggage in the context (#1913)
* Add a method to the Baggage interface to return the current baggage in the context.

* formatting

* Fix tests broken by not clearing state

* don't try to code while overly tired. the result is scopes that aren't closed.

* remove the scope to make sure the root scope has no baggage
2020-10-29 11:07:08 +09:00
Anuraag Agrawal f83b9e4842
Remove leftover baggage spi package-info and add baggage propagation missing package-info. (#1905) 2020-10-28 07:34:04 -07:00
Anuraag Agrawal 7ebbe7979d
Move API packages to .api. package (#1892)
* Move API packages to .api. package

* Cleanup
2020-10-28 08:39:41 +09:00
Anuraag Agrawal 934c9ed8a3
Make OpenTelemetrySdk implement the OpenTelemetry interface and have SPI find it. (#1857) 2020-10-24 19:39:26 -07:00
Anuraag Agrawal a8975e83d4
Replace TracingContextUtils.currentContextWith with ImplicitContextKeyed.makeCurrent (#1855)
* Replace TracingContextUtils.currentContextWith with ImplicitContextKeyed.makeCurrent

* Dont add MustBeClosed this time since affects other code.
2020-10-24 19:38:24 -07:00
dengliming a4e23f9ed9
Span return `this` to enable chain calls (#1869)
* Span return `this` enable chain calls

* Fix spotlessCheck

* Keep return void in end method
2020-10-23 09:29:01 -07:00
Giovanni Liva d0785ff84f
Automatically generate Semantic Convention attributes (#1846)
* Automatically generate Semantic Convention attributes

* Fix checkstyle

* Transition to automatically generated class

* Pin to specific commit

* Move EXCEPTION_EVENT_NAME inside the template
2020-10-23 09:00:42 -07:00
John Watson e2f648da63
Add a toBuilder method to the Baggage (#1868)
* Add a toBuilder method to the Baggage to make it easy to amend baggage.

* formatting
2020-10-23 07:49:33 -07:00
Bogdan Drutu 185d10e395
Serialize the entire trace flags not only the sample bit (#1774)
* Serialize the entire trace flags not only the sample bit

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

* Add test for more than just sampling bit in the context

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

* Update api/src/test/java/io/opentelemetry/trace/propagation/HttpTraceContextTest.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-10-23 13:33:41 +09:00
Anuraag Agrawal 23444d6e5c
Update google java format to 1.9 (#1854)
* Update google java format to 1.9

* Spotless

* Update Contributing.md
2020-10-23 12:47:10 +09:00
John Watson 14c2faf064
Simplify a call so that we don't have cycles in the TCU->Span call chain. (#1867) 2020-10-23 11:10:45 +09:00
Bogdan Drutu 52a6af86d4
Remove baggage sdk package, move tests to API (#1865)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-22 09:55:28 -07:00
Anuraag Agrawal ee03c5eabc
Remove unused BaggageManagerFactory SPI. (#1858) 2020-10-22 09:53:50 -07:00
Anuraag Agrawal 36a0339e15
Add a factory method for creating PropagatedSpan to allow auto-instrumentation to intercept the method. (#1859) 2020-10-22 08:39:28 -07:00
Anuraag Agrawal ed5136bcda
Move Span context accessors to Span static methods. (#1843)
* Move Span context accessors to Span static methods.

* Bad IDE

* More merge

* More merge
2020-10-21 20:02:58 -07:00
Anuraag Agrawal f5082d10f6
Context.with/get, AttributesBuilder/LabelsBuilder.set (#1838)
* Context.with, AttributesBuilder/LabelsBuilder.set

* put
2020-10-21 19:51:14 -07:00
Anuraag Agrawal 34e66a1175
Rename getContext to getSpanContext. (#1852) 2020-10-21 19:38:08 -07:00
Anuraag Agrawal ea1a0a0486
Rename OpenTelemetry interface methods to normal interface conventions. (#1842) 2020-10-21 19:21:57 -07:00
John Watson f3df455d2b
Make Baggage implement ImplicitContextKeyed and make the BaggageUtils.withBaggage non-public. (#1849) 2020-10-21 16:05:25 -07:00
Anuraag Agrawal 6544923215
Extract an interface for the OpenTelemetry API to later allow an SDK … (#1805)
* Extract an interface for the OpenTelemetry API to later allow an SDK to implement it.

* Cleanups

* mine

* final

* Fix shortcuts

* Fix javadoc

* More merge
2020-10-21 12:33:50 -07:00
John Watson e13e631847
Make the baggage API fully functional in the API (#1822)
* Make the baggage API fully functional in the API
and get rid of the BaggageManager that was needed previously.

* javadoc cleanup

* more javadoc cleanup

* make the ImmutableBaggage package access
2020-10-20 21:57:17 -07:00
Anuraag Agrawal ecdfc391f2
Add a ContextValue interface to allow Context.withValue(value) withou… (#1827)
* Add a ContextValue interface to allow Context.withValue(value) without a key.

* Assertions

* Renames
2020-10-20 19:26:54 -07:00
Christian Neumüller 9b73fb06fd
Fix non-null carrier not working in extract. (#1835) 2020-10-19 13:07:02 -07:00
John Watson 57097873c8
rename StatusCanonicalCode to StatusCode (#1804) 2020-10-15 17:55:05 -07:00
Bogdan Drutu b73a063901
Remove getCurrentContext and withSpan from Tracer (#1809)
* 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>
2020-10-15 10:58:41 -07:00
Anuraag Agrawal 2d0f91b538
Remove DefaultSpan from public API. (#1791)
* Cleanup

* Fix comment

* isValid not valid
2020-10-15 11:37:03 +09:00
Anuraag Agrawal 0ceff17dfa
Remove since tags until 1.0.0 (#1796)
* Remove since tags until 1.0.0

* Spotless
2020-10-14 09:29:27 -07:00
Anuraag Agrawal e2b5245d73
Rename newBuilder to builder for consistency. (#1790) 2020-10-13 13:17:06 -07:00
John Watson 939d1b8ddc
Baggage propagator first implementation (#1771)
* Turn the Baggage metadata into a simple wrapper for a String.

* whoops missing final modifier

* remove unneeded nullable annotation

* Remove the method to parent via Baggage.
Parenting is still implemented via the Context.
Also, renamed many old variables and method to use the new baggage name.

* update for context changeover

* Remove the method to parent via Baggage.
Parenting is still implemented via the Context.
Also, renamed many old variables and method to use the new baggage name.

* Basic implementation of baggage header extraction.

* inject implemented

* cleanup checks

* update for context changeover
2020-10-13 15:30:01 +09:00
Anuraag Agrawal 487e57ea11
Add constants for message operations which are defined by spec. (#1783) 2020-10-12 09:45:13 -07:00
Anuraag Agrawal 72e17bb2cc
Add a few missing package-info.java (#1776)
* Add a few missing package-info.java

* Spotless
2020-10-09 08:06:58 -07:00
John Watson 012da09027
Remove the method to parent via Baggage. (#1767)
* Turn the Baggage metadata into a simple wrapper for a String.

* whoops missing final modifier

* remove unneeded nullable annotation

* Remove the method to parent via Baggage.
Parenting is still implemented via the Context.
Also, renamed many old variables and method to use the new baggage name.

* small javadoc tweak

* update for context changeover
2020-10-08 10:54:33 -07:00
John Watson 5f6c5bf297
Turn the Baggage metadata into a simple wrapper for a String. (#1764)
* Turn the Baggage metadata into a simple wrapper for a String.

* whoops missing final modifier

* javadoc cleanup

* use the empty metadata as the OT Shim default

* remove unneeded nullable annotation
2020-10-08 10:34:52 -07:00
Anuraag Agrawal 78fd4d1c8f
Add package-info.java to all packages and ParamatersAreNonNullByDefault. (#1772) 2020-10-08 08:26:49 -07:00
Anuraag Agrawal fd49b3f65f
Migrate usage of gRPC context to OTel context. (#1751) 2020-10-07 11:19:49 -07:00
dengliming 1a7396413a
Fix specification link in SemanticAttributes.java (#1763)
* Fix specification link in SemanticAttributes.java

* Update link
2020-10-06 10:17:44 -07:00
Bogdan Drutu 6c660d92e5
Add overload for setStatus without description, fix usages (#1754)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-05 09:05:46 -07:00
Bogdan Drutu eb4a18febc
Remove Status object from API, keep StatusCanonicalCode (#1741)
* Remove Status object from API, keep StatusCanonicalCode

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

* Respond to comments, change more old usages

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

* Fix build, run gojf

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-05 11:33:40 +09:00
Ioannis Mavroukakis 42cdff446c
subsume methods from AttributesKeys to AttributeKey (#1743)
* subsume methods from AttributesKeys to AttributeKey

* remove missed instance of AttributesKeys

* make javadoc wording more representative of method intent
2020-10-04 10:41:37 -07:00
Bogdan Drutu 50a8fbff30
Remove unnecessary methods from api/internal (#1747)
* Remove unnecessary methods from api/internal

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

* Make sdk/StringUtils package protected

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-04 09:50:34 -07:00
Bogdan Drutu b93d1a4d55
Remove Link from API, use SpanData.Link in Sampler (#1739)
* Remove Link from API, use SpanData.Link in Sampler

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

* Fix tracing_incubator

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-02 10:42:22 -07:00
dengliming 71ba8e1b87
Use the concise license header without the year (#1623)
* Use the concise license header without the year

* Use the concise license header without the year
2020-10-02 22:42:53 +09:00
Bogdan Drutu 391043fa1f
Remove redundant type argument conversion (#1734)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-01 18:41:56 -07:00
Bogdan Drutu 790018f004
Remove addLink that accepts Link interface (#1732)
* Remove addLink that accepts Link interface

Currently the Link interface cannot easily be removed, used in the Sampler interface,
will do a separate PR for that.

Based on the specs we don't have to offer a "lazy" formatted Link API (was removed some time ago).

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

* Copy javadoc instead of reference

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

Co-authored-by: Anuraag Agrawal <aanuraag@amazon.co.jp>
2020-10-01 18:24:02 -07:00
Bogdan Drutu b78fbb31fa
Remove Event interface, and it's usage (#1733)
* Remove Event interface, and it's usage

Based on the specification we are not required to expose this interface or have APIs that accept this interface.

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

* Fix links to Event

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

* Fix more javadocs references to Event

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-02 10:05:28 +09:00
John Watson 231ca02400
Make setting null-valued attributes a no-op, and document that their behavior is undefined. (#1706)
* Make setting null-valued attributes a no-op, and document that their behavior is undefined.

* also have the span itself ignore null attribute values

* Update api/src/main/java/io/opentelemetry/common/Attributes.java

Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>

* Set the non-null-by-default annotation on the package level for the common code.

* add no-op validating tests with a caveat

Co-authored-by: Giovanni Liva <giovanni.liva@dynatrace.com>
2020-09-30 08:08:32 -07:00
Sergei Malafeev c577ee17f7
check traceparent for extra trailing characters for version 00 (#1727)
* check traceparent for extra trailing characters for version 00

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* add tests and make "00" a constant

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
2020-09-30 08:01:46 -07:00
John Watson 287eae9e5c
Update for the more restricted span status codes. (#1701)
* Update for the more restricted span status codes.

* Update status codes to match the proposed proto codes
2020-09-28 10:42:44 -07:00
Nikita Salnikov-Tarnovski e7706d63f9
Fix type for REDIS_DATABASE_INDEX semantic attribute (#1720) 2020-09-28 08:31:55 -07:00
Anuraag Agrawal 8b7ea5e366
Add overrides to allow using a long key with an int value. (#1713) 2020-09-27 12:54:24 +09:00
Bogdan Drutu 840ae850ec
Rename CorrelationContext with Baggage (#1691)
* Rename CorrelationContext with Baggage

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

* Fix review comments

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

* Rename contextBuildet to baggageBuilder

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-09-26 08:42:01 -07:00
John Watson 12af6d9fdf
Change the default Propagator in the API to be a no-op (#1709) 2020-09-26 08:34:19 -07:00
Christian Neumüller 83b9ba5701
Implement spec change to only accept Context as span parent. (#1611)
* Prototype for Context as span parent.

* Simplify ZipkinSpanExporterEndToEndHttpTest.

* Minimize PR diff.

* Make Codecov happy.

* Fix overcomplicated DefaultTracer.

* Fix build after merge.

* Fix build after merge.

* Revert storage of full Context.

* Lint.

* Clean up OpenTracing SpanBuilderShim.

* Rename Context -> RequestHandlerContext in testbed.
2020-09-25 11:37:37 +09:00
Sergei Malafeev 5498ab2b82
validate version from traceparent according to spec (#1688)
* #1674 validate version from traceparent according to spec

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* add test

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* add test

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* rename TraceVersion to WireFormatUtils

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* rename test method

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* use precalculated versions

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* get rid of unneded class

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* get rid of empty lines

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* fix style

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
2020-09-25 09:05:29 +09:00
Bogdan Drutu 3d72a7d86d
Avoid usage of getSpanWithoutDefault when possible. (#1690)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-09-24 15:17:12 +09:00
Bogdan Drutu 2d146bbbb9
Remove constant labels from instruments and MetricData (#1692)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-09-24 15:14:04 +09:00
Christian Neumüller d9bd619b55
Add exception.escaped, clean up exception attributes javadoc. (#1672) 2020-09-23 08:50:49 -07:00
John Watson 136d5b9b7f
Make the getKey method non-nullable (#1682)
This was done by tricking AutoValue with a separate field for the storage.
2020-09-22 21:30:23 -07:00
Jason Plumb cfbe6bfe81
Rename dangling references to MeterRegistry (#1683)
* rename getMeterRegistry() to getMeterProvider() in javadocs.

* rename meterRegistry variable to meterProvider

* reformat
2020-09-22 19:37:47 -07:00
John Watson bd51a606a7
Remove the obsolete HTTP_STATUS_TEXT semantic attribute. (#1679) 2020-09-22 10:52:37 -07:00
John Watson 4f613da552
Reverse the precedence on Labels and Attributes to prefer the last one added, rather than the first. (#1656)
* Reverse the precedence on Labels and Attributes to prefer the last one added, rather than the first.

Note: this necessitated changing the way Resources were merged, and the way recordException was implemented.
Added an addAll method to the builder to support efficiently addition of attributes from existing attributes.

* run the formatter

* revert 2 unneeded assertion changes

* Update from rebase
2020-09-21 15:58:03 -07:00
John Watson bf52c0af73
Implement the keyed-attributes proposal (#1631)
* Add a generic type for the key on the ImmutableKeyValuePairs.
This necessitated changing the `get` to `getValue` to avoid clashing with the java.util.Map interface.
Also introduced convenience sub-interfaces for consuming labels and attributes, so consumers don't have to worry about the types if they don't want to.

* Make AttributesMap not extend map, and restore the get method name for Attributes.

* key class and implementation

* key class and implementation

* The code compiles

* little tweaks

* some cleanup, tests are passing

* remove AttributeValue and clean up misc. references to it.

* clean up some unused bits

* add a TODO

* a bit of cleanup; fix a todo

* update for changes from the main branch

* Change method to get the underlying key.
Move the key creators to a AttributesKeys class.
Hide the implementation classes and replace with interface use.

* use autovalue for the key implementations

* fix javadoc issues

* update benchmark keys, and a few tweaks from PR review

* Add javadoc notes to encourage using the lower-overhead attribute options.

* Add javadoc clarifying subclass responsibilities around empty keys.

* make the compareTo on AttributeKeyImpl null-safe, for extra safety

* fix formatting
2020-09-21 08:52:40 -07:00
John Watson 27090b8336
Switch to java 8 (#1665)
* switch to java 8

* update the READMEs and use Object.equals in a couple of cases to test that we're really compiling for java 8/android 24.

* formatting

* use the newer release options for the build, and change the int test to not be java 7 any more.

* switch back to source/target compatibility

* sure wish I could run docker locally to test this out.
2020-09-19 11:28:13 +09:00
Giovanni Liva 2f9443b3eb
Case-insensitive names for metric instruments (#1643)
* Fix case-insensitive

* s/NAME_MAX_LENGTH/METRIC_NAME_MAX_LENGTH
2020-09-16 16:31:42 +09:00
John Watson ddb38970fa
Move the TraceFlags isSampled boolean into the SpanContext (#1628)
* move TraceFlags into the SpanContext, and expose the relevant flags.

* Cleanup from rebase from main branch

* Address comments from PR review

* Update extensions/trace_propagators/src/main/java/io/opentelemetry/extensions/trace/propagation/AwsXRayPropagator.java

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

* Undo @anuraaga's bad suggestion. ;)

* change the traceFlags input to the TraceContext be a byte, rather than a boolean.

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-09-14 09:28:08 -07:00
Anuraag Agrawal 751177f6f1
Add FaaS attributes. (#1634)
* Add FaaS attributes.

* Move to javadoc
2020-09-11 10:55:07 -07:00
John Watson d42d4cd9e2
Add a generic type for the key on the ImmutableKeyValuePairs. (#1619)
* Add a generic type for the key on the ImmutableKeyValuePairs.
This necessitated changing the `get` to `getValue` to avoid clashing with the java.util.Map interface.
Also introduced convenience sub-interfaces for consuming labels and attributes, so consumers don't have to worry about the types if they don't want to.

* Add some javadoc to the new interfaces.

* Make AttributesMap not extend map, and restore the get method name for Attributes.

* make ImmutableKeyValuePairs also have a parameterized key type
2020-09-08 19:18:58 -07:00
Sergei Malafeev f13fd58d25
#1372 Have Propagators expose only a singleton instance (#1622)
Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
2020-09-07 10:47:05 -07:00
John Watson 485cc52c6f
SpanContext hides the TraceId/SpanId implementations (#1594)
*  This is a combination of 2 commits.
 This is the 1st commit message:

WIP on converting to String-based SpanContext

don't hand out the byte arrays publicly, but require making copies

make sure to hand out fresh invalid byte arrays.

Use strings for span and trace ids.

Switch over to CharSequence instead of String for the ids

Fix a couple of places that were casting to String

Add some simple wrappers for the generated longs to save converting until the last moment to the character-based representation.

introduce a reusable threadlocal char buffer for generating random ids.

update for changes from upstream

Change the SpanContext to store the ids as Strings internally
Change the id access methods on SpanContext to be clearly labeled as the base16 representations
Add a new create method that allows specifying offsets for traceId and spanId CharSequences

Provide an option for creating a SpanContext from longs or Strings, optionally.

fix a typo

update from upstream

 The commit message #2 will be skipped:

 don't hand out the byte arrays publicly, but require making copies

* WIP on converting to String-based SpanContext

* Update the SpanContext to only store Strings internally for Trace and Span ids.

* remove dead files

* cleanup some CharSequence usages to String

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

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

* Update extensions/trace_propagators/src/main/java/io/opentelemetry/extensions/trace/propagation/B3PropagatorInjectorSingleHeader.java

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

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

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

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

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

* updates from PR suggestion fubars

* some cleanup from PR feedback

* Switch back to String from CharSequence

* Get rid of the overload with the offsets

* Lots of bits of cleanup from PR feedback.

* more renaming of base16 to hex

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-09-03 10:03:41 -07:00
Christian Neumüller 8418753af7
Fix noParent being ignored after explicit parent. (#1617) 2020-09-02 10:28:44 -07:00
dengliming ed08e9f287
Add an overload to the recordException method to support additional attributes (#1599)
* Add an overload to the recordException method to support additional attributes

* Fix Codecov

* Fix review

* Fix review
2020-08-28 12:41:36 -07:00
Sergei Malafeev 88582202c4
Rename 'HttpTextFormat' to 'TextMapPropagator' (#1586)
* #1581 Rename 'HttpTextFormat' to 'TextMapPropagator'

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* fix long line

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* add change log entry

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>

* add change log entry

Signed-off-by: Sergei Malafeev <sergei@malafeev.org>
2020-08-26 08:19:48 -07:00
John Watson 1175997dd1
Remove two unused internal methods. (#1591) 2020-08-25 21:06:31 -07:00