The attributes filter collects seen attributes in order to avoid
filtration on the same attribute set. However, the `attribute.Set` is
not comparable type and new allocations of sets with same attributes will be
considered as new sets.
Metrics with a high cardinality of attributes consume a lot of memory
even if we set a filter to reduce that cardinality.
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* WithContainerID: Document ECS limitation.
WithContainerID is not able to extract the correct container id in an ECS environment. The ECS resource detector should be used instead (https://pkg.go.dev/go.opentelemetry.io/contrib/detectors/aws/ecs).
See #3633.
* fix lint
* Update sdk/resource/config.go
---------
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* update versions.yaml for release
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
* Prepare stable-v1 for version v1.13.0
* Prepare experimental-metrics for version v0.36.0
* Update CHANGELOG
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
---------
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
* Update module versions
* Prepare stable-v1 for version v1.12.0
* Prepare experimental-metrics for version v0.35.0
* Prepare experimental-schema for version v0.0.4
* Update the CHANGELOG
* Undo bump to experimental-schema
Revert to original version as nothing has changed.
* Fix PR number in changelog
* Move change from #3497 into current release
* Use Extrema type for Histogram min/max
* Add case for Extrema in AssertHasAttributes
* Add changes to changelog
* Add NewExtrema
* Add metricdatatest tests
* Use getter for Extrema
* Fix Extrema doc language
* Correct dataset to be one word
* Ensure multiple extrema are tested in a dataset
* Update RegisterCallback and Callback decls
RegisterCallback accept variadic Asynchronous instruments instead of a
slice.
Callback accept an observation result recorder to ensure instruments
that are observed by a callback.
* Update global impl
* Update noop impl
* Update SDK impl
* Fix prometheus example
* Fix metric API example_test
* Remove unused registerabler
* Rename ObservationRecorder to MultiObserver
* Update Callback documentation about MultiObserver
* Remove the Observe method from async inst
* Revert to iface for Observers
* Fix async inst docs
* Update global async delegate race test
* Restore removed observe doc
* Remove TODO
* Remove stale comment
* Update changelog
* Combine spatially aggregated precomputed vals
Fix#3439
When an attribute filter drops a distinguishing attribute during the
aggregation of a precomputed sum add that value to existing, instead of
just setting the value as an override (current behavior).
* Ignore false positive lint error and test method
* Add fix to changelog
* Handle edge case of exact set after filter
* Fix filter and measure algo for precomp
* Add tests for precomp sums
* Unify precomputedMap
* Adds example from supplimental guide
* Fixes for lint
* Update sdk/metric/meter_example_test.go
* Fix async example test
* Reduce duplicate code in TestAsynchronousExample
* Clarify naming and documentation
* Fix spelling errors
* Add a noop filter to default view
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
* Update RegisterCallback and Callback declerations
RegisterCallback accepts variadic Asynchronous instruments instead of a
slice.
Callback accepts an observation result recorder to ensure instruments
that are observed by a callback.
* Update global, noop, SDK implementations
* Fix examples
* Add changes to changelog
* Test RegisterCallback for invalid observers
* Test callbacks from foreign sources not collected
* Support registering delegating instruments
* Restructure RegisterCallback method
Instead of accepting instruments to register the callback with as a
slice, accept them as variadic arguments.
* Add changes to changelog
* Add PR number to changes
* Split metric inst config
Instead of having the same configuration for both the Synchronous and
Asynchronous instruments, use specific options for both.
* Use Async/Sync opt for appropriate inst
* Update noop inst providers
* Update internal global impl
* Update sdk
* Remove unused method for callbackOption
* Test instrument configuration
* Lint imports
* Add changes to changelog
* Refactor callbacks and further split opts
Define callbacks to return the value observed. Because of the different
types returned for different observables, the callbacks and options are
move to the sync/async packages.
* Update noop impl
* Fix example_test.go
* Fix internal impl
* Update Callbacks
Return observations for distinct attr sets.
* Refactor common code in sdk/metric inst provider
* Update examples and prom exporter
* Generalize callback
* Update changelog
* Add unit tests for callback
* Add meter tests for cbacks on creation
* Rename Observations to Measurements
* Update Callback to accept an Observer
* Update SDK impl
* Move conf to instrument pkg
* Apply suggestions from code review
* Create metric API Callback type
Document the type according the OTel specification requirements.
* Update all impls of the metric API with new type
* Add changes to changelog
* Update PR number in changelog entry
To potentially optimize the collection code path (#3047) ResourceMetrics
sent to the Exporter may be reused in the future. Warn users of this.
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
* Update Meter RegisterCallback method
Return a Registration from the method that can be used by the caller to
unregister their callback.
Update documentation of the method to better explain expectations of
use and implementation.
* Update noop impl
* Update global impl
* Test global Unregister concurrent safe
* Use a map to track reg in global impl
* Update sdk impl
* Use a list for global impl
* Fix prom example
* Lint metric/meter.go
* Fix metric example
* Placeholder for changelog
* Update PR number in changelog
* Update sdk/metric/pipeline.go
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
* Add test unregistered callback is not called
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
* add RegisterProducer method and metric.Producer interface
* rename testProducer to testSDKProducer
* rename testMetrics to testResourceMetrics
* add testExternalProducer for testing bridges
* add test data for testing external producers
* clean up help text
* unit tests for external Producer
* changelog
* improve test coverage
* Update CHANGELOG.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* support partial errors
* fix lint
* add additional test
* unallocate producers on shutdown
* don't register Producers after shutdown
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Add the InstrumentKind type and vars to sdk/metric
* Add the Instrument type to sdk/metric
* Add the Stream type to sdk/metric
* Add the View type to sdk/metric
* Add NewView to create Views matching OTel spec
* Add unit tests for NewView
* Add changes to changelog
* Apply suggestions from code review
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
* Update CHANGELOG.md
* Update match and mask comments of Instrument
* Explain wildcard logic in NewView with comment
* Drop views that replace name for multi-inst match
* Comment how users are expected to match zero-vals
* Remove InstrumentKind and Scope from Stream
* Fix redundant word in NewView comment
* Add view example tests
* Update comments to examples
* Fix broken English
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
* Replace view usage in sdk/metric
* Replace view use in stdoutmetric
* Replace view use in prometheus exporter
* Replace view use in otlpmetric exporters
* Replace view use in view example
* Add the InstrumentKind type and vars to sdk/metric
* Add the Instrument type to sdk/metric
* Add the Stream type to sdk/metric
* Add the View type to sdk/metric
* Add NewView to create Views matching OTel spec
* Add unit tests for NewView
* Add changes to changelog
* Apply suggestions from code review
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
* Update CHANGELOG.md
* Update match and mask comments of Instrument
* Explain wildcard logic in NewView with comment
* Drop views that replace name for multi-inst match
* Comment how users are expected to match zero-vals
* Remove InstrumentKind and Scope from Stream
* Fix redundant word in NewView comment
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
* Do not return an error for Drop aggs
The async instruments currently return an error if and only if there are
no aggregators returned from a resolve. Returning no aggregators means
the instrument aggregation is drop. Do not include this in the error
reporting decision.
* Only registers callbacks if non-drop agg is used
The instruments passed to RegisterCallback need to have some aggregation
defined otherwise it is implied they have a Drop aggregation. Check that
at least one instrument passed has an aggregation other than Drop before
registering the callback with the pipelines.
Also, return an error if the user passed another API implementation of
an asynchronous instrument.
* Remove unneeded TODO from pipeline
* Add changes to changelog
* Test callback not called for all drop instruments
* Test RegisterCallback returns err for non-SDK inst
* Fail gracefully for non-SDK instruments
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
* Return empty nil aggs if no meas
* Update tests with new expected behavior
* Add change to changelog
* Set PR number in changelog
* Run lint
* Fix pipeline_test
* Scope change in changelog to pkg
* Clean up init of agg types
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/otlp/internal/retry
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /schema
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/stdout/stdouttrace
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/stdout/stdoutmetric
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/prometheus
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/zipkin
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /trace
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/otlp/otlpmetric
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/jaeger
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/otlp/otlptrace/otlptracehttp
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /metric
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/otlp/otlptrace/otlptracegrpc
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /exporters/otlp/otlptrace
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /sdk/metric
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /bridge/opencensus
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1 in /sdk
Bump github.com/stretchr/testify from 1.8.0 to 1.8.1
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>
* Split WithView from WithReader
* Accept readers and views params in newPipelines
* Update MeterProvider pipes init
* Fix WithView comment
* Fix view example MeterProvider option
* Fix With{View,Reader} option in prom exporter test
* Test Reader not required to be comparable
* Add changes to changelog
* Fix changelog option name
* dependabot updates Thu Oct 27 19:57:50 UTC 2022
Bump github.com/golangci/golangci-lint from 1.48.0 to 1.50.1 in /internal/tools
Bump golang.org/x/tools from 0.1.12 to 0.2.0 in /internal/tools
* Ignore errors in Prom exporter's sanitizeName
* Omit type from inferred var decl
Co-authored-by: MrAlias <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
* Update API docs
Update the async instrument docs for the counters types to explain that
the value recorded is assumed by implementations to be the cumulative
sum.
* Refactor precomputed delta sum aggregation
Report the delta Aggregation while supporting cumulative Aggregate
values.
* Add changes to changelog
* Bump module versions
* Prepare stable-v1 for version v1.11.1
* Prepare experimental-metrics for version v0.33.0
* Update the changelog
* Update CHANGELOG.md
* Update Asynchronous API docs
Clarify the Counter and UpDownCounter Observe values are the exact
counter value, not increments to the previous measurements.
* Add the pre-computed sum Aggregator
* Test the PreComputedSum
* Use the PrecomputedSum for async counters
* Add changes to changelog
* Ignore false-positive lint error
* Split NewPrecomputedSum into delta/cumulative vers
* Decode values from OTEL_RESOURCE_ATTRIBUTES
The W3C spec specifies that values must be percent-encoded so when
reading the environment variable `OTEL_RESOURCE_ATTRIBUTES` the SDK
should decode them.
This is done by the `baggage` package, but its behaviour in case of
errors is slightly different from the current implementation of the SDK,
more specifically in cases where a key is missing a value. The SDK
returns a partial resource while the `bagage` package returns nil.
This may be considered a breaking change, so this commit fixes the
current implementation instead of using `baggage.Parse`.
* Add changelog entry for #2963
* Use otel.Handle on OTEL_RESOURCE_ATTRIBUTES decode error
* retain original value when decoding fails
* docs: update CHANGELOG
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/otlp/internal/retry
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump google.golang.org/protobuf from 1.28.0 to 1.28.1 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /schema
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/zipkin
Bump github.com/openzipkin/zipkin-go from 0.4.0 to 0.4.1 in /exporters/zipkin
Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 in /exporters/zipkin
Bump google.golang.org/grpc from 1.46.2 to 1.50.1 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump google.golang.org/grpc from 1.46.2 to 1.50.1 in /exporters/otlp/otlptrace
Bump google.golang.org/protobuf from 1.28.0 to 1.28.1 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/otlp/otlptrace
Bump google.golang.org/protobuf from 1.27.1 to 1.28.1 in /exporters/otlp/otlpmetric
Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 in /exporters/otlp/otlptrace
Bump google.golang.org/protobuf from 1.28.0 to 1.28.1 in /exporters/otlp/otlptrace
Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 in /exporters/otlp/otlpmetric
Bump google.golang.org/grpc from 1.42.0 to 1.50.1 in /exporters/otlp/otlpmetric
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/stdout/stdouttrace
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/prometheus
Bump google.golang.org/protobuf from 1.28.0 to 1.28.1 in /exporters/otlp/otlptrace/otlptracegrpc
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/otlp/otlpmetric
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/otlp/otlptrace/otlptracegrpc
Bump google.golang.org/grpc from 1.46.2 to 1.50.1 in /exporters/otlp/otlptrace/otlptracegrpc
Bump go.uber.org/goleak from 1.1.12 to 1.2.0 in /exporters/otlp/otlptrace/otlptracegrpc
Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 in /exporters/jaeger
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /trace
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/jaeger
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /metric
Bump github.com/stretchr/testify from 1.7.1 to 1.8.0 in /exporters/otlp/otlptrace/otlptracehttp
Bump github.com/google/go-cmp from 0.5.8 to 0.5.9 in /trace
Co-authored-by: Aneurysm9 <Aneurysm9@users.noreply.github.com>