Commit Graph

61 Commits

Author SHA1 Message Date
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
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