Commit Graph

76 Commits

Author SHA1 Message Date
Anuraag Agrawal 9efb503544
Fix build breakage due to conflicting merges. (#1844)
* Fix build breakage due to conflicting merges.

* Test too
2020-10-21 13:33:00 +09:00
John Watson f20b3d73a9
Change the sampling API to take a parent Context, rather than SpanContext (#1840) 2020-10-21 12:53:47 +09: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
Anuraag Agrawal 3957d2a281
Synchronize access in TestLogExporter to make sure memory updates are synced. (#1831) 2020-10-19 12:50:53 -07:00
Anuraag Agrawal cc122e7e4c
Replace restassured test assertion with okhttp/jackson (#1817) 2020-10-16 08:13:18 -07:00
John Watson fa1e876df2
Move the stress test code to being a TestContainers-based test. (#1803)
* Move the stress test code to being a TestContainers-based test.
Upgrade testcontainers version to work with the latest docker-for-mac.
Add metrics in the OTLP exporter, to record success/failure of export.
Use the TestContainers annotation to disable those tests when docker isn't present.

* remove a bunch of commented out stuff that shouldn't have been added

* disable the test without docker

* use specific docker image tags to keep testcontainers from downloading the world

* delete unneeded file

* fix from upstream change
2020-10-15 19:30:38 -07:00
John Watson 57097873c8
rename StatusCanonicalCode to StatusCode (#1804) 2020-10-15 17:55:05 -07:00
Xi Xia 329d7876bd
toString calls through getDescription (#1813) 2020-10-15 15:58:16 -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
Christian Neumüller e539890037
Add Context arg to SpanProcessor.OnStart. (#1792) 2020-10-14 11:34:19 +09:00
Anuraag Agrawal e2b5245d73
Rename newBuilder to builder for consistency. (#1790) 2020-10-13 13:17:06 -07:00
John Watson 22281d6f61
Change the Sampler interface to allow a SamplingResult to update the TraceState (#1707)
* 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.
2020-10-12 22:46:02 -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
Anuraag Agrawal d361dfa2f9
Remove SpanData implementation classes from public API. (#1761) 2020-10-06 10:17:11 -07:00
Anuraag Agrawal f91baf1890
Loosen test waiting time and migrate to junit5 while here. (#1762) 2020-10-06 08:04:29 -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 52477d66bd
Remove helper method withDescription from ImmutableStatus (#1752)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-10-05 09:04:45 -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
John Watson 0746ddbf68
Expose a new TracerSdkManagement interface on the OpenTelemetrySdk class. (#1723)
* have the TracerSdkProvider return the public interface, rather than a package-access class.

* change the OpenTelemetrySdk to return a management interface, rather than the SDK implementation class directly.

* formatting fix

* rename methods/parameters for the new interface
get rid of almost all production-code references to the TracerSdkProvider

* update some docs that still refer to using the old method/class
2020-10-02 10:39:07 +09:00
David Poncelow 64c2b8cc65
initial commit of logging support extension (#1524)
* initial commit of logging support extension

* complete move from extensions to sdk_extensions

* address code review comments

* move logging_support to logging/support

* missed test update in last commit

* code format

* change list to queue in implementation, collection in api

* missed making a utility method static

* fix a broken test

* Update sdk_extensions/logging/support/src/main/java/io/opentelemetry/logging/api/LogRecord.java

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>

* reworked to align with how we batch process spans

* move of CompletableResultCode and formatting

* update AnyValue to use long instead of int

* address code review comments

rename Exporter to LogExporter, move to 'export' package
rename LogExporter.accept(data) to LogExporter.export(data)
decrease flush interval from 5000 to 200ms
return CompletableResultCode from LogExporter.shutdown()
change traceId and spanId types to String from byte[]

* implement BatchLogProcessor.fromConfigMap

* rearrange packages

* add readme

* respond to review feedback, refactored BatchLogProcessor

* added a couple tests

* update to use new Attributes, remove support directory, public LogRecord getters

Co-authored-by: Tigran Najaryan <4194920+tigrannajaryan@users.noreply.github.com>
2020-10-01 16:08:47 +09:00
Anuraag Agrawal 7fe2cd55be
Use awaitility / higher timeout to reduce flakiness. (#1729) 2020-09-30 08:21:24 -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
Lei Wang 056e63f354
support aws eks attributes (#1671)
* support aws eks attributes

* call k8s api by java native sdk

* fix code review

* fix code review

* fix code review
2020-09-27 12:24:26 -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
Anuraag Agrawal 10ea529fff
Fill cloud.provider for AWS resources. (#1696)
* Fill cloud.provider for AWS resources.

* Extract constant.
2020-09-24 08:16:22 -07:00
Anuraag Agrawal f63c84f4e8
Add incubator module with utilities for mutating SpanData. (#1625)
* Add incubator module with utilities for mutating SpanData.

* Finish
2020-09-24 08:11:55 -07:00
Anuraag Agrawal 903193cda6
Log EC2Resource messages at FINE. (#1695) 2020-09-24 08:10:01 -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
dengliming c571e96bd8
Rename ProbabilitySampler to TraceIdRatioBased (#1666) 2020-09-20 10:40:10 +09: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
Eunice Kim 0ec2914275
Updated sampling result name (#1661)
* Changed all sampling result names

* Changed all sampling result names - spanbuilderSdkTest

* Changed all sampling result names

* Changed all sampling result names - spanbuilderSdkTest

* fixed formatting violations

* fixed formatting violations

* Update sdk/tracing/src/main/java/io/opentelemetry/sdk/trace/Sampler.java

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

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-09-18 10:36:56 -07: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
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
Anuraag Agrawal c3a893a88c
Remove auto-config (#1620) 2020-09-03 18:01: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
John Watson 225acce822
Update the README and CHANGELOG for 0.8.0 (#1614)
* draft of the changelog for 0.8.0

* add the proto/otlp exporter update

* update the README for 0.8.0

* a couple more updates
2020-09-01 13:25:33 -07:00
Anuraag Agrawal c6c179c267
Make sure forceFlush / shutdown can have callers wait for them to be done by returning CompletableResultCode. (#1571)
* Make sure forceFlush / shutdown can have callers wait for them to be done by returning CompletableResultCode.

* Merge
2020-08-28 10:51:39 -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
jarebudev 20669f48b6
1556 change resourceconstants to resourceattributes (#1590)
* renamed ResourceConstants to ResourceAttributes, and change to use attributesetter pattern

* tidy up javadoc

* tidy up javadoc
2020-08-25 21:08:44 -07:00
Anuraag Agrawal 07af1d1c1b
Migrate AwsResource to ResourceProvider. (#1582) 2020-08-25 09:20:35 -07:00
John Watson 7e87a69ae0
Introduce a ReadWriteSpan interface and pass it to the onStart of the SpanProcessor (#1574)
* start working on a ReadWriteSpan for startSpan

* Finish converting the disruptor and the unit tests to the new model.

* Add some simple javadoc to the ReadWriteSpan interface
2020-08-24 07:48:27 -07:00
jarebudev ca85d8f0eb
prevent parent spanContext from being null in Samplers (#1563) 2020-08-20 10:23:47 -07:00
Anuraag Agrawal cb50978106
Implement OS and some process resource attributes. (#1555)
* Implement OS and some process resource attributes.

* Update link in javadoc

* pid, docs

* Don't support Android
2020-08-20 09:42:30 -07:00