Commit Graph

840 Commits

Author SHA1 Message Date
John Watson 5517dcb55d Clean up the external interface for the RecordEventsReadableSpan (#751)
* WIP on cleaning up the testing-only accessors.

* more WIP on cleanup of the RERSpan

* re-add the 3 attributes and put them onto the SpanData

* reformat

* re-add and clean up the clock inheritance tests
2020-01-14 14:20:07 -08:00
Bogdan Drutu 748df2cde9
Fix build after merging race condition (#756)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-01-14 12:47:31 -08:00
John Watson eeb9406e2d The basics for a double counter (#755)
* WIP on a double counter shell

* tests for the double counter

* actually add the double counter code

* rename to just `Builder` for the two counter builders
2020-01-14 10:58:46 -08:00
John Watson f6a27c7eee Change LabelSet creation to use varargs, rather than overloaded k/v methods. (#745)
* switch to varargs

* update the sdk to handle the varargs option

* format

* rename a variable to make more sense

* add back a test with 2 key/value pairs

* replace the emptyLabelSet method with the empty varargs call
2020-01-14 10:57:40 -08:00
Bogdan Drutu c54a4e94ea
Avoid calling the AWS specific methods in unit-tests. (#748)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-01-13 21:04:05 -08:00
Kevin Brockhoff d99d9ccf1f change MultiSpanExporter creation visibility so it can be configured outside of the SDK (#752) 2020-01-13 18:10:40 -08:00
John Watson dbb7acb1bf Implement a timeout on batch exports. (#728)
* Implement a timeout on batch exports.

* fix an out-of-date comment

* verify that the export actually got the interrupt signal

* move the timeout into the latch await
2020-01-13 13:30:25 -08:00
Bogdan Drutu a005cc53ad
Move MetricDescriptor to MetricData.Descriptor, fix test files name. (#749)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-01-13 13:29:06 -08:00
Kevin Brockhoff 6859896f31 Add AWS support to SDK (#743)
* Initial dev of XRay ids generator

* Initial dev of EC2 resource labels retrieval and population

* renamed module to emphasize it uses v1 of AWS SDK

* fix code review issues

* fix test code review issues

* Add RunWith annotation
2020-01-13 11:21:27 -08:00
John Watson 1ff2c2a3fb Create a labelset with an arbitrary number of key/value pairs (#740)
* add a method to create a labelset with an arbitrary number of labels.

* add notnull annotations

* rebase for SDK implementation

* remove Nonnull annotations
2020-01-10 09:58:00 -08:00
John Watson 1e3a5ca237 regen the equals/hashcode without the null checks (#742) 2020-01-09 13:03:32 -08:00
John Watson 144fab0b44 Implement the very first pass at a LongCounter in the default SDK (#721)
* Implement the very first pass at a LongCounter in the default SDK

* introduce a base class for sdk instruments

* simplify label set creation process

* separate out the implementations of the bound and non-bound counters. gut the implementations so they can be plumbed with an aggregator/accumulator

* return the empty label set rather than creating a new one every time.

* tighten up access modifiers and move the bound counter impl into the counter

* remove the parameterized type on the BaseBoundInstrument

* replace the var-args labelset creator with a map

* a few more cleanups, as requested.

* change tests to use google's Truth library

* convert test to use Truth
2020-01-09 12:35:14 -08:00
Kevin Brockhoff 5b4aa24972 add constants for resource label semantic conventions (#741) 2020-01-09 11:16:05 -08:00
John Watson cd40a37156 remove some more usages of the bare word "bound" (#739) 2020-01-08 13:57:20 -08:00
John Watson eacd073205 convert the SpanContext to use Autovalue (#708)
* convert the SpanContext to be autovalued

* remove the builder for the span context and the custom equals/hashcode implementation

* format
2020-01-08 13:38:15 -08:00
Christian Neumüller e4f0826f3c Rework latency/duration/endTime of Span (#737)
* Simplify span end time.

The only reason to have now() returned in getEndEpochNanos seems to be
that it kinda makes sense for getLatencyMs, but that method is
package-private and never used.

See also
https://github.com/open-telemetry/opentelemetry-specification/issues/373#issuecomment-564939980.

* Add back getLatencyNs, add it to ReadableSpan.

* Rename getLatencyNs to getLatencyNanos.
2020-01-08 10:46:41 -08:00
John Watson f4fca3a321 Provide a builder for the TracerSdkRegistry, for ultimate configurability (#727)
* Provide a builder for the TracerSdkFactory, for ultimate configurability.

* Update for factory/registry rename and write builder tests.

* rebase and update from upstream
2020-01-07 19:05:50 -05:00
John Watson afa3ca063c Use a thread local to hold random instances to avoid thread contention. (#726)
* Use a thread local to hold random instances to avoid thread contention.

* switch to the lighter-weight Random rather than SecureRandom
2020-01-07 17:27:47 -05:00
Christian Neumüller ff067e005f Add hasEnded to ReadableSpan and SpanData (split from #693) (#733)
* Add hasBeenEnded property to ReadableSpan.

* Add hasBeenEnded to SpanData.

* Rename hasBeenEnded to hasEnded.

In-reply-to: https://github.com/open-telemetry/opentelemetry-java/pull/693#discussion_r358217782

* Check SpanData.hasEnded in unit test.

* Fix mismerge.
2020-01-07 17:02:22 -05:00
John Watson 91053c45c8 rename the factories to registries (#725) 2020-01-06 20:11:02 -05:00
Javier Salinas a9448a71dc Upgrade to Gradle 6 enabling parallel build (#731)
* Upgrade to Gradle 6 enabling parallel build

* Remove ignoring gradle.properties

* Limit resources in gradle.properties
2020-01-06 19:59:00 -05:00
John Watson 47ed1b1808 more renaming of Metric to Instrument (#722) 2019-12-27 12:45:00 -08:00
Giovanni Liva 8faa99ee1f Add jaeger example (#694)
* Add build scripts for Jaeger example

* Add example how to use Jaeger as exporter

* Improve naming and formatting

* Fix libraries version

* Address @arminru feedback

* Separate exporter from instrumentation

* Addressed the feedback of @bogdandrutu

* Add instruction to run Jaeger

* Addressed the feedback of @bogdandrutu
2019-12-25 07:28:19 -08:00
John Watson 23cc506d26 Rename Metric to Instrument (#717)
* rename the Metric interface to Instrument, and update many javadocs to match

* apply formatting
2019-12-25 07:26:00 -08:00
John Watson fc9a9575c8 Add non bound usage to the various metric instruments API (#715)
* WIP on non-bound instrument usages

* Add API methods for non-bound-instrument usages

* add missing javadoc

* add some additional javadoc
2019-12-19 16:28:03 -08:00
Christian Neumüller 64fadf279f Synchronize toSpanData properly for un-ended Span. (#706)
* Demonstrate error calling toSpanData on un-ended Span.

* Improve synchronization code for RecordEventsReadableSpan.

* Fix GuardedBy annotation.

* Add comment.

* Avoid double locking (review comments).
2019-12-19 13:34:21 -08:00
John Watson a8d14d8886 provide an API method to return an empty LabelSet (#716)
* provide an API method for an empty LabelSet

* remove the TestLabelSet now that we have a way to create an empty one
2019-12-18 14:04:55 -08:00
John Watson 95da446cee rename metric instances to have the numeric type before the metric type (#712) 2019-12-18 11:38:24 -08:00
John Watson bc627e67cf Remove default bound (#707)
* remove the getDefaultBound methods

* provide a TestLabelSet for testing
2019-12-18 10:18:52 -08:00
John Watson 7505c1297f rename getBound/removeBound to bind/unbind (#704) 2019-12-16 16:06:22 -08:00
Bogdan Drutu f1e6fc6ef0
Simply rename metrics Handle to Bound. (#698)
* Simply rename metrics Handle to Bound.

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

* More renames in tests

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

* Rename Bound to Bound[ValueType][MetricType]

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

* Fix bound param comment

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-12-16 15:06:20 -08:00
Inseo Kim ba05a6514f Fix the warning that occurs when a code is used in a code tag (#689) 2019-12-12 13:24:25 -06:00
Christian Neumüller 9afb1e4059 Javadoc: Tracer is not simple (#687) 2019-12-06 18:56:53 -06:00
Carlos Alberto Cortez 2675c4fb94
Handle null parent's SpanContextShim in the OT Shim. (#686)
SpanContextShim objects are created on demand,
as it's an expensive operation because of a global
write lock, hence we need to handle the case
of starting a Span whose parent has no SpanContextShim
yet.
2019-12-05 12:50:20 -06:00
Carlos Alberto Cortez 74c6595e67
Allow recording attributes in Span.Builder (#685)
* Initial support for attributes set in Span.Builder.
2019-12-05 12:49:17 -06:00
Bogdan Drutu 7ab95be319
Add LabelSet to the Meter API and change GetHandle to use it. (#681)
* Add LabelSet to the Meter API and change GetHandle to use it.

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

* Add clarification in LabelSet javadoc

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

* Update api/src/main/java/io/opentelemetry/metrics/DefaultMeter.java

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

* Update api/src/main/java/io/opentelemetry/metrics/DefaultMeter.java

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

* Update api/src/main/java/io/opentelemetry/metrics/DefaultMeter.java

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

* Update api/src/main/java/io/opentelemetry/metrics/DefaultMeter.java

Co-Authored-By: Armin Ruech <armin.ruech@gmail.com>
2019-11-27 12:53:29 -08:00
Bogdan Drutu 023f3fef25
Move InstrumentationLibraryInfo to common to be shared with metrics. (#682)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-11-27 08:17:12 -08:00
Bogdan Drutu c5ea9df68f
Start 0.3.0 development cycle (#676)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-11-19 12:05:06 -08:00
Bogdan Drutu 1a3fefb2e9
Rename MeasureBatchRecorder to BatchRecorder to allow other types to be recorded. (#675)
* Rename MeasureBatchRecorder to BatchRecorder to allow other types to be recorded.

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

* ./gradlew goJF

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-11-17 09:32:09 -08:00
Peter Travers ffafe25d0a Add named meter and meter factory (#668)
* Add named meters with factory provider

* Fix documentation to instantiate a meter from a meter factory

* Fix documentation incorrectly referencing meter not meter factory

* Fix MeterFactor not Meter

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

* Fix MeterFactor not Meter

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

* Fix MeterFactory not Meter

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

* Fix over 100 characters in line

* Refactor meter example names to my_library_example
2019-11-13 13:25:54 -08:00
Gary Brown 6607bd784c Set the type of the tags within the Jaeger exporter (#669)
* Set the type of the tags within the Jaeger exporter

Signed-off-by: Gary Brown <gary@brownuk.com>

* Address comment

Signed-off-by: Gary Brown <gary@brownuk.com>

* Address comments

Signed-off-by: Gary Brown <gary@brownuk.com>
2019-11-11 17:18:30 +02:00
Gary Brown d225c1086f Fix NPE when using non-OK status with a null description (#667) 2019-11-07 02:21:12 -08:00
Sameeksha Vaity 91b6c1fe41 Create from remote parent on valid parent context (#656)
* create span context from remote parent on valid parent context

* checking if parent type remote parent

* add hasRemoteParent to SpanData

* make hasRemoteParent primitive boolean

* update @since tag

* formatting correction
2019-11-05 09:56:39 -08:00
Bogdan Drutu 420a51c559
Make InstrumentationLibraryInfo otherwise cannot be accessed in the public APIs (#658)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-11-01 07:34:11 -07:00
Armin Ruech 5e745481aa Add instrumentation library resource to named tracers (#632)
* Add instrumentation library resource to named tracers

* Introduce constants for library resource label keys

* Introduce InstrumentationLibraryInfo class to replace library resource
2019-10-31 12:53:45 -07:00
Bogdan Drutu ea57973deb
Ensure that only one tracer is created (#657)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-10-30 17:07:03 -07:00
Carlos Alberto Cortez 08440dd6db
Inherit the parent OT SpanContext baggage/distContext. (#648) 2019-10-31 00:54:21 +01:00
Bogdan Drutu 69a0f465cb
Cleanup deprecated methods in TracerSdk (#651)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-10-30 15:12:46 -07:00
Bogdan Drutu 478eb3b8d0
Remove hasRemoteParent option from Sampler, it is part of parent SpanContext (#653)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2019-10-29 19:27:33 -07:00
John Watson d75c017cf8 point at the right place for the contributing link (#652) 2019-10-29 15:26:34 -07:00