* Add internaltest templates
* Generate internaltest using gotmpl
* Generate the sdk/internal/internaltest pkg
* Use sdk/internal/internaltest in sdk module
* Generate exporters/jaeger/internal/internaltest pkg
* Use exporters/jaeger/internal/internaltest in jaeger exporter
* Generate the exporters/zipkin/internal/internaltest pkg
* Use local internaltest in zipkin exporter
* Fix import path name in trace test
* Fix ASAN bug with emptyAttributes.
If mutliple instantiations of a Resources struct are happening
in parallel, they can end up modifying the same underlying resource.
* Capture literal
* add test
* remove unwanted change
* Update sdk/resource/resource_test.go
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Update sdk/resource/resource_test.go
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Update sdk/resource/resource_test.go
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Update sdk/resource/resource_test.go
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Add changelog.
* Update CHANGELOG.md
Co-authored-by: Robert Pająk <pellared@hotmail.com>
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Upgrade all use of semconv to v1.21.0
* Add change to changelog
* Add AIX and ZOS OS support
* Upgrade semconv for merged changes
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Bump golang.org/x/sys from 0.10.0 to 0.11.0 in /sdk
Bump golang.org/x/tools from 0.11.0 to 0.11.1 in /internal/tools
Bump go.opentelemetry.io/build-tools/crosslink from 0.10.0 to 0.11.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/semconvgen from 0.10.0 to 0.11.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/dbotconf from 0.10.0 to 0.11.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/multimod from 0.10.0 to 0.11.0 in /internal/tools
* Adds Exponential Histograms aggregator
* Added aggregation to the pipeline.
Adjust to new bucket
* Add no allocation if cap is available.
* Expand tests
* Fix lint
* Fix 64 bit math on 386 platform.
* Fix tests to work in go 1.19.
Fix spelling error
* fix codespell
* Add example
* Update sdk/metric/aggregation/aggregation.go
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Update sdk/metric/aggregation/aggregation.go
* Update sdk/metric/aggregation/aggregation.go
* Changelog
* Fix move
* Address feedback from the PR.
* Update expo histo to new aggregator format.
* Fix lint
* Remove Zero Threshold from config of expo histograms
* Remove DefaultExponentialHistogram()
* Refactor GetBin, and address PR Feedback
* Address PR feedback
* Fix comment in wrong location
* Fix misapplied PR feedback
* Fix codespell
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Instead of treating the returned *lastValue as an aggregator from
newLastValue, just use the type directly to construct the Measure and
ComputeAggregation functions returned from the Builder.
Accept a destination type for the underlying computeAggregation. This
allows memory reuse for collections which adds a considerable
optimization.
Simplify the integration testing of the last-value aggregate.
Update benchmarking.
* Replace filter aggregator with direct filter on measure
Part of #4220
Instead of using an aggregator to filter measured attributes, directly
filter the attributes in the constructed Measure function the Builder
creates.
Include unit and integration testing of new filtering.
* Update sdk/metric/internal/aggregate/aggregate.go
Co-authored-by: David Ashpole <dashpole@google.com>
---------
Co-authored-by: David Ashpole <dashpole@google.com>
* Detect dup inst for case-insensitive names
Resolve#3835
Detect duplicate instrument registrations for instruments that have the
same case-insensitive names. Continue to return the instruments with
different names, but log a warning. This is the solution proposed in
https://github.com/open-telemetry/opentelemetry-specification/pull/3606.
* Add changes to changelog
* Reset global logger after test
* Use inst ID for agg cache key
Resolve#4201
The specification requires the duplicate instrument conflicts to be
identified based on the instrument identifying fields:
- name
- instrument kind
- unit
- description
- language-level features such as the number type (int64 and float64)
Currently, the conflict detection and aggregation caching are done based
on the stream IDs which include an aggregation name, monotonicity, and
temporality instead of the instrument kind.
This changes the conflict detection and aggregation caching to use the
OpenTelemetry specified fields. This is effectively a no-op given there
is a 1-to-1 mapping of aggregation-name/monotonicity/temporality to
instrument kind (they are all resolved based on the instrument kind).
Additionally, this adds a stringer representation of the
`InstrumentKind`. This is needed for the logging of duplicate instrument
conflicts.
* Add changes to changelog
* Add acceptance test
* Update Meter Register and collect only inst from itself
* Add change to changelog
* Fix spelling error
* Update changelog entry wording
* Simplify the partial success code path
* Allow histogram for all instruments
Any instrument that can record negative values, do not include a sum in
the produced aggregation (like the specification recommends).
Resolves#4161
* Add changes to changelog
* Fix TestBucketsSum
* Add debug logging to the metric SDK
Resolves#3722
* Log MeterProvider and Meter setup at info level
* Add changelog entry
---------
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /bridge/opentracing/test
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /exporters/otlp/otlptrace/otlptracegrpc
Bump golang.org/x/tools from 0.10.0 to 0.11.0 in /internal/tools
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /exporters/otlp/otlptrace
Bump benchmark-action/github-action-benchmark from 1.17.0 to 1.18.0
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /example/otel-collector
Bump google.golang.org/grpc from 1.56.1 to 1.56.2 in /exporters/otlp/otlpmetric
Bump golang.org/x/sys from 0.9.0 to 0.10.0 in /sdk
* Replace Stream AttributeFilter with AttributeKeys
* Rename Stream field AttributeKeys to AllowAttributeKeys
Ensure forward compatibility if a deny-list of attribute keys is ever
added.
* Add change to changelog
* Update PR number in changelog
* Update CHANGELOG.md
Co-authored-by: Damien Mathieu <42@dmathieu.com>
---------
Co-authored-by: Damien Mathieu <42@dmathieu.com>
* Use newPipeline instead of direct construction
The newPipeline function exists to create a new pipeline, but it is not
currently used. This switches to using that as the default creation
method and removes the test for construction of a pipeline directly.
* Update sdk/metric/pipeline.go
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /bridge/opentracing/test
Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 in /example/view
Bump github.com/golangci/golangci-lint from 1.53.2 to 1.53.3 in /internal/tools
Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 in /exporters/prometheus
Bump golang.org/x/tools from 0.9.3 to 0.10.0 in /internal/tools
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /exporters/otlp/otlpmetric
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /exporters/otlp/otlptrace/otlptracegrpc
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /exporters/otlp/otlptrace
Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 in /example/prometheus
Bump google.golang.org/grpc from 1.55.0 to 1.56.0 in /example/otel-collector
Bump golang.org/x/sys from 0.8.0 to 0.9.0 in /sdk
* validate instrument names when creating them
* add changelog entry
* remove now invalid instrument name from prometheus test
* fix invalid names in meter_test
* keep returning the instrument even if its name is invalid
* make invalid instrument name a known error
* bring back prometheus invalid instrument name test
* remove warning
* fix lint
* move name validation into the lookup method
* fix lint again
* Revert "move name validation into the lookup method"
This reverts commit ec8ccc5fa0.
* rename ErrInvalidInstrumentName to ErrInstrumentName
* switch to explicit validations, instead of a regexp
* Update CHANGELOG.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* remove double check for empty name
* test validation shortcut with a single character
---------
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
Bump go.opentelemetry.io/build-tools/crosslink from 0.7.0 to 0.8.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/dbotconf from 0.7.0 to 0.8.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/multimod from 0.7.0 to 0.8.0 in /internal/tools
Bump go.opentelemetry.io/build-tools/semconvgen from 0.7.0 to 0.8.0 in /internal/tools
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlptrace
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/zipkin
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlptrace/otlptracehttp
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /bridge/opentracing/test
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/internal/retry
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlptrace/otlptracegrpc
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/jaeger
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/stdout/stdouttrace
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/stdout/stdoutmetric
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlpmetric
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /schema
Bump github.com/itchyny/gojq from 0.12.12 to 0.12.13 in /internal/tools
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /metric
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /trace
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/prometheus
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /bridge/opencensus
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /sdk/metric
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /bridge/opentracing
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4
Bump github.com/stretchr/testify from 1.8.3 to 1.8.4 in /sdk
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/zipkin
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /bridge/opentracing/test
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /schema
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/internal/retry
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/prometheus
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/stdout/stdoutmetric
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlptrace
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlpmetric
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlptrace/otlptracegrpc
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/stdout/stdouttrace
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/otlp/otlptrace/otlptracehttp
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /metric
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /trace
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /exporters/jaeger
Bump codecov/codecov-action from 3.1.3 to 3.1.4
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /sdk/metric
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /bridge/opencensus
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /bridge/opentracing
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3 in /sdk
Bump github.com/stretchr/testify from 1.8.2 to 1.8.3
* added version.go and test file for issue 2143
* added license in metric versiont_test
* goimport file linting
* update trace version to v.1.13.0 and metric to 0.36.0
* Update sdk/metric/version.go
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* using asser.Regxp
* changing regex string as per recommendations
Signed-off-by: ChillOrb <rakshitparashar1@gmail.com>
* changing regex string as per recommendations
Signed-off-by: ChillOrb <rakshitparashar1@gmail.com>
* reverting go mod and go sum changes
Signed-off-by: ChillOrb <rakshitparashar1@gmail.com>
* trace and metric version bump up
Signed-off-by: ChillOrb <rakshitparashar1@gmail.com>
* version update in sdk/metric , sdk/trace
Signed-off-by: ChillOrb <rakshitparashar1@gmail.com>
* doc typo fix
Signed-off-by: ChillOrb <rakshitparashar1@gmail.com>
* Apply suggestions from code review
---------
Signed-off-by: ChillOrb <rakshitparashar1@gmail.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Bump google.golang.org/grpc from 1.54.0 to 1.55.0 in /bridge/opentracing/test
Bump github.com/prometheus/client_golang from 1.15.0 to 1.15.1 in /example/view
Bump github.com/prometheus/client_model from 0.3.0 to 0.4.0 in /exporters/prometheus
Bump github.com/prometheus/client_golang from 1.15.0 to 1.15.1 in /exporters/prometheus
Bump google.golang.org/grpc from 1.54.0 to 1.55.0 in /exporters/otlp/otlptrace
Bump google.golang.org/grpc from 1.54.0 to 1.55.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump google.golang.org/grpc from 1.54.0 to 1.55.0 in /exporters/otlp/otlptrace/otlptracegrpc
Bump google.golang.org/grpc from 1.54.0 to 1.55.0 in /exporters/otlp/otlpmetric
Bump google.golang.org/grpc from 1.54.0 to 1.55.0 in /example/otel-collector
Bump github.com/prometheus/client_golang from 1.15.0 to 1.15.1 in /example/prometheus
Bump golang.org/x/sys from 0.7.0 to 0.8.0 in /sdk
* Revert "Move global metric back to `otel/metric/global` for minor release (#3986)"
This reverts commit 8dba38e02f.
* Add changes to changelog
* Fix versions and go mod tidy
* Run go-mod-tidy
* Bump versions
* Prepare stable-v1 for version v1.15.0
* Prepare experimental-metrics for version v0.38.0
* Fix otlpmetric tests
Check pre 1.0 as well
* Update the chagelog
Benchmark all instruments, not just an int64 counter.
Include benchmarks for all synchronous measurement methods.
Include benchmarks for all collections.
* Revert "Remove the deprecated `otel/metric/global` pkg (#3829)"
This reverts commit 60f7d42d1e.
* Revert "Support a global MeterProvider in `go.opentelemetry.io/otel` (#3818)"
This reverts commit 813936187e.
* Remove top level metric global
* Add change to changelog
* docs(typos): Run codespell to fix typos
There were a lot of typos through the repository, so I ran
[codespell][], a tool for automatically fixing typos, to fix them.
```console
make codespell
```
There's already a tool called [misspell][] that's supposed to take care
of this, but misspell hasn't been updated for 6 years, and it doesn't
seem to be catching any of the typos that codespell can.
[codespell]: https://github.com/codespell-project/codespell
[misspell]: https://github.com/client9/misspell
* Revert and ignore spelling for Consequentially
* Add GH workflow for codespell
* Revert GH Workflow and Makefile for codespell
Per @pellared, since there's no instructions for setting up codespell,
it was suggested that the changes for setting up a workflow and section
in Makefile include instructions for setting up codespell as well.
* Revert spelling on consequently
---------
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* fix aggregation.Default to properly return the default one
* add changelog entry
* default aggregation does not error anymore
* test all instrument kinds
* PoC of embedded private method ifaces
* Rename embed to embedded
* Add an embedded iface for all instruments
* Fix metric/instrument tests
* Fix global and otel
* Fix SDK
* Comment the embedded pkg types
* Update the embedded pkg docs
* Update otel/metric docs about impls
* Update otel/metric type docs on impl
* Update docs in otel/metric/instrument on default
* Add changes to changelog
* Apply suggestions from code review
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Apply feedback on URLs
* Reword based on feedback
* Make it clear we only recommended embedding noop
* Ignore links with godot linter
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
Bump github.com/go-logr/logr from 1.2.3 to 1.2.4 in /exporters/zipkin
Bump github.com/go-logr/logr from 1.2.3 to 1.2.4 in /exporters/jaeger
Bump github.com/go-logr/logr from 1.2.3 to 1.2.4 in /sdk/metric
Bump github.com/go-logr/logr from 1.2.3 to 1.2.4 in /sdk
Bump github.com/go-logr/logr from 1.2.3 to 1.2.4
* Pre-allocate spanProcessorStates slice
* Make sync.Once a non-pointer
It doesn't need to be a pointer, can be part of the struct to avoid allocating a separate object for it
* getSpanProcessors() helper
* Add tests for UnregisterSpanProcessor()
* Add Version func to otel/sdk
* Update sdk/resource to use sdk version
* Remove unused UserAgent from sdk/internal
* Add changes to changelog
* Update CHANGELOG.md
Co-authored-by: Robert Pająk <pellared@hotmail.com>
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* add warning log about using simpleSpanProcessor in production
* add changelog entry
* fix changelog
* switch to using the new Warn logging function
* revert alignment formatting in changelog
---------
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* Bump versions
* Prepare stable-v1 for version v1.15.0-rc.2
* Prepare experimental-metrics for version v0.38.0-rc.2
* Update changelog
* Update CHANGELOG.md
Co-authored-by: Robert Pająk <pellared@hotmail.com>
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* add platform specific hostIDReaders
* add WithHostID option to Resource
* add changelog entry
* Apply suggestions from code review
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
* linting
* combine platform specific readers and tests
This allows us to run tests for the BSD, Darwin, and Linux readers
on all platforms.
* add todo to use assert.AnError after resource.Detect error handling is updated
* move HostID test utilities to host_id_test
* return assert.AnError from mockHostIDProviderWithError
* use assert.ErrorIs
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
---------
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
* Pool sortables used to create attribute sets
* Move sync pool to attribute pkg
* Add change to changelog
* Fix comment
* Apply suggestions from code review
Co-authored-by: Peter Liu <lpfvip2008@gmail.com>
* Update sdk/metric/instrument.go
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Update comment based on feedback
* Apply feedback
---------
Co-authored-by: Peter Liu <lpfvip2008@gmail.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
* Update Detect and New to wrap errors
* Add TestNewWrapedError
Test that New returns an error that can be unwrapped.
* Add changes to changelog
* Clarify and simplify errors
* Move ErrorHandler impl to internal
To avoid the import cycle, the otel/metric package needs to not import
otel. To achieve this, the error handling implementation is moved to the
otel/internal/global package where both can import the needed
functionality.
* Add global metric to go.opentelemetry.io/otel
* Crosslink and update to global metric in otel
* Add changes to changelog
* Set PR number in changelog
* Add global metric unit tests
* Rename MeterProivder() to GetMeterProivder()
* Add TODO to remove nolint comments
* Bump mod versions
* Add bridge/opentracing/test to versions.yaml
* Prepare stable-v1 for version v1.14.0
* Prepare experimental-metrics for version v0.37.0
* Prepare experimental-schema for version v0.0.4
* Update changelog
* Replace Unit from metric/unit with string
Deprecate the units package. This package will not be included in the
metric GA.
* Add changes to changelog
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /bridge/opentracing/test
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/otlp/internal/retry
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /schema
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/prometheus
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /metric
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/jaeger
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/zipkin
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /trace
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/otlp/otlpmetric
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/stdout/stdouttrace
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/otlp/otlptrace/otlptracegrpc
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/otlp/otlptrace
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/otlp/otlptrace/otlptracehttp
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /exporters/stdout/stdoutmetric
Bump github.com/golangci/golangci-lint from 1.51.1 to 1.51.2 in /internal/tools
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /sdk/metric
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /bridge/opencensus
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /sdk
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2
Bump golang.org/x/sys from 0.0.0-20220919091848-fb04ddd9f9c8 to 0.5.0 in /sdk
Bump github.com/stretchr/testify from 1.8.1 to 1.8.2 in /bridge/opentracing
Bump lycheeverse/lychee-action from 1.5.4 to 1.6.1
* Merge instrument cache to inserter
The current pipeline resolution path will only add the resolved
aggregators to the pipeline when it creates one (cache miss). It will
not add it if there is a cache hit. This means (since we cache
instruments at the meter level, not the pipeline level) the first reader
in a multiple-reader setup is the only one that will collect data for
that aggregator. All other readers will have a cache hit and nothing is
added to the pipeline. This is causing #3720.
This resolves#3720 by moving the instrument caching into the inserter.
This means aggregators are cached at the reader level, not the meter.
* Rename aggCV to aggVal
---------
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
An instrument is defined by a name, description, unit, and kind. The
instrumentID contains more identifying information than these fields.
The additional information it contains relate to what the OTel metric
data-model calls a stream. Match the terminology and remove using the
instrumentID name in case we want to use it for something else (say,
when caching instruments).
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