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.