Move exemplar types to non-internal package#5747
Move exemplar types to non-internal package#5747MrAlias merged 14 commits intoopen-telemetry:mainfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5747 +/- ##
=====================================
Coverage 84.5% 84.5%
=====================================
Files 272 272
Lines 22734 22734
=====================================
+ Hits 19226 19228 +2
+ Misses 3165 3163 -2
Partials 343 343 |
02f8125 to
d7cc77b
Compare
dd4a2e9 to
9e9990c
Compare
|
The README link doesn't work yet because the package isn't released. I assume I should just leave it there anyways? |
18c49b8 to
a94f246
Compare
|
@MrAlias rebased |
|
Should we rename FixedSize and Histogram to FixedSizeReservoir and HistogramReservoir? Or is it enough, based on the function signature, that a user can figure out what it returns? |
I vote for this. |
|
Renamed. I also took the liberty to rename the files to fixed_size_reservoir.go and histogram_reservoir.go while we are renaming things... |
|
Possibly a follow-up question, but should we name these |
Looks good.
I don't have opinions on this. |
Both of these ideas sounds good to me, 👍 |
39aa6f7 to
706e4ff
Compare
|
@MrAlias i'm waiting for you review before merging. Let me know if I should merge without your approval. |
706e4ff to
204b29d
Compare
|
Planned follow up discussed in SIG meeting: Audit the compliance of what was just merged with the specification. TODO: track ^ in an issue. |
|
LGTM. Should we add some testable example showcasing exemplar-reservoir feature? |
### Added - Add `go.opentelemetry.io/otel/sdk/metric/exemplar` package which includes `Exemplar`, `Filter`, `TraceBasedFilter`, `AlwaysOnFilter`, `HistogramReservoir`, `FixedSizeReservoir`, `Reservoir`, `Value` and `ValueType` types. These will be used for configuring the exemplar reservoir for the metrics sdk. (#5747, #5862) - Add `WithExportBufferSize` option to log batch processor.(#5877) ### Changed - Enable exemplars by default in `go.opentelemetry.io/otel/sdk/metric`. Exemplars can be disabled by setting `OTEL_METRICS_EXEMPLAR_FILTER=always_off` (#5778) - `Logger.Enabled` in `go.opentelemetry.io/otel/log` now accepts a newly introduced `EnabledParameters` type instead of `Record`. (#5791) - `FilterProcessor.Enabled` in `go.opentelemetry.io/otel/sdk/log/internal/x` now accepts `EnabledParameters` instead of `Record`. (#5791) - The `Record` type in `go.opentelemetry.io/otel/log` is no longer comparable. (#5847) - Performance improvements for the trace SDK `SetAttributes` method in `Span`. (#5864) - Reduce memory allocations for the `Event` and `Link` lists in `Span`. (#5858) - Performance improvements for the trace SDK `AddEvent`, `AddLink`, `RecordError` and `End` methods in `Span`. (#5874) ### Deprecated - Deprecate all examples under `go.opentelemetry.io/otel/example` as they are moved to [Contrib repository](https://github.com/open-telemetry/opentelemetry-go-contrib/tree/main/examples). (#5854) ### Fixed - The race condition for multiple `FixedSize` exemplar reservoirs identified in #5814 is resolved. (#5819) - Fix log records duplication in case of heterogeneous resource attributes by correctly mapping each log record to it's resource and scope. (#5803) - Fix timer channel drain to avoid hanging on Go 1.23. (#5868) - Fix delegation for global meter providers, and panic when calling otel.SetMeterProvider. (#5827) - Change the `reflect.TypeOf` to use a nil pointer to not allocate on the heap unless necessary. (#5827)
Part of #5249
This makes all existing types designed to implement the public Exemplar API public by moving most of
internal/exemplartoexemplar. The only types that are not being made public areexemplar.Drop, andexemplar.FilteredReservoir. Those types are moved tointernal/aggregate, and are renamed toDropReservoirandFilteredExemplarReservoir.The following types are made public:
exemplar.Exemplarexemplar.Filterexemplar.SampledFilterexemplar.AlwaysOnFilterexemplar.HistogramReservoirexemplar.FixedSizeReservoirexemplar.Reservoirexemplar.Valueexemplar.ValueType