Commit Graph

784 Commits

Author SHA1 Message Date
jack-berg 01a07b51a1
Add event API (#4781)
* Add event API

* Log when emitting event without domain, add javadoc example to Logger
2022-09-27 17:39:33 -05:00
jack-berg f7317c6e8d
Split out logs API (#4764) 2022-09-22 13:23:52 -05:00
Sampath 45a1593575
Simplified the assertions (#4726) 2022-08-29 12:06:59 -07:00
David Turner cfbe5f9d20
Avoid unnecessary stack trace capture (#4663)
Constructing an `AssertionError` is rather expensive, and pointless in
cases that we're not even going to log it. With this commit we skip all
this unnecessary work.

Relates https://github.com/elastic/elasticsearch/issues/89107
2022-08-05 13:04:23 -05:00
xiangtianyu 51fb582a36
bugfix: fix ImmutableKeyValuePairs bugs (#4573)
* fix bug

* change the fix

* add new cases and changed the way to fix the bug

* fix some describe words

Co-authored-by: John Watson <jkwatson@gmail.com>

* modify some describe mistake

Co-authored-by: John Watson <jkwatson@gmail.com>

* run spotlessApply

Co-authored-by: John Watson <jkwatson@gmail.com>
2022-07-06 12:07:57 +09:00
jack-berg 86cc4bc27d
Add some missing since annotations (#4520) 2022-06-09 20:41:52 -05:00
jack-berg 4a8850cc64
Improve metrics API javadoc (#4493)
* Improve metrics API javadoc

* Fix typo

* Switch to Title Case for instrument names

* Add @since annotations
2022-05-27 10:02:02 -05:00
jack-berg de824dc93a
Add batch callback API (#4376)
* Add batch callback API

* Update API to accept varargs of instruments

* Add more tests

* Add default API implementations, more test coverage

* PR feedback
2022-05-25 12:50:09 -05:00
jack-berg 98369a5aad
Return noop instrument if name is invalid (#4383)
* Return noop instrument if name is invalid

* Validate instrument name in default meter

* Use API Usage logger and include stack trace

* Rename methods to check* instead of is*
2022-04-20 13:25:00 -05:00
jack-berg c2d8f6abd9
Set unit to 1 if invalid (#4384)
* Set unit to 1 if invalid

* Improve error message, validate unit in DefaultMeter calls

* Fix typos

* Include stack trace
2022-04-19 10:45:55 -05:00
Anuraag Agrawal d78cadabaa
Update errorprone (#4346) 2022-04-08 08:12:57 +09:00
Anuraag Agrawal bc9dafca03
Fix tracestate builder reuse and Optimize. (#4325) 2022-04-01 11:47:35 +09:00
Trask Stalnaker cd2583df6a
Add misspell check (and fix misspellings) (#4290)
* Add misspell check

* Fix misspellings

* Spotless
2022-03-22 15:12:40 +09:00
John Watson dc8086dfca
Add scare text to the javadoc for GlobalOpenTelemetry (#4223)
* Add scare text to the javadoc for GlobalOpenTelemetry

* add another javadoc blurb
2022-03-03 17:48:07 -08:00
jack-berg 963bc384c8
Instrumentation scope (#4215)
* Add InstrumentationScopeInfo class

* Rewrite tracer provider documentation

* Refactor ComponentRegistry to use InstrumentationScopeInfo

* Finish updating documentation to reference scope instead of library

* PR feedback
2022-02-26 10:43:55 -08:00
jack-berg 9f10e0048e
Allow multiple async callbacks, allow callbacks to be removed (#4143)
* Allow multiple async callbacks, allow callbacks to be removed

* Use AutoCloseable to remove callbacks, don't unregister from MetricStorageRegistry

* Use CopyOnWriteArrayList

* PR feedback

* PR feedback
2022-02-25 11:51:51 -06:00
Beppe Catanese 13fb460a54
(4172) Vararg versions of AttributeBuilder.put (#4188)
* Overload put with AttributeKey with String array

* Use generic instead of String

* Format and javadoc

* Cast to type

* New public method

* File based view configuration (#4163)

* Add experimental view config module

* Rename view-config to metric-incubator

* Switch naming from camelCase to snake_case

* Extend with attribute key filter

* Wire up to autoconfiguration

* Use snakeyaml instead of jackson

* PR feedback

* PR feedback

* Remove explicit okio dependency (#4187)

* Deprecate PrometheusCollector (#4185)

* Correct javadoc

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

* Cast to type

Co-authored-by: jack-berg <34418638+jack-berg@users.noreply.github.com>
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2022-02-24 14:04:57 -08:00
Knut Wannheden 083dca1b94
Marshal trace state in OTLP exporter (#4191)
Includes the trace state in the marshaled spans and span links, resolving the corresponding TODOs in the code.

The `tracestate` header encoding and decoding logic has been moved to a new internal class `W3CTraceContextEncoding`.

Fixes: #4189
2022-02-24 09:18:38 +09:00
Lauri Tulmin 9c6cc22fb6
Javadoc code snippets use methods that don't exist (#4140)
* Replace OpenTelemetry with GlobalOpenTelemetry in javadoc code snippets

* use openTelemetry instread of GlobalOpenTelemetry

* replace one ome usage of GlobalOpenTelemetry
2022-02-02 12:20:36 -08:00
Anuraag Agrawal 3773d0b18a
Update errorprone (#4134) 2022-01-31 08:00:17 -08:00
jack-berg 7c9234e1ae
Add missing internal disclaimers (#4086) 2022-01-13 14:00:12 -08:00
Beppe Catanese 286383b218
Single logger instance for invalid API call (#4073)
Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
Co-authored-by: John Watson <jkwatson@gmail.com>
2022-01-12 13:16:09 +09:00
Anuraag Agrawal dfb4a74ac5
Update errorprone (#4048) 2022-01-06 11:33:00 +09:00
jack-berg 318091a170
Expand GlobaOpenTelemetry and OpenTelemetry to include metric accessors (#4035) 2022-01-04 11:27:37 +09:00
jack-berg b88107a1e4
Use singletons in noop implementation, reduce visibility of internal classes (#4030) 2021-12-28 10:19:50 +09:00
Anuraag Agrawal 538af68ee6
Return an interface when registering metric callbacks. (#4022)
* Return an interface when registring metrics.

* Return type-specific

* untypo
2021-12-23 13:13:13 +09:00
Anuraag Agrawal 6e28c10c72
Remove ObservableMeasurement superinterface (#4023) 2021-12-22 13:47:47 +09:00
Anuraag Agrawal 8d6e5b87f1
Make behavior of private method more explicit. (#4017) 2021-12-22 10:01:09 +09:00
Anuraag Agrawal 10ed89ea4c
Remove deprecated methods from ObservableMeasurement (#4018)
* Remove deprecated methods from ObservableMeasurement

* Hack japi
2021-12-22 10:00:57 +09:00
Anuraag Agrawal d88b09cc0b
Reduce volatile reads in GlobalOpenTelemetry.get (#4009) 2021-12-21 11:49:15 +09:00
Anuraag Agrawal 1e9fb21c64
Remove deprecated metrics APIs (#3990) 2021-12-15 11:51:32 +09:00
Anuraag Agrawal 737a5e2b26
Deprecate GlobalMeterProvider (#3948) 2021-12-03 08:43:49 +09:00
Anuraag Agrawal b1651a18cf
Rename .observe to .record (#3949)
* Rename .observe to .record

* Apply deprecation
2021-12-03 08:37:22 +09:00
jason plumb 51556cd67a
Move key/value validation from ImmutableBaggage to the W3CBaggagePropagator (#3871)
* move key/value validation from ImmutableBaggage to the W3CBaggagePropagator

* remove import

* enforcement parade

* let baggageToString() return String

* Nits

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
2021-12-02 09:47:31 +09:00
jack-berg 12a54710b7
Remove bound instrument from metric API, move to internal package of metric SDK (#3928) 2021-11-24 13:23:31 +09:00
Anuraag Agrawal 55ff1dc533
Promote metrics API to stable (#3919)
* Add MeterProvider to OpenTelemetry API

* Spot

* Set

* Move NoopMeter to package private

* Merge metrics API code into API package

* Finish

* Fix / clean

* Drift

* Update extensions/noop-api/src/main/java/io/opentelemetry/extension/noopapi/NoopOpenTelemetry.java

Co-authored-by: John Watson <jkwatson@gmail.com>

* Spot

Co-authored-by: John Watson <jkwatson@gmail.com>
2021-11-24 08:39:55 +09:00
Josh Suereth 19f6fa79f0
Take a pass at fixing metrics API javadoc issues/missing information. (#3874)
* Take a pass at fixing metrics API javadoc issues/missing information.

* Spotless fix.
2021-11-17 12:53:46 -08:00
Eugene R f24ee19d0b
decommission the deprecated Gradle archivesBaseName property (#3878) 2021-11-15 10:55:08 -08:00
Josh Suereth 3ee4936ea2
Fixes #3494 - Removes ofLongs/ofDoubles when the default is long/double for a builder. (#3873) 2021-11-14 12:05:07 -08:00
jack-berg 10d677b736
Cleanup metric deprecations (#3869) 2021-11-12 16:42:57 -08:00
jack-berg 8d96cb892b
Deprecate MeterProvider#get(..) methods (#3812)
* Deprecate MeterProvider#get(..) methods

* Retain MeterProvider#get(String instrumentationName)
2021-11-05 09:05:30 +09:00
jack-berg 5f259ee4ee
Add remove method to AttributesBuilder (#3771)
* Add remove method to AttributesBuilder

* Improve test coverage

* Remove attributes by nulling out instead of removing from list

* feedback wip

* Add AttributesBuilder#remove(String) method

* Add removeIf() method

* AbstractFixedSizeExemplarReservoir uses more efficient removeIf() attribute filter
2021-10-28 08:47:50 +09:00
Anuraag Agrawal 1e073fcff2
Add an auto-configuration builder. (#3753)
* Add an auto-configuration builder.

* Test

* Builder

* More

* Revamp

* Customizer only customizes

* Pass config to customizers

* More specific name

* Cleanup

* Cleanup

* SPI test

* Clean

* Clean

* Clean

* Shutdown once instead of flush and shutdown for simple

* Clean

* Cleanups

* Cleanup
2021-10-28 08:41:14 +09:00
jack-berg c4c2e6c9db
Align SdkMeterProvider with SdkTracerProvider (#3792)
* Align SdkMeterProvider with SdkTracerProvider

* Use noop meter provider when metric exporter is none
2021-10-27 10:03:08 -07:00
John Watson 69d26c12fd
Properly encode baggage values and metadata (#3740)
* URL encode & decode baggage values
Resolves #3442

* Vendor in the guava url escaping code, and use it, rather than URLEncoder

* add fuzz testing for the escaper and propagator

* formatting

* Remove strict value validation from the baggage implementation
And, ensure we encode baggage metadata as well as the baggage value.

* Add additional fuzz iterations, manually.

* remove the usage of the vintage engine and use driver test methods instead
2021-10-14 08:10:28 -07:00
Anuraag Agrawal 5320f208cb
Fix nullness in trace-propagators (#3656) 2021-09-24 09:15:04 -07:00
Anuraag Agrawal b311d50d03
Fix some nullness. (#3647)
* Fix some nullness.

* Log
2021-09-22 09:00:57 -07:00
Anuraag Agrawal ece161f6e0
Preencode attribute keys into utf8 bytes. (#3576)
* Use constants for AttributeKeys in JMH

* Preencode attribute keys into utf8 bytes.

* Spot

* Ignore

* Be lazy

* Boil
2021-09-10 10:35:26 +09:00
Trask Stalnaker 86eea94b76
Allow creating a SpanContext without validation for internal use (#3564)
* Avoid unnecessary calls to TraceId and SpanId.isValid()

* Alternative: move ImmutableSpanContext to internal package

* javadoc

* Only skip for safe IdGenerators

* Simplify

* Errorprone

* Add test and fix boolean logic

* Spotless

* Add test

* Revert toString test change
2021-08-31 11:09:19 -07:00
Anuraag Agrawal 9e73bfe9e5
Remove branches from isValidBase16 (#3566) 2021-08-31 08:57:35 +09:00