Commit Graph

37 Commits

Author SHA1 Message Date
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
Terry (Tianyu) Wang ce8cfd4d5b
Changed TraceConfigz zPage form to use POST request (#1521)
* Removed URLEncoder

* Fixed typo

* Added URLDecoding

* Included comment for string replacement

* Added unit tests for special characters in span names

* Resolved URL decoding issues

* Moved url decoding to parseQueryMap and updated the corresponding unit tests

* Added a README file for zPage quickstart

* Add images for README

* Updated README

* Add frontend images

* Add backend images

* Added our design doc

* Added details on package

* Reworded a few lines

* Moved DESIGN.md to a docs folder and changed gradle config to implementation

* Changed wording regarding HttpServer requirement

* Added zpages folder under docs, resolved broken image links

* Resolved comments for the design md file

* Made a few wording changes

* Wrote a benchmark test for TracezSpanBuckets (#23)

* Scaffolded logic for basic benchmark tests

* Wrote benchmark tests for TracezSpanBuckets

* Updated README with benchmark tests

* Changed the wording slightly

* Updated README file (#25)

* Wrote benchmark tests for TracezDataAggregator (#24)

* Scaffolded logic for basic benchmark tests

* Wrote benchmark tests for TracezSpanBuckets

* Updated README with benchmark tests

* Changed the wording slightly

* Added a set of benchmark tests for TracezDataAggregator

* Modified README formatting

* Changed benchmark test to negate dead code elimination

* Added Javadocs to the TracezDataAggregator benchmark tests

* Removed benchmark results from README and added a param to the TracezDataAggregator benchmark tests

* Update sdk_extensions/zpages/src/jmh/java/io/opentelemetry/sdk/extensions/zpages/TracezDataAggregatorBenchmark.java

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

* Added multiple param values for TracezDataAggregatorBenchmark

* Changed TraceConfigz zPage form submit to use POST request

* Added requestMethod parameter to emitHtml, limited TraceConfig change on POST request only

* Removed duplicate parse function, added test for update on POST request only

* Added separate method for processing request

* Removed unnecessary error check in tests, used try resources for inputstream

Co-authored-by: williamhu99 <wilhu@google.com>
Co-authored-by: William Hu <32604217+williamhu99@users.noreply.github.com>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-08-12 08:20:29 -07:00
William Hu bcb1d4aca2
Wrote benchmark tests for the zPages module (#1504)
* Removed URLEncoder

* Fixed typo

* Added URLDecoding

* Included comment for string replacement

* Added unit tests for special characters in span names

* Resolved URL decoding issues

* Moved url decoding to parseQueryMap and updated the corresponding unit tests

* Added a README file for zPage quickstart

* Add images for README

* Updated README

* Add frontend images

* Add backend images

* Added our design doc

* Added details on package

* Reworded a few lines

* Moved DESIGN.md to a docs folder and changed gradle config to implementation

* Changed wording regarding HttpServer requirement

* Added zpages folder under docs, resolved broken image links

* Resolved comments for the design md file

* Made a few wording changes

* Wrote a benchmark test for TracezSpanBuckets (#23)

* Scaffolded logic for basic benchmark tests

* Wrote benchmark tests for TracezSpanBuckets

* Updated README with benchmark tests

* Changed the wording slightly

* Updated README file (#25)

* Wrote benchmark tests for TracezDataAggregator (#24)

* Scaffolded logic for basic benchmark tests

* Wrote benchmark tests for TracezSpanBuckets

* Updated README with benchmark tests

* Changed the wording slightly

* Added a set of benchmark tests for TracezDataAggregator

* Modified README formatting

* Changed benchmark test to negate dead code elimination

* Added Javadocs to the TracezDataAggregator benchmark tests

* Removed benchmark results from README and added a param to the TracezDataAggregator benchmark tests

* Update sdk_extensions/zpages/src/jmh/java/io/opentelemetry/sdk/extensions/zpages/TracezDataAggregatorBenchmark.java

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

* Added multiple param values for TracezDataAggregatorBenchmark

Co-authored-by: Terry Wang <wtyanan@google.com>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-08-06 20:02:41 -07:00
Anuraag Agrawal e2554f40e9
Migrate most remaining tests to JUnit5. (#1514) 2020-08-06 16:23:11 +02:00
Anuraag Agrawal 8d0a4787ff
Migrate from Truth to AssertJ (#1493)
* Migrate from Truth to AssertJ

* Fix test

* Update andAndUpdate
2020-08-03 17:08:36 -07:00
Anuraag Agrawal 6dffbb8fc4
Migrate tests to JUnit5 (#1489)
* Add JUnit 5 dependency

* Revert unintended
2020-07-31 11:10:27 -07:00
Terry (Tianyu) Wang ad6f9e364c
Implemented TraceConfigZ zPage (#1441)
* Implemented TraceConfigZ zPage (#22)

* Added link to index zpage

* Used AutoValue for TableRow classes

* Changed wording of HTML content

* Changed Builder to interface, fixed build issues

* Removed tableRow classes, added omitEmpty in parseQueryMap

* Added test for invalid inputs

* Changed to use illegalArgumentException
2020-07-30 11:24:50 -07:00
William Hu 09c8c9ed94
Added preliminary documentation for the zPages contrib module (#1455) 2020-07-29 21:19:15 +02:00
Bogdan Drutu ab95a19680
Remove isSampled, follow up from #1449 (#1450)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-07-23 08:38:10 -07:00
Peter Travers 810379f88b
Refactor decision to sampling result (#1449)
* Refactor decision to sampling result

* Fix bad refactor samplingResult => decision

* Fix decision not sampling result

* Fix comments with divergent explanations of same entity

* Fix make comments clearer

* Add links to SamplingResult
2020-07-22 15:27:13 -07:00
William Hu 19da7d01cb
Removed URLEncoder from TracezZPageHandler (#1431)
* Removed URLEncoder

* Fixed typo

* Added URLDecoding

* Included comment for string replacement

* Added unit tests for special characters in span names

* Resolved URL decoding issues

* Moved url decoding to parseQueryMap and updated the corresponding unit tests
2020-07-21 19:24:41 -07:00
Terry (Tianyu) Wang 7c81379393
Removed nullable annotation for ZPagesHandlers container in IndexZPageHandler (#1429)
* Removed nullable annotation for ZPageHandlers container

* Fixed java style issues

* Removed null check
2020-07-17 10:04:39 -07:00
William Hu a938166a07
Added unit tests for SpanBucket (#1424)
* Added unit tests for SpanBucket

* Included a comment to make the last test more clear

* Rewrote the concurrency test

* Removed assertion from exception and added a time limit for the concurrency test case
2020-07-17 08:20:24 -07:00
Terry (Tianyu) Wang df14623402
Implemented index page for zPages (#1423)
* Added two abstract getter method for obtaining page information

* Added page information getter method

* Implemented index zPage handler

* Implemented index page for zPages

* Added unit test for index zPage

* Small style and comment fixes

* Increased font size, code style fix

* Fixed font size issue
2020-07-16 15:55:42 -07:00
Terry (Tianyu) Wang 98cb75695d
Fixed immutable list sorting bug in TraceZ zPage (#1420)
* Fixed immutable list sorting bug

* Added more test covering SpanDetails section

* Used ImmutableList.sortedCopyOf instead of ArrayList, added a test for unknown ztype

* Switched to immutableMap and immutableList
2020-07-16 10:08:40 -07:00
John Watson cb04118a21
Fix errorprone errors. (#1417) 2020-07-15 19:46:37 +02:00
Terry (Tianyu) Wang 373fbf4a2e
Implemented base zPages classes and TraceZ zPage (#1380)
* Implemented a span processor for the TraceZ zPage

* Implemented aggregation logic for running and latency based spans,
summary table generation with running span logic

* Implemented aggregation logic for error based spans

* Finished implementation of TraceZ zPage summary table

* Finished implementation of HttpHandler, HttpServer, and TraceZ zPage

* Refactored the sdk_contrib folder to follow updated syntax

* Removed duplicate function

* Changed inline base64 images

* Fixed copyright statement

* Modified the TracezSpanProcessor to only allow for a limited number of completed spans (#17)

* Modified the TracezSpanProcessor to only allow for a limited number of completed spans

* Renamed count functions and reduced logic in addToBucket

* Fixed typos and turned SpanProcessor and DataAggregator to package private

* Separated SpanBuckets and LatencyBoundaries from TracezDataAggregator

* Switched to PrintStream, removed bufferWritter, removed factory and changed to package private constructor, added documentation for getTracerzHandler behavior, and other small fixes

* Fixed package name

* Changed way of registering handlers, changed atomicBoolean to final, removed unnecessary lock

* Changed registerTracezZPageHandler to package private

* Fixed javadoc styling and wording

* Added constants for splitters, changed httpserver to compileOnly dependency

* Removed FQNs from backend files

* Removed style errors

* Updated TracezSpanProcessor to maintain a set of span names incrementally

* Added visibleForTesting tag, adjusted HTML expression

* Removed unused functions in the data aggregator

* Made TracezSpanBuckets thread-safe

* Changed test to use Mockitorule, removed unnecessary Formatter, unrolled attribute value

* Changed test with @Mock to use Mockito test runner

* Renamed LatencyBoundaries to LatencyBoundary and cleaned up code

* Replaced the EvictingQueue with a faster SpanBucket class and modified checks in TracezDataAggregatorTest

* Addressed additional comments

* Migrated images to resources, used logger to log errors, and other minor fixes

* Moved a variable to within a class in TracezZPageHandler

* Removed printStackTrace, added test for query parameter

* Changed logger to static field, used log method to log detailed stackTrace

* Made minor fixes

* Resolved unmodifiable list error with getOkSpans and getErrorSpans

* Changed map @Mock to empty map, added more test

* Changed test runner

Co-authored-by: williamhu99 <wilhu@google.com>
Co-authored-by: William Hu <32604217+williamhu99@users.noreply.github.com>
2020-07-15 08:51:29 -07:00
John Watson e1ddcaec24
update errorprone, grpc and autovalue (#1403)
Also, clean up new errorprone warnings
2020-07-12 07:56:44 -07:00
Lei Wang 241017bd4e
support container id in AWS ECS plugin (#1384)
* support container id in AWS ECS plugin

* fix comments; change apache common to guava
2020-07-01 10:26:52 -07:00
Lei Wang 4008f7d515
support aws plugins EC2/ECS/Beanstalk (#1369)
* support aws plugins EC2/ECS/Beanstalk

* support aws plugins EC2/ECS/Beanstalk

* change to Guava Files, change Map to Attributes

* Remove DockerHelper until has container.id in sematic conventions.
2020-06-25 16:17:26 -07:00
jarebudev 3273841899
stop description test from immediately exiting before the sampler is retrieved by rpc (#1364) 2020-06-22 08:03:56 -07:00
Bogdan Drutu 4633676593
Use lambda references where possible (#1355)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-18 11:54:14 -07:00
Bogdan Drutu 76ef38955a
Start using real java8 in tests. (#1352)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-18 09:09:28 -07:00
Bogdan Drutu aaec09d68d
Change samplers to use the new Attributes class (#1347)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-17 17:23:09 -07:00
Bogdan Drutu b5520ee14c
Change resource to use the new Attributes class (#1345)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-17 14:20:23 -07:00
John Watson f1f5975d5c
Introduce an ReadableAttributes interface, with 2 implementations (#1336)
* Introduce an Attributes interface and have ImmutableAttributes and the AttributesMap implement it.

* make the attribute limiting a little clearer.

* tiny javadoc fix

* Rework to restore the Attributes class, and introduce a ReadableAttributes interface

* polish the javadoc a bit

* fix some broken javadoc

* revert example change; revert test name change

* javadoc de-escalation

* fix bad merge
2020-06-17 09:29:52 -07:00
Nikita Salnikov-Tarnovski c558a9651b
Rename contrib to extensions (#1335) 2020-06-17 16:51:14 +02:00