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

710 Commits

Author SHA1 Message Date
Tyler Yahn
9737995cdb
Drop support for Go 1.19 (#4481)
* Drop support for Go 1.19

* Add change to changelog

* Bump all modules to 1.20

* Update exponential_histogram_test.go

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-09-07 12:18:29 -05:00
Rangel Reale
fc70923e53
Ignore value option for metricdatatest (#4447) 2023-09-05 19:00:06 +02:00
David Ashpole
02616a25c6
add WithProducer to the prometheus exporter (#4473) 2023-08-31 11:17:07 -07:00
Tyler Yahn
e0a39b8f7d
Fix bridge/opencensus NewMetricExporter deprecation notice (#4470)
* Fix bridge/opencensus NewMetricExporter dep notice

* Link to NewMetricProducer

* Add PR number to changelog
2023-08-29 15:02:43 -07:00
Tyler Yahn
e528731853
Remove the deprecated internal exporters/otlp* packages (#4469)
* Remove the deprecated otlpmetric/internal pkg

* Remove the deprecated otlp/internal pkg

* Remove the deprecated otlptrace/internal pkg

* Remove the deprecated otlptrace/internal/envconfig pkg

* Remove the deprecated otlptrace/internal/otlpconfig pkg

* Remove the deprecated otlptrace/internal/otlptracetest pkg

* Remove the deprecated otlptrace/internal/retry pkg

* Add changelog entry

* Remove dependabot entries

* Remove versions.yaml entry

* Run go mod tidy

* Remove linter override for removed pkgs

* Run crosslink
2023-08-29 14:08:07 -07:00
Tyler Yahn
d702e92c2b
Remove the deprecated sdk/metric/aggregation package (#4468)
* Remove the deprecated sdk/metric/aggregation package

* Update PR number
2023-08-29 13:19:33 -07:00
Tyler Yahn
537fd53e6e
Remove the deprecated Jaeger exporter and example (#4467)
* Remove the deprecated Jaeger exporter

* Add changelog stub

* Remove the deprecated Jaeger example

* Add changelog stub for example rm

* Add PR number to changelog

* Remove dependabot entries

* Remove versions.yaml entries
2023-08-29 11:13:25 -07:00
Tyler Yahn
3c476ce181
Release v1.17.0/v0.40.0/v0.0.5 (#4464)
* Bump versions.yaml

* Prepare stable-v1 for version v1.17.0

* Prepare experimental-metrics for version v0.40.0

* Prepare experimental-schema for version v0.0.5

* Update changelog

* Update changelog release header
2023-08-28 07:50:03 -07:00
Tyler Yahn
6be116e31e
Add testing support for Go 1.21 (#4463)
* Add testing support for Go 1.21

* Add PR number in changelog
2023-08-27 07:18:34 -07:00
Tyler Yahn
69611bd01a
Switch Stream back to having an AttributeFilter field and add New*Filter functions (#4444)
* Add allow/deny attr filters

* Revert "Replace `Stream.AttributeFilter` with `AllowAttributeKeys` (#4288)"

This reverts commit 1633c74aea.

* Rename new attr filter funcs

Do not include the term "Attribute" in a creation function of the
"attribute" pkg.

* Update the AttributeFilter field documentation

* Add tests for filter creation funcs

* Add change to changelog

* Apply feedback

* Use NewDenyKeysFilter for allow-all and deny-list filters

* Remove links from field docs

These links do not render.

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-08-25 07:39:43 -07:00
Robert Pająk
d78820e905
Deprecate exporters/jaeger (#4423)
* Deprecate exporters/jaeger

* Delete jaeger example

* Remove jaeger exporter from docs

* Remove example from docs

* Update CHANGELOG.md

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

* Revert "Delete jaeger example"

This reverts commit 1a2b47bc9a.

* Revert "Remove example from docs"

This reverts commit 682db01075.

* Add nolint comment

* Remove Jaeger from main README

* Deprecate example/jaeger

* Apply suggestions from code review

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

* Apply suggestions from code review

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

* Update go.mod

* Update main.go

* fix lint

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
2023-08-15 08:54:50 -07:00
Tyler Yahn
3904523917
Flatten sdk/metric/aggregation into sdk/metric (#4435)
* Deprecate the aggregation pkg

* Decouple the internal/aggregate from aggregation pkg

* Add Aggregation to the metric pkg

* Do not use sdk/metric/aggregation in stdoutmetric exporter

* Update all generated templates

* Update prom exporter

* Fix view example

* Add changes to changelog

* Update CHANGELOG.md

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

* Rename Sum to AggregationSum

* Fix comments

* Centralize validation of aggregation in pipeline

* Remove validation of agg in manual_reader selector opt

* Fix merge

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-08-14 08:15:15 -07:00
Tyler Yahn
199dc34a09
Support default histogram selection in OTLP exporter (#4437)
* Support default histogram selection in OTLP exporter

* Add changes to changelog
2023-08-14 07:21:04 -07:00
David Ashpole
fe51391dc6
Change metric.Producer to be an Option on Reader (#4346)
* metric.Producer can be passed as an argument to Reader using
WithProducer

* reproduce data race

* revert to atomic.Value
2023-08-11 12:40:39 -07:00
Tyler Yahn
e9014a287c
Increase instrument name maximum length from 63 to 255 characters (#4434) 2023-08-11 09:49:47 +02:00
Robert Pająk
a9552aaffa
sdk/metric: Remove Reader.ForceFlush and ManualReader.ForceFlush (#4375) 2023-08-11 09:22:21 +02:00
Tyler Yahn
319cb3a3be
Deprecate the otlptrace/internal packages (#4425)
* Stop generating otlptrace/internal and deprecate

* Remove the tracetransform templates

They are no longer used.

* Add change stub to changelog

* Add PR number to changelog
2023-08-10 14:25:53 -07:00
Tyler Yahn
10d9038059
Use first-seen instrument name for name conflicts (#4428)
* Add acceptance test

* Return the first-seen for instrument name conflicts

* Add changes to changelog
2023-08-10 09:58:30 -07:00
Tyler Yahn
e3ed198611
Deprecate the otlpmetric/internal package and sub-packages (#4420)
* Deprecate the otlpmetric/internal package and sub-packages

* Add stub to changelog

* Add PR number to changelog stubs

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-08-08 09:19:17 -07:00
Tyler Yahn
25a6f15348
Deprecate the otlp/internal package and all sub-packages (#4421)
* Deprecate the otlp/internal package and all sub-packages

* Add deprecation to changelog

* No lint deprecated pkg use in otlpmetric

* Remove the unused header*.go files from otlptrace

* Use template wrappederror in otlptrace

* Add back removed header.go

* Replace use of WrapTracesError with fmt.Errorf

* Revert otlptrace/internal to main

* Deprecate retry module
2023-08-08 07:45:53 -07:00
Damien Mathieu
10099bb876
Handle 2xx as success for OTLP HTTP trace and metric exporters (#4365)
* handle no content responses for otlpmetric exporter

* handle no content responses for otlptraces http exporter

* add changelog entry

* add a ResponseStatus attribute rather than using error

* accept any status code between 200 and 299

* rename i to code

* switch require to assert

* shutdown the client in defer

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-08-07 10:32:44 -07:00
Jared Jenkins
b221025a4c
sdk/resource: Fix data race with emptyAttributes (#4409)
* 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>
2023-08-07 10:22:48 -07:00
David Ashpole
e1e6b96647
do not append _total if the metric already ends in _total (#4373) 2023-08-07 10:12:57 -07:00
Tyler Yahn
9452b93012
Upgrade all use of semconv to v1.21.0 (#4408)
* 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>
2023-08-07 09:30:40 -07:00
Tyler Yahn
d1f33f19b4
Decouple otlp/otlpmetric/otlpmetrichttp from otlp/internal and otlp/otlpmetric/internal using gotmp (#4407)
* Generate otlpmetrichttp/internal with gotmpl

* Use local internal pkg for otlpmetrichttp

* Add changes to changelog

* Fix rendered envconfig_test.go file name
2023-08-07 08:50:30 -07:00
Aaron Clawson
248413d654
Add the Exponential Histogram Aggregator. (#4245)
* 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>
2023-08-04 11:57:44 -07:00
Tyler Yahn
f67ecb35dc
Decouple otlp/otlpmetric/otlpmetricgrpc from otlp/internal and otlp/otlpmetric/internal using gotmp (#4404)
* Add shared otlpmetric templates

* Generate otlpmetricgrpc/internal with gotmpl

* Use local internal in otlpmetricgrpc

* Add decoupling change to changelog
2023-08-03 17:08:49 -07:00
Tyler Yahn
2e6ca0af0c
Decouple otlp/otlptrace/otlptracegrpc from otlp/internal and otlp/otlptrace/internal using gotmpl (#4400)
* Use template retry pkg in otlpconfig

* Template out all otlptrace internal

* Add envconfig pkg to otlptrace/internal

* Generate otlptrace/internal/otlpconfig

* Revert templatizing otlptracegrpc

* Add changes to changelog

* Add partialsuccess to internal shared

* Use gotmpl to generate otlptracegrpc/internal

* Add changes to changelog
2023-08-03 13:51:45 -07:00
Tyler Yahn
58c9cf65d6
Decouple otlp/otlptrace/otlptracehttp from otlp/internal and otlp/otlptrace/internal using gotmpl (#4401)
* Use template retry pkg in otlpconfig

* Template out all otlptrace internal

* Add envconfig pkg to otlptrace/internal

* Generate otlptrace/internal/otlpconfig

* Revert templatizing otlptracegrpc

* Add changes to changelog

* Fix lint

* Add partialsuccess to internal shared

* Use gotmpl to generate otlptracehttp/internal

* Add change to changelog
2023-08-03 13:34:48 -07:00
Tyler Yahn
4928282877
Decouple otlp/otlptrace/internal from otlp/internal using gotmpl (#4397)
* Add gotmpl

* Add shared retry pkg

* Use template retry pkg in otlpconfig

* Update license-check to look at first 4 lines

* Template out all otlptrace internal

* Add envconfig pkg to otlptrace/internal

* Generate otlptrace/internal/otlpconfig

* Revert templatizing otlptracegrpc

* Add changes to changelog

* Fix lint

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-08-02 12:28:35 -07:00
Tyler Yahn
378e51e365
Do not block Temporality/Aggregation on OTLP metric export (#4395)
* otlpmetricgrpc - no block temp/agg selection with export

* otlpmetrichttp - no block temp/agg selection with export

* Add test Export doesn't block Temporality or Aggregation

* Deprecate internal New and Exporter

* Add changes to changelog

* Apply suggestions from code review
2023-08-02 07:38:04 -07:00
David Ashpole
528a0cb34f
Expand the set of units supported by the prometheus exporter (#4374) 2023-08-02 08:34:28 +02:00
Tyler Yahn
2899fcfdca
Document the Reader and Exporter concurrent safe requirements (#4381) 2023-07-30 22:26:17 +02:00
Tyler Yahn
9418aca877
Use PeriodicReader timeout for ForceFlush (#4377)
* Use PeriodicReader timeout for ForceFlush

Prioritize the user passed context deadline if it has one.

* Update changelog
2023-07-29 07:33:48 -07:00
Robert Pająk
4f0d73cbc2
sdk/trace: Refine context cancellation in batchSpanProcessor.ForceFlush (#4369) 2023-07-27 10:05:52 +02:00
Robert Pająk
830fae8d70
Add semconv/v1.21.0 (#4362)
* Update tooling to point to new repository
* Update changelog
* Remove leftovers
* generate semconv/v1.21.0
2023-07-26 17:09:04 +02:00
Aaron Clawson
d423bd4cf2
Add tests for malformed selectors in readers (#4350) 2023-07-25 11:25:38 +02:00
David Ashpole
c1a644a10c
PeriodicReader.Shutdown now applies the periodic reader's timeout by default (#4356) 2023-07-25 11:00:16 +02:00
Robert Pająk
088ac8e179
Fix panic, deadlock and race in BatchSpanProcessor (#4353) 2023-07-25 10:13:45 +02:00
Tyler Yahn
ab61991465
Log a view suggestion for duplicate instrument conflicts (#4349)
* Log a view suggestion for duplicate instrument conflicts

* Add change to changelog

* Update changelog entry
2023-07-24 07:47:56 -07:00
Aaron Clawson
a5c82bf26e
Add otlpmetric Temporality Preference env var (#4287)
* Add otlp metrics env vars

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2023-07-20 10:50:12 -05:00
Tyler Yahn
e08359f30c
Detect duplicate instruments for case-insensitive names (#4338)
* 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
2023-07-19 10:17:38 -07:00
Tyler Yahn
84b2e54671
Use inst ID for agg cache key (#4337)
* 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
2023-07-19 09:59:07 -07:00
David Ashpole
c197fe9305
Metric SDK: Sum duplicate async observations regardless of filtering (#4289)
* Metric SDK: Remove the distinction between filtered and unfiltered attributes.
2023-07-19 10:52:11 -05:00
Tyler Yahn
f2a9f2f2be
Restrict Meters to only register and collect instruments it created (#4333)
* 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
2023-07-19 07:31:11 -07:00
Tyler Yahn
f194fb0c6c
Allow histogram for all instruments (#4332)
* 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
2023-07-19 07:12:00 -07:00
Matthew Wear
9b0c4d2caf
Fix empty host.id (#4317) 2023-07-18 17:37:20 +02:00
Tyler Yahn
7467923a51
Add info/debug logging to the metric SDK (#4315)
* 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>
2023-07-17 07:57:01 -07:00
Robert Pająk
3e203acae3
Fix changelog entry number for #4306 (#4314) 2023-07-14 21:13:51 +02:00
David Ashpole
03b8c47770
Add WithoutCounterSuffixes option in go.opentelemetry.io/otel/exporters/prometheus to disable addition of _total suffixes (#4306) 2023-07-14 17:52:35 +02:00