1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-04 09:43:23 +02:00
Commit Graph

737 Commits

Author SHA1 Message Date
Remy Chantenay
cf8367f711
Fix Version test in otel/sdk (#3994)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-04-14 07:41:27 -07:00
Kaushal Shah
37388599eb
Fixed race condition in OnEnd and added a unit test (#3951)
* Fixed race condition in OnEnd and added a test

* fixed code review comments

* fixed lint

* Update CHANGELOG.md

Co-authored-by: Robert Pająk <pellared@hotmail.com>

* Update sdk/trace/simple_span_processor_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update sdk/trace/simple_span_processor_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update sdk/trace/simple_span_processor_test.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* fixed panic check

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-04-14 07:23:47 -07:00
Tyler Yahn
8dba38e02f
Move global metric back to otel/metric/global for minor release (#3986)
* 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
2023-04-13 07:39:39 -07:00
Charlie Le
1b55281859
docs(typos): Run codespell to fix typos (#3980)
* 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>
2023-04-11 17:28:13 -07:00
Remy Chantenay
1b97d78324
Add Version func to otlpmetric and otlptrace (#3956)
* Add Version func to otel/exporters/otlp/otlpmetric

* Add Version func to otel/exporters/otlp/otlptrace

* Remove Version func from otel/exporters/otlp/internal

* Update CHANGELOG.md

* Add nolint rule to hostid readFile

* Move GetUserAgentHeader to internal packages

* Update exporters/otlp/otlpmetric/version.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Update exporters/otlp/otlptrace/version.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-04-10 14:19:49 -07:00
OpenTelemetry Bot
a261a0f869
dependabot updates Sun Apr 9 14:31:33 UTC 2023 (#3979)
Bump golang.org/x/tools from 0.7.0 to 0.8.0 in /internal/tools
Bump golang.org/x/sys from 0.6.0 to 0.7.0 in /sdk
2023-04-09 07:43:00 -07:00
Damien Mathieu
02fa1e2a8d
Fix aggregation.Default to properly return the default one (#3967)
* fix aggregation.Default to properly return the default one

* add changelog entry

* default aggregation does not error anymore

* test all instrument kinds
2023-04-05 07:44:48 -07:00
Tyler Yahn
65ebe5e50f
Add embedded private method interfaces in metric API (#3916)
* 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>
2023-04-03 07:33:19 -07:00
OpenTelemetry Bot
5f13db5ca6
dependabot updates Sun Apr 2 15:32:08 UTC 2023 (#3963)
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
2023-04-02 12:10:19 -04:00
Mikhail Mazurskiy
22fd10447d
Unify TracerProvider span processor lookups (#3942)
* 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()
2023-04-01 07:57:35 -07:00
Tyler Yahn
271df1dc01
Add Version func to otel/sdk (#3949)
* 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>
2023-03-30 12:49:39 -07:00
Tyler Yahn
f4a9d78e7f
Update Histogram Extrema and Sum to be generic (#3870)
* Update Histogram Extrema and Sum to be generic

* Update metric SDK

* Update exporters

* Add changes to changelog
2023-03-29 11:24:25 -07:00
Mikhail Mazurskiy
c4940f3b43
TracerProvider allows calling Tracer() while it's shutting down (#3924) 2023-03-27 17:05:44 -07:00
Damien Mathieu
ae90c4402e
switch atomic.Value to atomic.Pointer for spanProcessorStates (#3926)
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-03-27 09:38:47 -07:00
Eduardo Bonzi da Conceição
b73a33c487
Warn on intitialization of Simple SpanProcessor (#3854)
* 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>
2023-03-24 08:29:52 -07:00
Tyler Yahn
7ad0ae4da1
Release v1.15.0-rc.2/v0.38.0-rc.2 (#3923)
* 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>
2023-03-23 07:47:46 -07:00
Mikhail Mazurskiy
e4cc478c02
TracerProvider doesn't allow to register a SpanProcessor after shutdown (#3845) 2023-03-22 09:47:42 -07:00
Matthew Wear
282a47e3d3
add host.id to resource auto-detection (#3812)
* 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>
2023-03-21 14:45:30 -05:00
Tyler Yahn
90df52586b
Split metric configuration down to instrument (#3895)
* Split metric configuration down to instrument

* Rename *ObserverOptions to *ObservableOption

* Update option docs with links
2023-03-21 08:16:57 -05:00
Tyler Yahn
b7b53bba40
Remove Synchronous and rename Asynchronous (#3892)
* Remove the Synchronous interface

* Rename Asynchronous to Observable

* Update PR number
2023-03-20 13:26:17 -07:00
Sinan Ülker
7fc24d2b14
Update the metric Export interface to accept a *ResourceMetrics instead of ResourceMetrics (#3853)
* Change the signature of Export method

* Pass tests for otlp exporter

* Pass tests for otlp grpc and http packages

* Update opencensus bridge

* Refactor and pass tests for stdoutmetric package

* Update periodic reader tests

* Update changelog

* Apply suggestions

* Apply suggestions

* Update CHANGELOG.md

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-03-16 10:58:43 -07:00
Mori
3a40e65a38
Update go directive value in go.mod files to 1.19 (#3850)
* remove go 1.18 in go.mod, add go 1.19

* revert //+build directives

* remove +build directives

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-03-15 09:52:04 -07:00
Tyler Yahn
01b8f15a72
Add Exemplar to metricdata package (#3849)
* Add Exemplar to metricdata pkg

* Update histogram Aggregator

* Update opencensus bridge

* Update prometheus exporter

* Update OTLP exporter

* Update stdoutmetric exporter

* Add changes to changelog

* Update fail tests

* Add tests for IgnoreExemplars

* Fix merge
2023-03-14 07:56:18 -07:00
Tyler Yahn
b62eb2ca88
Pool sortables used to create attribute sets (#3832)
* 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>
2023-03-13 11:19:28 -07:00
Aaron Clawson
e463505da7
Reuse memory in metric pipelines (#3760)
* Have pipelines reuse memory

* truncate Metric slice

* Apply suggestions from code review

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Use rm pool on periodic shutdown.

* zero out RM on ctx error

* Update sdk/metric/pipeline.go

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Peter Liu <lpfvip2008@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Fix lint

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Peter Liu <lpfvip2008@gmail.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2023-03-09 09:43:16 -08:00
Tyler Yahn
7dc7b30405
Remove unneeded type argument from metric SDK (#3831)
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-03-09 07:33:18 -08:00
Tyler Yahn
1626ff746f
Wrap errors returned from Detect and New in sdk/resource (#3844)
* 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
2023-03-08 15:15:27 -08:00
OpenTelemetry Bot
3df561e644
dependabot updates Mon Mar 6 15:33:46 UTC 2023 (#3840)
Bump github.com/itchyny/gojq from 0.12.11 to 0.12.12 in /internal/tools
Bump golang.org/x/sys from 0.5.0 to 0.6.0 in /sdk
2023-03-06 07:40:41 -08:00
Tyler Yahn
34aacd95ff
Release v1.15.0-rc.1 (#3825)
* Bump module set versions

* Prepare stable-v1 for version v1.15.0-rc.1

* Prepare experimental-metrics for version v0.38.0-rc.1

* Update changelog
2023-03-02 07:43:27 -08:00
Tyler Yahn
813936187e
Support a global MeterProvider in go.opentelemetry.io/otel (#3818)
* 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
2023-03-01 11:16:03 -08:00
Robert Pająk
d0e4a438ef
Handle empty env vars as it they were not set (#3764)
* Handle empty env vars as it they were not set

* Add changelog entry

* Add missing unit test
2023-02-28 12:43:48 -08:00
Tyler Yahn
2e54fbb3fe
Release v1.14.0/v0.37.0/v0.0.4 (#3810)
* 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
2023-02-27 13:57:23 -08:00
Tyler Yahn
fe6856e804
Deprecate metric/unit and use a string for units in the metric API/SDK (#3776)
* 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
2023-02-27 08:10:56 -08:00
Aaron Clawson
17e5d0f549
Do not wrap error if multierror does not have one. (#3772) 2023-02-27 09:10:55 -06:00
OpenTelemetry Bot
0a75c5bd8a
dependabot updates Sun Feb 26 15:49:13 UTC 2023 (#3804)
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
2023-02-26 07:58:24 -08:00
Robert Pająk
1d6704c8fc
Support OTEL_METRIC_EXPORT_INTERVAL and OTEL_METRIC_EXPORT_TIMEOUT (#3763)
* Support OTEL_METRIC_EXPORT_INTERVAL and OTEL_METRIC_EXPORT_TIMEOUT

* Fix non-positive duration error log


Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-02-24 09:26:47 -06:00
Tyler Yahn
f78f72d66c
Merge instrument cache to inserter (#3724)
* 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>
2023-02-21 08:07:37 -08:00
Aaron Clawson
cc8bdaaad4
Change the Reader.Collect Signature. (#3732)
* Changes the signature of Collect().

This DOES NOT make the SDK reuse memory, but it does enable it to be added.
2023-02-21 09:04:27 -06:00
Tyler Yahn
0252734309
Rename instrumentID to streamID in metric SDK (#3735)
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).
2023-02-16 13:33:56 -08:00
Anthony Regeda
441a173514
No memory leakage in attributes filter (#3695)
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>
2023-02-13 08:07:06 -08:00
Mackenzie
e9bdda0e68
WithContainerID: Document ECS limitation. (#3639)
* 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>
2023-02-09 11:03:39 -08:00
Tyler Yahn
ddf393886c
Use semconv creation functions (#3683) 2023-02-07 13:42:47 -08:00
Anthony Mirabella
f2fd476f43
Prepare v1.13.0/v0.36.0 release (#3688)
* 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>
2023-02-07 14:34:41 -05:00
Aaron Clawson
5e8eb855bf
Add a benchmark for histogram allocations (#3635)
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-02-02 10:16:25 -08:00
Tyler Yahn
6cb5718eaa
Release v1.12.0/v0.35.0 (#3623)
* 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
2023-01-29 07:41:22 -08:00
Tyler Yahn
7f4d76ab7a
Use Extrema type for Histogram min/max (#3550)
* 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
2023-01-26 10:49:58 -08:00
Tyler Yahn
c0fb8dec4c
Remove the unneeded Observe method from the async instruments (#3586)
* 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
2023-01-25 12:58:09 -08:00
Tyler Yahn
c7e2679529
Generate the semconv/v1.17.0 package (#3599)
* Generate semconv/v1.17.0

* Update all semconv use to v1.17

* Add changes to changelog
2023-01-24 08:10:41 -08:00
Tyler Yahn
828892954b
Update the RegisterCallback of the SDK meter (#3604) 2023-01-24 07:56:11 -08:00
Tyler Yahn
a1ce7e5f0d
Combine precomputed values of filtered attribute sets (#3549)
* 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>
2023-01-20 09:54:42 -08:00
Tyler Yahn
88f6000318
Remove the unused produceKey and callbackKey (#3602)
Following #3584, this value and type are no longer used.
2023-01-20 09:44:25 -08:00
Tyler Yahn
69b18e62a7
Redesign RegisterCallback API (#3584)
* 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
2023-01-19 08:18:26 -06:00
Tyler Yahn
f941b3a8df
Restructure RegisterCallback method (#3587)
* 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
2023-01-13 08:31:14 -08:00
Tyler Yahn
36904e4463
Deprecate the syncint64/syncfloat64/asyncint64/asyncfloat64 packages (#3575)
* Dep async/sync pkgs for new inst in instrument pkg

* Replace use of deprecated instruments

* Add changelog entry

* Update changelog entry PR number
2023-01-10 15:06:24 -08:00
Tyler Yahn
78a55822f8
Upgrade all semconv dependencies to v1.16.0 (#3581)
* Upgrade all semconv ref to v1.16.0

* Add changes to changelog
2023-01-10 10:57:28 -08:00
Tyler Yahn
82882dfbd3
Have multi-instrument callback return an error (#3576)
* Have multi-inst callback return an error

* Update PR number in changelog entry

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-01-08 07:53:07 -08:00
Tyler Yahn
1f9cc3036b
Add single instrument callback and split metric instrument configuration (#3507)
* 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
2023-01-06 09:20:49 -08:00
Tyler Yahn
e368276257
Create metric API Callback type (#3564)
* 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
2023-01-05 14:22:06 -08:00
Tyler Yahn
4607516316
Rename metric SDK instrument kind to match API (#3562)
* Rename metric SDK instrument kind to match API

Follow up to #3530.

* Update CHANGELOG

Fix trailing spaces and update PR number.
2023-01-04 12:47:18 -08:00
Tyler Yahn
a54167d2c9
Remove metric instrument provider API (#3530)
* Remove all InstrumentProvider APIs

* Fix noop impl

* Fix metric/example_test.go

* Update global impl

* Update sdk/metric impl

* Fix examples

* Fix prometheus exporter

* Add changes to changelog

Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
2023-01-03 10:34:10 -08:00
Ziqi Zhao
c82dbddc31
TracerProvider shutdown release resources (#3551)
* TracerProvider shutdown release resources

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* add changelog

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* Update CHANGELOG.md

Co-authored-by: David Ashpole <dashpole@google.com>

* prevent registered span processors after shutdown

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>

* Update CHANGELOG.md

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: David Ashpole <dashpole@google.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-01-03 09:51:56 -08:00
Tyler Yahn
ad4d54e0f1
Warn metric Exporters of ResourceMetrics reuse (#3556)
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>
2023-01-03 08:15:07 -08:00
Daniel Metz
9d633d2ed5
traceIDRatioSampler: use rightmost bits (#3557)
* use bottom bits

* add changelog entry

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-12-30 14:06:06 -05:00
darkfeline
69e44a337b
Fix ParentBased comment formatting (#3553)
godoc doesn't have an unordered list syntax
2022-12-24 10:16:11 -08:00
Tyler Yahn
4014204d42
Allow multi-instrument callbacks to be unregistered (#3522)
* 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>
2022-12-16 12:02:42 -08:00
David Ashpole
14a17b3ad6
Add Metric Producer as a new interface, which returns scope metrics (#3524)
* 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>
2022-12-15 07:50:45 -08:00
Tyler Yahn
9c61547163
Remove the deprecated view package (#3520)
* Remove the deprecated view package

* Add change to changelog

* Fix changelog header
2022-12-07 11:38:22 -08:00
Aaron Clawson
bc5cf7eb26
Release v1.11.2/v0.34.0 (#3512)
* Update Versions

Signed-off-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Prepare stable-v1 for version v1.11.2

* Prepare experimental-metrics for version v0.34.0

* Update Changelog

Signed-off-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>

* Update CHANGELOG version.md

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

Signed-off-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-12-05 13:43:20 -06:00
Aaron Clawson
e97704c1ec
Fix a typo in the manual reader (#3509)
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-12-05 07:56:48 -08:00
Aaron Clawson
289a612e6a
Adds an Attribute assertion to metric data test (#3487)
* Adds an Attribute assertion to metric data test

Signed-off-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
2022-11-29 14:32:15 -06:00
Tyler Yahn
c4333a9687
Deprecate the sdk/metric/view package (#3476)
* Deprecate the sdk/metric/view package

* Add deprecation to changelog
2022-11-21 08:05:07 -08:00
Tyler Yahn
dbf960c8e1
Add view example tests (#3460)
* 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>
2022-11-21 07:45:47 -08:00
Tyler Yahn
037719b646
Replace view use from sdk/metric/view to sdk/metric (#3461)
* 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
2022-11-19 09:05:20 -08:00
Tyler Yahn
2e780d8e39
Add View, NewView, Instrument, Stream, and InstrumentKind to sdk/metric with unit tests (#3459)
* 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>
2022-11-16 08:18:02 -08:00
Tyler Yahn
308d0362e6
Only registers callbacks if non-drop aggregation is used (#3408)
* 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>
2022-11-11 09:10:59 -08:00
Tyler Yahn
d091ba88e4
Do not export aggregations without any data points (#3436)
* 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
2022-11-11 07:22:27 -08:00
Tyler Yahn
acd87773e2
Restructure instrument creation code paths (#3256)
* Add BenchmarkInstrumentCreation

* Unify instrument provider

* Resolve import shadow

* Update sdk/metric/pipeline.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Punctuate to fix lint

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-11-10 16:04:53 -08:00
Aaron Clawson
c21b6b6bb3
Adds attribute filter logic (#3396)
* Adds attribute filter logic

* Apply PR feedback

* Use updated MP options

* Update Changelog and TODO numbers

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-11-08 07:45:23 -08:00
Joshua MacDonald
49b62aef66
New benchmark derived from otel-launcher-go (#3395)
* New benchmark derived from otel-launcher-go

* edit

* refactoring from PR feedback

* refactoring from PR feedback

* update for upstream main

* revert view change

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-11-01 08:50:49 -07:00
Tyler Yahn
48a05478e2
Move Aggregation/Temporality selection to the Exporter interface (#3260)
* Add Aggregation/Temporality to Exporter iface

* Use Exporter selectors in periodic reader

* Move selector opts to just manual reader

* Simplify periodic reader ref to Exporter selectors

* Fix the periodic reader tests

* Add Aggregation/Temporality method to stdoutmetric

* Add Temporality/Aggregation to otlpmetric exp

* Add Temporality/Aggregation to http/grpc otlp clients

* Add oconf tests for selector opts

* Add tests to stdoutmetric for opts

* Correct comment subject

* Add changes to changelog

* Fix otest test client
2022-11-01 07:56:18 -07:00
Tyler Yahn
8a390acc34
Recommend not recording cumulative explicit histogram min/max (#3403)
* Recommend not recording cumulative hist min/max

* Update sdk/metric/aggregation/aggregation.go

Co-authored-by: David Ashpole <dashpole@google.com>

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: David Ashpole <dashpole@google.com>
2022-10-31 18:59:05 -07:00
github-actions[bot]
cc1eaec683
dependabot updates Mon Oct 31 15:24:02 UTC 2022 (#3433)
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>
2022-10-31 08:54:41 -07:00
Tyler Yahn
d1aca7b167
Associate views with MeterProvider instead of Reader (#3387)
* 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
2022-10-31 07:55:54 -07:00
github-actions[bot]
667a2017ae
dependabot updates Thu Oct 27 19:57:51 UTC 2022 (#3404)
* 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>
2022-10-27 14:21:32 -07:00
Tyler Yahn
40f19009b0
Calculate delta sums for delta async counter/up-down-counter types (#3398)
* 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
2022-10-27 08:47:27 -07:00
Tyler Yahn
2fe8861a24
Release v1.11.1/v0.33.0 (#3367)
* 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
2022-10-19 12:55:44 -07:00
Tyler Yahn
715631d35f
Fix Asynchronous Counters Recording (#3350)
* 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
2022-10-19 10:35:13 -07:00
Luiz Aoqui
05aca23c19
Decode values from OTEL_RESOURCE_ATTRIBUTES (#2963)
* 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>
2022-10-19 09:13:20 -07:00
github-actions[bot]
1cbd4c2b77
dependabot updates Mon Oct 17 16:17:28 UTC 2022 (#3348)
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>
2022-10-17 12:25:56 -04:00
Ziqi Zhao
a8b9ddc7f6
attribute: fix slice related function bug (#3252)
* attribute: fix slice related function bug

Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2022-10-13 09:34:02 -05:00
Bogdan Drutu
e4bdfe7b56
Fix sdktrace.TraceProvider Shutdown/ForceFlush when no processor register (#3268)
* Fix sdktrace.TraceProvider Shutdown/ForceFlush when no processor register

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>

* Update CHANGELOG.md

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-10-12 13:44:18 -07:00
Tyler Yahn
4a3adaafd4
Replace meterRegistry with cache (#3255) 2022-10-12 12:54:51 -07:00
Tyler Yahn
ff18552791
Release v1.11.0/v0.32.3 (#3275)
* Bump stable-v1 and experimental-metrics vers

* Prepare stable-v1 for version v1.11.0

* Prepare experimental-metrics for version v0.32.3

* Update changelog for release

* Retract v0.32.2 of otlpmetric{http,grpc}
2022-10-12 10:19:51 -07:00
Tyler Yahn
29511a0078
Release Metric v0.32.2 (#3270)
* Bump experimental-metrics version to v0.32.2

* Prepare experimental-metrics for version v0.32.2

* Update changelog
2022-10-11 14:55:18 -07:00
Tyler Yahn
b5292b8459
Handle duplicate Aggregators and log instrument conflicts (#3251)
* Add the cache type

* Add cache unit tests

* Test cache concurrency

* Add the instrumentCache

* Use the instrumentCache to deduplicate creation

* Drop unique check from addAggregator

* Fix aggregatorCache* docs

* Update cachedAggregator and aggregator method docs

* Remove unnecessary type constraint

* Remove unused errAlreadyRegistered

* Rename to not shadow imports

* Add changes to changelog

* Fix changelog English

* Store resolvers in the meter instead of caches

* Test all Aggregator[N] impls are comparable

* Fix lint

* Add documentation that Aggregators need to be comparable

* Update sdk/metric/internal/aggregator.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update sdk/metric/instrument.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update sdk/metric/instrument.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Update sdk/metric/internal/aggregator_test.go

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>

* Fix pipeline_test.go use of newInstrumentCache

Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
2022-10-11 15:41:47 -04:00
Tyler Yahn
c5ebbc4d4b
Use default view if instrument does not match any pipeline view (#3237)
* Use default view if inst matches no other

Fix #3224

* Test default view applied if no match

* Add changes to changelog

* Remove unneeded views len check in WithReader

* Do not return agg if adding err-ed

* Revert "Do not return agg if adding err-ed"

This reverts commit b56efb06a7.
2022-10-07 00:40:54 -04:00
Damien Mathieu
697d245b9c
Update bucket default bounds (#3222)
* update bucket default bounds to match the specification

* add changelog entry

* test custom boundaries with valid histogram

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2022-10-04 15:41:18 -07:00
Tyler Yahn
3675379e73
Remove the unused Resource field from the MeterProvider (#3253) 2022-10-03 09:57:27 -07:00
Tyler Yahn
aca054b075
Refactor Pipeline (#3233)
* Add views field to pipeline

Redundant maps tracking readers to views and readers to pipelines exist
in the pipelineRegistry. Unify these maps by tracing views in pipelines.

* Rename newPipelineRegistries->newPipelineRegistry

* Add Reader as field to pipeline

* Replace createAggregators with resolver facilitator

* Replace create agg funcs with inserter facilitator

* Correct documentation

* Replace pipelineRegistry with []pipeline type

* Rename newPipelineRegistry->newPipelines

* Fix pipeline_registry_test

* Flatten isMonotonic into only use

* Update FIXME into TODO

* Rename instrument provider resolver field to resolve

* Fix comment English

* Fix drop aggregator detection
2022-09-28 08:47:20 -07:00
Tyler Yahn
12e16d41e7
Bump golang.org/x/sys/unix (#3235)
* Bump golang.org/x/sys/unix

Fix #3234

Address GO-2022-0493 by upgrading golang.org/x/sys/unix from
v0.0.0-20210423185535-09eb48e85fd7 to
v0.0.0-20220919091848-fb04ddd9f9c8.

* Add changes to changelog
2022-09-27 09:08:34 -07:00