Commit Graph

258 Commits

Author SHA1 Message Date
Armin Ruech 36f80e1fdc Change DistributedContextSdk.Builder to use current dctx as implicit parent (#439)
* Change DistributedContextSdk.Builder to use current DistributedContext as implicit parent if none is provided explicitly

* Change DistributedContext.setNoParent to prevent inheriting an implicit context

* Clarify doc for DistributedContext.setNoParent

* Disallow null for DistributedContext.setParent
2019-06-27 14:20:54 -07:00
Yang Song 6378db90fe Replace DistributedContext.getIterator with getEntries. (#429)
* Replace DistributedContext.getIterator with getEntries.

Fixes #401.

* Clarify immutability in javadoc.
2019-06-27 10:38:29 -07:00
Pavol Loffay bff193d462 Connect span builder and span in SDK (#430)
* Connect span builder and span in SDK

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Use proto in tests

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Remove

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix comments

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix review comments

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Add sampling attributes to span

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Remove line

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-06-27 10:28:58 -07:00
Armin Ruech ed42237b6c Remove DistributedContext.Builder.buildScoped() (#428)
* Remove DistributedContext.Builder.buildScoped()

* Specify default parent for DistributedContext
2019-06-25 11:01:39 -07:00
Pavol Loffay e715cd2d40 Remove public abstract from interface (#435)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-06-25 10:27:34 -07:00
Yang Song 22fde62aba Fix a potential ClassLoader deadlock and add missing Javadocs. (#411)
* Fix a potential ClassLoader deadlock and add missing Javadocs.
2019-06-22 16:18:04 +02:00
Yang Song 1511e1b482 Fix all errorprone warnings, ignore genproto files. (#414)
Fixes #375.
Fixes #182.
2019-06-19 18:09:43 -07:00
Armin Ruech 8520de5581 Tracer API: Fix doc regarding default propagation formats (#405) 2019-06-17 19:05:22 +02:00
Yang Song 69e2c48628 Fix an incorrect javadoc. (#407) 2019-06-14 18:15:08 -04:00
Carlos Alberto Cortez 7222d37ee1
Make SpanData take *base* Link objects. (#403)
We were taking SpanData.Link objects instead.
2019-06-12 22:38:44 +02:00
Carlos Alberto Cortez 50a2db42b2 Rename tags to dctx (#381)
* Rename tags to dctx (and related members).

* Implement the renamed dctx layer for the Sdk.

* Fix inline doc.

* Rename dctx to distributedcontext.

* Rename distributedcontext Attribute* to Entry*.

* Rename dctx to distributedcontext in the Sdk.

* Update the recently added SDK classes.
2019-06-10 11:24:54 -07:00
Yang Song 7684efbcb8 Use random IDs instead of invalid in default span. (#382)
* Use random IDs instead of invalid in default span.

* Add getInvalid API.
2019-06-10 08:58:24 -07:00
Bogdan Drutu b0a49827aa
Remove fully qualified Samplers class in comments. (#398) 2019-06-07 14:51:05 -07:00
Pavol Loffay cb0e85d433 Move samplers to util package (#396)
* Move samplers to util package

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Move tests

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-06-07 14:28:35 -07:00
Yang Song bfe56101d1 More cleanup on static variables. (#397) 2019-06-07 13:22:29 -07:00
Carlos Alberto Cortez c2c7ed4975 Make Link an interface. (#395)
* Make Link an interface.

* Rename LinkTest to SpanDataLinkTest.
2019-06-07 09:45:10 -07:00
Yang Song fb0f5339cd Make invalid SpanContext package-private. (#394) 2019-06-06 14:26:04 -07:00
Yang Song 27af3a17c3 Rename Blank SpanContext to Invalid. (#383) 2019-06-06 12:48:41 -07:00
Bogdan Drutu f2f353d0f1
Fix examples in Meter. (#384) 2019-06-06 11:49:04 -07:00
Pavol Loffay c62fe501b8 Remove resource setter and getter from Tracer (#387)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-06-06 11:33:22 -07:00
Carlos Alberto Cortez c75cc68123 Clean up the Link handling in Span. (#388)
* Clean up the Link handling in Span.

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

Co-Authored-By: Armin Ruech <armin.ruech@gmail.com>

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

Co-Authored-By: Armin Ruech <armin.ruech@gmail.com>
2019-06-06 11:30:07 -07:00
Pavol Loffay 4bbb74dee2 Fix comment in startSpan (#386)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-06-06 09:10:19 -07:00
Carlos Alberto Cortez bdfdeef7e7 API: Have TraceId/SpanId constructors taking long values. (#365)
* Have TraceId/SpanId constructors taking long values.

* Add a clarification on the TraceId/SpanId ctors taking longs.

* Add one more small note about equivalency.
2019-06-05 17:01:02 -07:00
Yang Song f62dbff017 Use static methods instead of variables. (#379)
* Each DefaultSpan has a unique span id. Remove INSTANCE.

* Use static methods instead of variables. Fixes #309.

* Fix the order of static fields.

* Revert random SpanId from this PR.
2019-06-05 16:34:53 -07:00
Yang Song 4172855fcd Rename BlankSpan to DefaultSpan. (#376) 2019-06-05 13:14:39 -07:00
Yang Song c298234a9b Fix a stale Javadoc. (#377) 2019-06-05 08:58:28 -07:00
Carlos Alberto Cortez 005db45a0f Fix comment for addEvent() as there is no setAttributes() anymore. (#370) 2019-06-03 14:27:28 -07:00
Carlos Alberto Cortez db59b5e10b Fix comment for Span.end() as there's no overload taking options anymore. (#371) 2019-06-03 14:27:05 -07:00
Carlos Alberto Cortez 16477dc96f Add a small clarification on Span.Builder.setNoParent(). (#364)
* Add a small clarification on Span.Builder.setNoParent().

* Add a comment for setParent() too.
2019-05-31 12:55:42 -07:00
Yang Song 0a0a27eeeb Rename package resource to resources. (#366)
* Rename package resource to resources.

Fixes #259.

* One more replace.
2019-05-31 12:55:02 -07:00
Yang Song 32fad432ca Add a note in SpanData documentation. (#361) 2019-05-30 17:15:25 -07:00
Tyler Benson d0e397cc9a Move [Span|TagMap]InScope and share between api/sdk (#348)
* Move [Span|TagMap]InScope and share between api/sdk

Removes duplication between the two projects

Fixes #333

* Add javadocs to new classes.

* Add @since attributes to javadocs

* Remove CurrentTagMapUtils

* Route scope creation through ContextUtils

and make scope classes access restricted.
2019-05-30 10:53:28 -07:00
Carlos Alberto Cortez 2afd4d3be5 Apply same logic for parent to TagMap as we do for Span. (#356) 2019-05-30 08:52:33 -07:00
Bogdan Drutu 4a3a335491
Move simple samplers to the Samplers class. (#360) 2019-05-30 08:03:44 -07:00
Bogdan Drutu 4ca9c116f0
Replace deprecated isSameAs with isSameInstanceAs. (#359)
* Replace deprecated isSameAs with isSameInstanceAs.

* ./gradlew goJF
2019-05-29 21:02:28 +03:00
Pavol Loffay ade08cdcd2 Return sampler decision with tags from Sampler (#339)
* Make sampler return sampling decision

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix review comments

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Use package visibility

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Define as final

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Rename do decision and fix javadoc

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Make it package private

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Rename to simpledecision

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-27 15:34:43 +03:00
Bogdan Drutu fc87e7593e
Change DefaultTagger to propagate the TagMap in the process. (#332) 2019-05-22 16:17:49 +02:00
Bogdan Drutu 3a7e634260
Rename Noop[Tracer|Tagger|Meter] to Default[Tracer|Tagger|Meter]. (#321)
* Rename Noop[Tracer|Tagger|Meter] to Default[Tracer|Tagger|Meter].

* Update variable names to default[Tracer|Tagger|Meter].
2019-05-21 13:33:17 +02:00
Carlos Alberto Cortez 792ffa9c59
Make TimedEvent accept io.opentelemetry.trace.Event objects. (#328) 2019-05-20 18:21:16 +02:00
Pavol Loffay eb832c9116
Define noop tracer/metrer/tagger as singletons (#322)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-20 09:25:07 +02:00
Pavol Loffay 911b4cbc89
Prohibit returning null in extract javadoc (#327)
* Prohibit returning null in extract javadoc

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-17 19:53:10 +02:00
Carlos Alberto Cortez c8f0f7cf9c
Span parent cleanup (#296)
* Set the Span's parent from its Builder.
* Add Span.Builder.setNoParent().
2019-05-17 18:30:50 +02:00
Pavol Loffay 3c30af2bc5
Fix tracer provider javadoc (#324)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-17 18:03:47 +02:00
Bogdan Drutu 7f4d9536ad
Make Event interface. (#317) 2019-05-17 01:46:20 -07:00
Bogdan Drutu 3c022ba9d8
Update Link comments in Span (#318)
* Update Link comments in Span

* ./gradlew goJF
2019-05-16 07:08:15 -07:00
Bogdan Drutu 584b31fb1a
Rename noop classes to NoopMainClass. (#315) 2019-05-16 06:48:52 -07:00
Bogdan Drutu 6ff77bc50b
Make Sampler an interface. (#316) 2019-05-15 18:11:49 -07:00
Bogdan Drutu ed5bfc6d26
Add support to directly interact with current Context in the unsafe for tags. (#314) 2019-05-15 17:26:06 -07:00
Pavol Loffay f11a0186ba Propagate span context in noop (#301)
* Propagate span context in noop

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Remove comment

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-15 16:58:18 -07:00
Pavol Loffay 3937226790 Clarify Link javadoc (#304)
* Clarify Link javadoc

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Revert and remove different

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-15 09:29:30 -07:00
Pavol Loffay 16a04488e1
Move providers to component.spi packages (#303)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-15 09:32:22 +02:00
Bogdan Drutu db6b5fb96e
Cleanup ContextUtil usages. (#306) 2019-05-14 16:19:05 -07:00
Pavol Loffay e143bccfb6
Add tagger to global registry (#299)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-14 16:04:32 +02:00
Pavol Loffay 33e9c0e3ba
Propagate blank span through context (#258)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-14 15:46:25 +02:00
Pavol Loffay 8022e33bc6
Use w3c tracecontext format in noop tracer (#274)
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-14 14:10:07 +02:00
Pavol Loffay 92015fee1a
Add W3C tracecontext propagation (#273)
* Add W3C tracecontext propagation

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Remove empty line

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-13 17:14:46 +02:00
Bogdan Drutu ba185fd18c
Fix the build because of the race merge between spi Meter and remove Stats. (#271) 2019-05-12 14:56:36 -07:00
Bogdan Drutu e7556411b6
Fix small warnings. (#267) 2019-05-10 18:56:31 -07:00
Bogdan Drutu 67f552363c
Move stats to metrics. (#241) 2019-05-10 16:50:39 -07:00
Pavol Loffay 1eec5efbfa Add meter to global registry (#257)
* Add Meter to global registry

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Add nullable

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Add test

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* reset before class

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-10 13:12:06 -07:00
Bogdan Drutu 750e16c5e7
Remove metric registry and fix examples. (#238) 2019-05-07 09:34:18 -07:00
Pavol Loffay 3cc0af53af
Remove Trace class (#252)
* Remove Trace class

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix check

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix comments

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* use OT by default in shim

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-07 17:50:45 +02:00
Bogdan Drutu 53a2ea937c
Move TagMapBuilder to TagMap.Builder for consistency. (#251) 2019-05-07 08:20:25 -07:00
Pavol Loffay 80e5a1d2f3
Add a global registry (#218)
* Add a gobal registry for tracer

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Use foreach

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
2019-05-07 13:14:25 +02:00
Bogdan Drutu 898f81bf1c
Remove helper functions that interact with Context from Tracer and move into contrib (#246) 2019-05-03 08:44:05 -07:00
Bogdan Drutu ca0ec9dfa8
Replace everywhere OpenConsensus with OpenTelemetry (#244)
* Replace everywhere OpenConsensus with OpenTelemetry

* Fix javadoc references.

* Update javadoc exclude in the api.
2019-05-02 13:46:04 -07:00
Carlos Alberto Cortez 354e776ebf Rename TextFormat to HttpTextFormat, and related. (#188)
* Rename TextFormat to HttpTextFormat, and related.

* Correct a TextFormat mention in the inline docs.

* Clean some inline bits.

* Fix the build.
2019-04-30 12:08:53 -07:00
Bogdan Drutu a63080da46
Rename Cumulative to Counter, and use names like templates GaugeLong. (#221) 2019-04-26 14:53:59 -07:00
Bogdan Drutu 5344ab14f9
Remove derived metrics and support a callback for the entire metric. (#219)
* Remove derived metrics and support a callback for the entire metric.

* Fix copyright, add javadoc and remove android compatibility restriction.

* Remove unused interfaces.
2019-04-26 14:32:06 -07:00
Bogdan Drutu ecf24c1a92
Make Measurement an opaque interface in the API. (#216) 2019-04-26 11:22:51 -07:00
Bogdan Drutu 96a34987e3
Change [Double|Long]Point to TimeSeries. (#217) 2019-04-25 18:06:53 -07:00
Bogdan Drutu ad27dc99e8
Restrict access to the key, add helper methods to interact with Context. (#211) 2019-04-25 10:35:35 -07:00
Bogdan Drutu 5d9b5b2775
Change from options to builder the metrics creation. (#202)
* Change from options to builder the metrics creation.

* Add tests in the registry for cumulative long.

* Add javadoc for Metric.

* ./gradlew goJF
2019-04-25 08:52:33 -07:00
Bogdan Drutu 9217bde780
Move SpanBuilder as inner class to Span (#203) 2019-04-25 08:24:44 -07:00
Bogdan Drutu 50ec66cec8
Rename buildMeasure to measureBuilder for consistency with trace. (#204) 2019-04-25 08:18:17 -07:00
Bogdan Drutu f811e90ec7
Use interfaces in tags. (#207) 2019-04-25 08:18:00 -07:00
Bogdan Drutu b5ed2f466b
Rename buildMetricRegistry to metricRegistryBuilder for consistency with trace. (#205) 2019-04-25 08:17:46 -07:00
Bogdan Drutu f64454b1e8
Use key with default for span, consistent with tags. (#209) 2019-04-25 08:17:26 -07:00
Bogdan Drutu 54e2d7f0fd
remove java6 type args (#208)
* remove java6 type args

* remove java6 type args

* ./gradlew goJF
2019-04-25 08:17:06 -07:00
Bogdan Drutu 0a5693813b
Fix errorprone warnings in tests. (#206)
* Fix errorprone warnings in tests.

* ./gradlew goJF
2019-04-25 08:16:50 -07:00
Bogdan Drutu 5f86575217
Make Measure interface and allow StatsRecorder to create it. (#200) 2019-04-24 17:59:16 -07:00
Bogdan Drutu 4da44216a5
Change metrics to use interfaces. (#201) 2019-04-24 16:24:49 -07:00
Bogdan Drutu d7f68adc7f Remove empty common package. (#199) 2019-04-24 16:12:48 -07:00
Bogdan Drutu 1ac79b8edb
Add a top-level class for metrics similar with all the other packages. (#173) 2019-04-24 15:14:01 -07:00
Yang Song d5d62311c7
Revert "Remove long values from stats, not too much value added, only complexity. (#114)" (#197)
* Revert "Remove long values from stats, not too much value added, only complexity. (#114)"

This reverts commit b06d642293.

* Fix tests.
2019-04-24 14:13:07 -07:00
Carlos Alberto Cortez 0cd1db2b27 Make core classes interfaces. (#194) 2019-04-24 12:00:25 -07:00
Carlos Alberto Cortez f845c6f2b8 Fix the old addAnnotation mention in the docs. (#195) 2019-04-24 08:58:48 -07:00
Yang Song 29b831c49b Add tests on APIs. (#191) 2019-04-23 18:06:58 -07:00
Bogdan Drutu 883d00fea6
Fix code in code javadoc warning. (#193) 2019-04-23 16:32:26 -07:00
Yang Song 6bbda4f107
Metrics: Add LongCumulative. (#190) 2019-04-23 13:15:07 -07:00
Bogdan Drutu c728bc03d1
Move the environment variable loading logic to sdk. Simplify the Resource package. (#183) 2019-04-22 12:53:36 -07:00
Sergey Kanzhelev e31085e8da
fix javadoc issues (#181)
* fix javadoc issues

* fix newline
2019-04-22 11:28:45 -07:00
Bogdan Drutu 928049a369 Remove internal annotation and update comment in the internal package. (#180) 2019-04-22 11:11:49 -07:00
Sergey Kanzhelev 804ac529eb
add resource on tracer (#178)
* add resource on tracer

* empty->EMPTY
2019-04-22 11:10:48 -07:00
Bogdan Drutu 87efdd5aaa
Expose EmptyTagMap and remove duplicate code in unsafe package. (#169)
* Expose EmptyTagMap and remove duplicate code in unsafe package.

* Remove removed method from subclass.
2019-04-22 09:26:27 -07:00
Bogdan Drutu 28c07acf30 Cleanup Timestamp and Duration. (#174)
* Remove Duration and all unused methods from Timestamp.

* Move timestamp to SpanData as the only consumer.
2019-04-19 23:40:07 -07:00
Bogdan Drutu bb9ce436a2 Remove experimental API label. (#172) 2019-04-19 23:32:19 -07:00
Bogdan Drutu f0822fc735 Remove child count from the SpanData. (#170) 2019-04-19 23:31:53 -07:00
Yang Song ff86f96dc1
Metrics: Add cumulative API. (#168) 2019-04-19 17:45:14 -07:00
Bogdan Drutu f6e44119b7
Move views to sdk (instrumentation does not need to register views). (#166) 2019-04-19 12:07:06 -07:00