Commit Graph

436 Commits

Author SHA1 Message Date
John Watson 0024aa9bee
Fix for a mashed up PR merge. (#1602) 2020-08-28 18:39:12 -07:00
dengliming ed08e9f287
Add an overload to the recordException method to support additional attributes (#1599)
* Add an overload to the recordException method to support additional attributes

* Fix Codecov

* Fix review

* Fix review
2020-08-28 12:41:36 -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
dengliming f680094039
Rename ParentOrElse to ParentBased and generalize to support all cases (#1577)
* Rename ParentOrElse to ParentBased

* Update samplers to match spec.

* Fix check style

* Fix check style

* Fix review

* Separate test for parentOrElse sampler

* Provide ParentBased.Builder

* Fix code style

* Fix java doc.

* Update javadoc

* Builder use set instead of with

* Rename newParentBasedBuilder to parentBasedBuilder
2020-08-28 10:43:38 -07:00
John Watson c3ac67bb85
Preserve the ParentOrElse behavior when changing sampling probability via configuration. (#1595) 2020-08-27 10:13:48 -07:00
John Watson a021a59b94
Update metric description in the BatchSpanProcessor (#1592) 2020-08-26 08:44:24 -07:00
Nikita Salnikov-Tarnovski af39f35086
More aggresive version of BatchSpanProcessor (#1579)
* More aggresive version of BatchSpanProcessor

* Add benchmark

* Polish

* Polish

* Incorporated some changes from #1571

* Rollback one test change

* Polish

* Polish
2020-08-26 08:22:39 -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 3671d2b84d
Add helpers to CompletableResultCode to wait for a result. (#1583)
* Add helpers to CompletableResultCode to wait for a result.

* Flaky?

* Cleanup
2020-08-25 21:06:06 -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
Nikita Salnikov-Tarnovski ad9f7d4cf5
BatchSpanProcessor now starts daemon timer thread (#1559)
* BatchSpanProcessor now starts daemon timer thread

* BatchSpanProcessor now starts daemon timer thread

* Format
2020-08-19 08:55:07 -07:00
Ken Finnigan 26597266df
Separate the SDK into separate publishable artifacts (#1525)
* Split single "sdk" module into separate pieces for common, correlationcontext, metrics, tracing, and the combination of them all

* Modify comment to not reference implementation class

* Moved JMH code to /sdk/all

* Move new files to adjusted location

* Move new files from rebase
2020-08-18 13:43:17 -07:00
Nikita Salnikov-Tarnovski 94eaef4d81
Add ResourceProvider SPI to allow for custom Resources (#1548)
* Add ResourceProvider SPI to allow for custom Resources

* Polish

* Polish
2020-08-18 12:59:43 -07:00
John Watson 3159e5bde6
Add documentation to make it clear that the MetricProducer cannot be shared across exporters (#1546)
* Add documentation to make it clear that the MetricProducer cannot be shared across exporters.

* Update sdk/src/main/java/io/opentelemetry/sdk/metrics/MeterSdkProvider.java

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

* Update sdk/src/main/java/io/opentelemetry/sdk/metrics/MeterSdkProvider.java

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

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2020-08-18 12:54:36 -07:00
Giovanni Liva 792f0f452b
Update Attributes API to comply the spec (#1437)
* Forbit null values

* Simplify code and better naming

* Fix error prone error

* Uniform null handling

* Improve tests for SpanAttributes

* Improve tests for Resource Attributes

* Change interface of AttributeValue

* isEmpty overrided only when necessary

* Update Attributes API

* Remove unused code

* Rename method

* Address PR feedback

* fix javadoc
2020-08-18 12:03:32 -07:00
Christopher Hunt d6b53e60f4
Makes Export methods async (#1428)
* Makes Export methods async

This commit recognises that the export and flush methods of span and trace exporters can be, and often are, implemented with long-lived operations over networks. We therefore see that these method return types are represented using Java's Future type to account for this common behaviour.

* PR feedback
2020-08-18 11:45:26 -07:00
dengliming 36abf5fd27
Add convenience methods for when empty labels are used. (#1538)
* Add convenience methods for when empty labels are used.

* Fix review
2020-08-17 07:47:28 -07:00
John Watson dfc5cbe4aa
Fix for Issue with bound instruments generating datapoints from no recordings. (#1535)
* write a test that demonstrates a bound counter reporting zeros with no observations.

* Have the metric Aggregator keep track of if there have been recordings since a reset has been done.
Have the batcher skip batching if no recordings have been made.

* Add a test to assert the NoopAggregator has no recordings.

* Tweaks from PR review
2020-08-14 19:42:20 -07:00
Anuraag Agrawal 7828283b55
Exclude transitive dependencies in jmh configuration since gradle-jmh-plugin doesn't seem to handle them well. (#1536) 2020-08-13 07:58:14 -07:00
Anuraag Agrawal 7cd931c558
Return SDK attributes in default Resource. (#1528)
* Populate SDK resource by default.

* Add test

* Newline

* Revert "Newline"

This reverts commit e6ff4b4999.

* Revert "Add test"

This reverts commit f2eaa7c62a.
2020-08-11 08:31:14 -07:00
Trask Stalnaker 0d0ee07ec5
Add RecordEventsReadableSpan toString (#1522)
* Add RecordEventsReadableSpan toString

* lock

* optimized
2020-08-10 09:04:45 -07:00
Anuraag Agrawal 66c5054f2d
Move TestSpanData to a testing package instead of in the published SDK. (#1512) 2020-08-06 09:44:44 -07: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
Nikita Salnikov-Tarnovski 70e84334c0
Add new configuration option to limit the size of string attribute values (#1484)
* Add new configuration option to limit the size of string attribute values

* Polish

* Polish

* Polish

* Polish

* Add benchmark.

* Format

* Format
2020-08-03 08:11:58 -07:00
Anuraag Agrawal 6dffbb8fc4
Migrate tests to JUnit5 (#1489)
* Add JUnit 5 dependency

* Revert unintended
2020-07-31 11:10:27 -07:00
Christian Neumüller 0f322b34d7
Fix SpanWrapper snapshot being incomplete. (#1482)
* Fix SpanWrapper snapshot being incomplete.

* Improve clarity of unit test.

* Add javadoc for SpanWrapper.

* Remove 'flyweight' from docstring.
2020-07-30 15:22:32 -07:00
dengliming 24ab6c37f0
Hide EnvAutodetectResource ro reduce public classes (#1477) 2020-07-29 16:17:45 +02:00
MitchellDumovic 9c2b3e45b7
Change default sampler to ParentOrElse(AlwaysOn) (#1474) 2020-07-29 06:53:05 -07:00
dengliming 177b1dcd3b
Support system property otel.resource.attributes corresponding to OTEL_RESOURCE_ATTRIBUTES (#1466) 2020-07-27 18:52:32 +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
Anuraag Agrawal f816ad5733
Implement Span.recordException (#1434)
* Implement Span.recordException

* License

* javadoc

* Fix javadoc

* Tests for DefaultSpan

* PrintStream benchmark

* Check arguments

* Use StringWriter

* more merge and event name

* Remove timestamp recordException
2020-07-22 18:53:26 -07:00
MitchellDumovic 23b27d7d97
Add ParentOrElse Sampler (#1444)
* Fix bug where Sampling status would not propagate from parent to child correctly

* use generic parentorelse sampler instead

* bring back alwayson as default sampler
2020-07-22 16:20:45 -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
Giovanni Liva 88da16e3ed
Forbid empty/null keys (#1440) 2020-07-22 16:20:44 +02:00
Anuraag Agrawal f5452f4f2b
Remove null checks in Span API. (#1433)
* Remove null checks in Span API.

* Add tests and loosen events as well.
2020-07-20 19:00:13 -07:00
Carlos Alberto Cortez 2f204c2bb0
Add overloads for setParent(Context context). (#1262)
* Add overloads for setParent(Context context).

* Fix the original version.

* Apply feedback.

* Update version for CorrelationContext.

* Add simple extra test for DefaultCorrelationContextManagerTest.
2020-07-17 08:42:01 -07:00
John Watson 95bb731953
Refactor the creation of instrument batchers to be in a central location (#1411)
* Refactor the creation of instrument batchers to be in a central location.
This should allow us to build a Views API into the SDK.

* Fill in some missing javadoc.

* move the ViewRegistry up one package, and clean up the visibility of other classes
2020-07-14 18:55:10 -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
John Watson fa95bb609b
More fully document the MetricProducer class (#1406)
- renamed the misleading method name for getting metric data.
- added javadoc in places where it was missing to clarify implementation details
2020-07-11 10:47:33 -07:00
John Watson 7ce215da2b
rename a variable and fix the list initialization size. (#1400) 2020-07-09 13:52:15 +02:00
John Watson ee0d438147
Change the usage of MMSC aggregations to always be deltas. (#1368) 2020-07-01 10:28:20 -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
Giovanni Liva 0da293d929
Add SDK Telemetry resources (#1366)
* Add SDK Telemetry resources

* Address feedback

* Generate version.properties

* Use unknown when version not available
2020-06-29 11:25:47 -07:00
John Watson 24b4be90c3
Convert CorrelationContext entry keys and values to simple Strings (#1363)
* convert CC entry keys and values to simple Strings

* fix broken javadoc
2020-06-22 14:37:21 -07:00
Bogdan Drutu d02667929b
Change instrument operations to use immutable Labels (#1358)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-18 13:48:39 -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 42cdd7ed3d
Use the new immutable Labels for Bind (#1354)
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
2020-06-18 11:53:41 -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