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

609 Commits

Author SHA1 Message Date
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
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
Peter Liu
6a95d5770c
New stdoutmetric encoder with ignore timestamp (#3828)
* new stdoutmetric encoder with ignore timestamp

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* refactor to avoid using a dedicated encoder

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* remove useless encoder code

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* dont't change the original data

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* Update exporters/stdout/stdoutmetric/exporter.go

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

* complete test data and add changelog entry

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* Move changelog entry to unreleased

---------

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2023-03-09 11:41:47 -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
Tyler Yahn
60f7d42d1e
Remove the deprecated otel/metric/global pkg (#3829)
* Remove the deprecated `otel/metric/global` pkg

* Add changelog entry

* Update PR number in changelog

* Fix lint

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-03-07 08:36:19 -08:00
Alan Protasio
3015c86cfd
Avoid creating new references on WithDeferredSetup for every span (#3833)
* Avoid creating new references on WithDeferredSetup call
2023-03-07 07:40:31 -06:00
Tyler Yahn
c869b9171a
Document httpconv and netconv packages as trace providing only trace semantic convention (#3823)
* Document {http,net}conv pkgs as trace semconv

* Fix spelling error
2023-03-02 11:42:46 -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
Tyler Yahn
c39e625cdf
Drop compatibility testing for Go 1.18 (#3813)
* Drop support for Go 1.18

* Add changes to changelog

* Add PR number
2023-03-01 09:15:39 -08:00
Tyler Yahn
264becee27
Remove the deprecated metric/unit package (#3814)
* Remove the dep metric/unit package

* Add PR number
2023-02-28 14:14:43 -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
Aaron Clawson
46d7f8dad3
Add Note about dropping go 1.18 (#3771)
* Add Note about dropping go 1.18

* Fix lint

* Apply suggestions from code review

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

---------

Co-authored-by: Damien Mathieu <damien.mathieu@elastic.co>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-02-27 11:01:34 -08:00
Tigran Najaryan
071d317394
Fix incorrect "all" and "resource" definition for Schema File (#3777)
The "all" and "resource" sections had incorrect definitions of "attribute_rename"
transform. It was missing the subkey "attribute_map".

This is a bug fix and makes the implementation compliant with the spec:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/schemas/file_format_v1.1.0.md#resources-section

Related issue: https://github.com/open-telemetry/opentelemetry-specification/issues/3245

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-02-27 08:38:41 -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
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
Pijus Navickas
69d09462db
Implement IsSampled for OpenTelemetry bridgeSpanContext (#3570)
* Add IsSampled to OpenTracing bridge

* Add entry to CHANGELOG

* Add note to the README

* Update CHANGELOG.md

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

* Update bridge/opentracing/README.md

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

* Update bridge/opentracing/README.md

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

* Update bridge/opentracing/README.md

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

* Update bridge/opentracing/README.md

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

* Add PR ID to changelog note

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-02-23 13:11:48 -08:00
Tyler Yahn
99ec432679
Accept scope attributes during Tracer creation (#3739)
* Accept scope attributes during Tracer creation

The OTel specification requires the instrumentation attributes are
accepted by the API for the Tracer. This adds a TracerOption to satisfy
that requirement.
2023-02-21 13:31:37 -06:00
Damien Mathieu
37931d44b9
Allow using OTLP export retrier concurrently (#3756)
* allow using OTLP export retrier concurrently
2023-02-21 11:43:24 -06:00
Tyler Yahn
de94fafd17
Do no silently drop unknown schema data (#3743)
* Do no silently drop unknown schema data

* Add entry to changelog

* Add PR number to changelog

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
2023-02-21 08:39:38 -08: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
c5c3c95077
Accept scope attributes during Meter creation (#3738)
* Accept scope attr during Meter creation

* Fix lint

* Add changes to changelog

* Return a Set from InstrumentationAttributes

Likely these attributes will be stored as a Set in the SDK. Don't cause
two conversions because we return a slice here.

* Add config tests

* Fix lint
2023-02-17 10:00:19 -08:00
Tyler Yahn
80f187fd0d
Bump CI default version of Go to 1.20 (#3733)
* Bump CI default version of Go to 1.20

* Use crypto/rand in Jaeger exporter testing

* Use crypto/rand Reader in otlp exporters

* Remove use of dep rand.Seed in prometheus exporter

* Update changelog with public changes

* Quote DEFAULT_GO_VERSION value

* Update .github/workflows/ci.yml

* Update CHANGELOG.md

Co-authored-by: Damien Mathieu <42@dmathieu.com>

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
2023-02-16 08:33:12 -08:00
Peter Liu
d68b05fbee
Refactor package internal/attribute to not use generics. (#3725)
* remove generics

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* Update internal/attribute/attribute.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

* Update internal/attribute/attribute.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

* Update internal/attribute/attribute.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

* Update internal/attribute/attribute.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

* Update internal/attribute/attribute.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

* Update internal/attribute/attribute.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

* Update internal/attribute/attribute.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

* Update internal/attribute/attribute.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

* refactor unit test

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* add changelog

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* update changelog

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

* Update internal/attribute/attribute.go

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

* replace interface{} with any

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>

---------

Signed-off-by: Peter Liu <lpfvip2008@gmail.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-02-15 10:37:07 -08:00
Yuri Shkuro
68975917e5
[bridge/ot] Fall-back to TextMap carrier when it's not ot.HttpHeaders (#3679)
* [bridge/ot] Fall-back to TextMap carrier when it's not ot.HttpHeaders

Signed-off-by: Yuri Shkuro <github@ysh.us>

* changelog

* go mod tidy

* format

* fix deps

* delint

* simplify

* undo

* Fix changelog

* Move new tests under test/

* go fmt

* delint

Signed-off-by: Yuri Shkuro <github@ysh.us>

---------

Signed-off-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-02-14 08:01:55 -08:00
Tyler Yahn
f3b4813f2f
Add semconv/v1.18.0 (#3719)
* Add semconv/v1.18.0

* Add PR number to changelog
2023-02-13 13:51:11 -08:00
Anthony Mirabella
2f3c6df7bb
Add semantic conventions of the event type (#3697)
* Add semantic conventions of the `event` type

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>

* Update CHANGELOG.md

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

---------

Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-02-09 12:40:15 -08:00
Tyler Yahn
a7fb378ad9
Add testing for Go 1.20 (#3693)
* Add testing for Go 1.20

* Update PR number in changelog

* Quote 1.20 in ci.yml
2023-02-08 14:08:57 -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
Tyler Yahn
7b74959132
Remove http.target attr from ServerRequest (#3687)
* Remove http.target attr from ServerRequest

* Update changelog

* Remove trailing space in changelog
2023-02-07 14:12:41 -05:00
Tyler Yahn
0446207a38
Add funcs to semconv to create semantic convention KeyValues (#3675)
* Add semconv KeyValue funcs

* Add changes to changelog

* Variadic slice func parameters

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-02-06 09:41:41 -08:00
Tyler Yahn
aa5122490e
Remove the deprecated instrument packages (#3631)
* Remove the deprecated instrument packages

* Update changelog

* Add PR number
2023-01-31 08:12:39 -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
Joshua MacDonald
ec13377b6b
OTLP traces export errors use a consistent error message prefix (#3516)
* OTLP traces export errors use a consistent error message prefix

* use a wrapped error

* update changelog

* merge changelog

* Update CHANGELOG.md

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-01-27 10:42:15 -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
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
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
Robert Lin
640a0cd8bc
bridge/opentracing: introduce NewTracerProvider that wraps TracerProvider instead of Tracer (#3116)
* bridge/opentracing: add NewDynamicWrappedTracerProvider for named tracers

* bridge/opentelmeetry: cache created Tracers, add tests

* bridge/opentracing: rename constructor to NewTracerProvider

* add license header

* Update docstring

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

* fix deprecated docstring

* rewrite new lookup TracerProvider as separate type

* update docstring

* add changelog entries

* Update bridge/opentracing/provider.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
2023-01-11 16:59:06 -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
479c5c5840
Generate semconv/v1.16.0 (#3579)
* Generate semconv/v1.16.0

* Add changes to changelog
2023-01-08 08:12:25 -08:00
Tyler Yahn
b08ebeb187
Generate semconv/v1.15.0 (#3578)
* Add generated semconv/v1.15.0

* Add changelog entry for changes

* Update PR number in changelog entry
2023-01-08 08:01:08 -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