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

849 Commits

Author SHA1 Message Date
Robert Pająk
81512d9f31
sdk/log: Add design doc (#4954) 2024-03-13 08:25:05 +01:00
OpenTelemetry Bot
2d968c454a
dependabot updates Sun Mar 10 09:28:42 UTC 2024 (#5047)
build(deps): bump google.golang.org/grpc from 1.62.0 to 1.62.1 in /exporters/otlp/otlpmetric/otlpmetricgrpc
build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc
build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 in /exporters/prometheus
build(deps): bump google.golang.org/grpc from 1.62.0 to 1.62.1 in /exporters/otlp/otlptrace/otlptracegrpc
build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 in /exporters/otlp/otlptrace/otlptracegrpc
build(deps): bump google.golang.org/grpc from 1.62.0 to 1.62.1 in /bridge/opentracing/test
build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 in /exporters/otlp/otlptrace/otlptracehttp
build(deps): bump google.golang.org/grpc from 1.62.0 to 1.62.1 in /exporters/otlp/otlptrace/otlptracehttp
build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 in /exporters/otlp/otlptrace
build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 in /exporters/otlp/otlpmetric/otlpmetrichttp
build(deps): bump google.golang.org/grpc from 1.62.0 to 1.62.1 in /exporters/otlp/otlpmetric/otlpmetrichttp
build(deps): bump google.golang.org/grpc from 1.62.0 to 1.62.1 in /example/otel-collector
build(deps): bump golang.org/x/sys from 0.17.0 to 0.18.0 in /sdk
build(deps): bump golang.org/x/tools from 0.18.0 to 0.19.0 in /internal/tools
2024-03-10 12:34:44 +01:00
Tyler Yahn
fe9bab54b7
Use Distinct instead of Set for map keys (#5027) 2024-03-06 11:11:16 +01:00
OpenTelemetry Bot
916d5f25fe
dependabot updates Sun Mar 3 18:37:17 UTC 2024 (#5026)
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /sdk/metric
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /exporters/otlp/otlptrace/otlptracegrpc
build(deps): bump codecov/codecov-action from 3.1.5 to 4.1.0
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /exporters/zipkin
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /metric
build(deps): bump github.com/prometheus/client_golang from 1.18.0 to 1.19.0 in /example/prometheus
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /exporters/stdout/stdouttrace
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /exporters/otlp/otlptrace/otlptracehttp
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /exporters/otlp/otlptrace
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /trace
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /exporters/stdout/stdoutmetric
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /bridge/opentracing
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /schema
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /log
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /sdk
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /bridge/opencensus
build(deps): bump go.opentelemetry.io/build-tools/gotmpl from 0.12.0 to 0.13.0 in /internal/tools
build(deps): bump go.opentelemetry.io/build-tools/multimod from 0.12.0 to 0.13.0 in /internal/tools
build(deps): bump go.opentelemetry.io/build-tools/dbotconf from 0.12.0 to 0.13.0 in /internal/tools
build(deps): bump go.opentelemetry.io/build-tools/semconvgen from 0.12.0 to 0.13.0 in /internal/tools
build(deps): bump go.opentelemetry.io/build-tools/crosslink from 0.12.0 to 0.13.0 in /internal/tools
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /exporters/otlp/otlpmetric/otlpmetrichttp
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /bridge/opentracing/test
build(deps): bump github.com/prometheus/client_golang from 1.18.0 to 1.19.0 in /exporters/prometheus
build(deps): bump github.com/stretchr/testify from 1.8.4 to 1.9.0 in /exporters/prometheus
2024-03-03 22:08:09 +01:00
Robert Pająk
7dea232a46
[chore] Simplify the license header (#4987) 2024-02-29 07:05:28 +01:00
Tyler Yahn
d50a23bf4b
Clear aggregate value maps instead of deleting entries (#4981) 2024-02-27 08:22:58 +01:00
Tyler Yahn
b302227390
Utilize the new slices package in sdk/metric (#4982) 2024-02-27 08:00:29 +01:00
Tyler Yahn
561714acb2
Drop support for Go 1.20 (#4967)
* Update README.md

* Remove 1.20 support from CI workflows

* Update all go mod

* Add changelog entry

* Update go mod tidy target

* Run go mod tidy

* Replace sliceEqualFunc with slices.EqualFunc

* Replace grow with slices.Grow

* Replace ensureAttributesCapacity with slices.Grow

* Replace conditional with min

* Use slices module for slice comparison in metricdatatest
2024-02-25 10:48:32 -08:00
Tyler Yahn
22a4f9cc55
Export internal/global.getLogger (#4969)
* Export getLogger

Refactor the declaration of globalLogger to incorporate the logic of
init() so there is no data race between GetLogger and init being called.

* Use GetLogger in log testing

* Restore logger in batch span processor testing

* Remove unused URL in globalLogger doc
2024-02-25 07:27:44 -08:00
Tyler Yahn
e6e186bfa4
Release v1.24.0/v0.46.0/v0.0.1-alpha (#4966)
* Bump versions

* Prepare stable-v1 for version v1.24.0

* Prepare experimental-metrics for version v0.46.0

* Prepare experimental-logs for version v0.0.1-alpha

* Update changelog

* Fix changelog entry
2024-02-23 08:32:44 -08:00
Erica Yin
27e495d6f9
Fix output exponential histogram negative buckets (#4956)
* Fix output exponential histogram buckets

* Update CHANGELOG
2024-02-22 13:51:41 -08:00
Charlie Le
693eb7dbbb
Fix typos in docs and comments (#4940)
Ignoring words that would have renamed

- nam. -> name
- ans -> and
2024-02-17 13:36:41 +01:00
dependabot[bot]
b423bfdffa
Bump golang.org/x/sys from 0.16.0 to 0.17.0 in /sdk (#4904)
* Bump golang.org/x/sys from 0.16.0 to 0.17.0 in /sdk

Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/sys/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run go mod tidy

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2024-02-12 10:39:55 -08:00
Robert Pająk
dd5d05472c
sdk/metrics: Move experimental docs to x package (#4895) 2024-02-09 09:15:18 +01:00
Robert Pająk
15b3f4d776
Fix TestWithIDGenerator (#4894) 2024-02-09 09:01:32 +01:00
Robert Pająk
cfaf1f08e9
resource: Add testable example (#4887) 2024-02-08 11:51:43 +01:00
Tyler Yahn
c5b112f31b
Release v1.23.1/v0.43.2 (#4892)
* Bump versions.yaml

* Prepare stable-v1 for version v1.23.1

* Prepare experimental-metrics for version v0.45.2

* Add changes to changelog
2024-02-07 12:41:47 -08:00
Tyler Yahn
11ebd19c46
Fix callback registration bug (#4888)
* Fix cback reg bug

Register all callbacks not just the last passed.

* Add changelog entry
2024-02-07 11:59:58 -08:00
Tyler Yahn
e3eb3f7538
Release v1.23.0/v0.45.1 (#4885)
* Bump versions.yaml

* Prepare stable-v1 for version v1.23.0

* Prepare experimental-metrics for version v0.45.1

* Update changelog

* Update CHANGELOG.md
2024-02-06 07:50:39 -08:00
Tyler Yahn
eabcef4c2d
Return merged Resource on schema conflict (#4876)
* Return merged Resource on schema conflict

* Add changes to changelog

* Doc returned resource to have no schema URL

* Refactor Merge based on feedback

* Add the schema URLs to the returned error

* Ensure no schema URL when merge conflict on detect

* Replaced isErr with wantErr in TestNew

* Update sdk/resource/auto_test.go

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

* Update TestDetect based on feedback

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-02-05 07:33:29 -08:00
Michał Posłuszny
569854e1d1
sdk/metric/metricdata: Add MarshalJSON for Extrema (#4827)
* json marshal for Extrema type, makefile typo fix

* MarshalText implementation, cleanup

* update changelog

* changelog fix

* Update CHANGELOG.md

* MarshalText behavior update on invalid Extrema

* Fix Marshal outputs json text representation of nil

* Updated mockData to include example with Min and Max values.

* null value test, changelog fix

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com>
2024-02-01 09:58:42 -08:00
Tyler Yahn
242d23a181
Remove the Flush method from Exemplar (#4873)
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-01-31 14:07:40 -08:00
Tyler Yahn
fecb92e366
Add the experimental exemplar feature (#4871)
* Add the experimental exemplar feature

* Add exemplars to EXPERIMENTAL.md

* Add changelog entry

* Fix hist buckets > 1 detection

* Collect instead of Flush res about to be deleted

* Add e2e test

* Do not pre-alloc ResourceMetrics

This only has a single use.

* Fix grammatical error in comment

* Add test cases

Default and invalid OTEL_METRICS_EXEMPLAR_FILTER.

Test sampled and non-sampled context for trace_based.

* Comment nCPU

* Doc OTEL_METRICS_EXEMPLAR_FILTER
2024-01-31 13:15:35 -08:00
Tyler Yahn
e7de5715ab
Add the Histogram Reservoir impl (#4870)
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2024-01-30 07:46:21 -08:00
Tyler Yahn
dcfec0c2fa
Add the random fixed size exemplar reservoir (#4852)
* Add the random fixed size exemplar reservoir

* Rename fixed.go to storage.go

* Update sdk/metric/internal/exemplar/rand.go

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

* Remove stale ref to spec recommendation

* Add comments to clarify the reset/advance/Collect methods

* Apply comment from feedback

* Add random func to gen rand float64 on (0,1)

* Use random in TestFixedSizeSamplingCorrectness

* Add clarifying algorithm comments

Include a high-level overview of the algorithm implemented and clarify
parameter names to be consistent.

* Fix duplicate word

* Update sdk/metric/internal/exemplar/rand.go

* Comment TestFixedSizeSamplingCorrectness

* Update test delta

* Test collect less than cap

* Remove measurement.Valid method

---------

Co-authored-by: David Ashpole <dashpole@google.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2024-01-29 07:26:30 -08:00
Tyler Yahn
79371c17c1
Add the SampledFilter exemplar Reservoir impl (#4851)
This Reservoir implementaiton is used at the MeterProvider level to
pre-filter measurements offered to a wrapped Reservoir.

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-01-25 12:35:10 -08:00
Tyler Yahn
08beb8b7ca
Add the Drop exemplar Reservoir implementation (#4850) 2024-01-25 12:26:08 -08:00
Tyler Yahn
c573785b8a
Add the sdk/metric/internal/exemplar package (#4835)
* Add the sdk/metric/internal/exemplar pkg

* Rename testReservoir to ReservoirTest

This is a test helper function that is not exported outside of testing
for the package. Use the exported name so the CI system doesn't complain
about it not being used. It will be used in follow-up PRs.

* Run go mod tidy
2024-01-24 08:05:51 -08:00
David Ashpole
1978044c55
Cache instruments so repeatedly creating identical instruments doesn't leak memory (#4820)
* cache instruments to avoid leaking memory

* add cacheWithErr to simplify error handling

* add wanring on repeated obserbable instrument creation with callbacks

* documentation for new behavior

* address feedback

---------

Co-authored-by: Damien Mathieu <damien.mathieu@elastic.co>
2024-01-24 07:42:43 -08:00
Baptiste Girard-Carrabin
71d13ffc2a
Fix ContainerID detector on systemd with colon in cgroup path (#4449)
Co-authored-by: David Ashpole <dashpole@google.com>
2024-01-23 13:04:46 -08:00
Alex Boten
8778c38832
docs: minor update to docstring (#4833)
Signed-off-by: Alex Boten <aboten@lightstep.com>
2024-01-19 15:18:16 +01:00
Tyler Yahn
1e2555f380
Release v1.23.0-rc.1 (#4832)
* Update versions.yaml

Move experimental-metrics modules that are stbilizing to the stable-v1
module-set.

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

* Update changelog
2024-01-18 12:26:17 -08:00
Aaron Clawson
279c549cab
Release v1.22.0/v0.45.0 (#4821)
* Update to v1.22.0

* Prepare stable-v1 for version v1.22.0

* Prepare experimental-metrics for version v0.45.0
2024-01-17 13:24:10 -06:00
Liz Fong-Jones
4491b39db2
sdk/trace: use slices.Grow() to avoid excessive runtime.growslice() (#4818)
* sdk/trace: use slices.Grow() to avoid excessive runtime.growslice()

* go1.20 compat

* update go.mod/sum

* Update CHANGELOG.md

* Revert "update go.mod/sum"

This reverts commit 1e4fcfa86c.

* inline slices.Grow as ensureAttributesCapacity

* fix comment

* add bench

* fix inlining

* Apply suggestions from code review

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

* add ReportAllocs

* add benchmark variations with lower limit

* bugfix: we always want to set cap, just the value is a min()

* lint

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
2024-01-12 13:42:36 -08:00
CZ
7fa7d1b252
sdk/metric: Fix observable not registered error when the asynchronous instrument has a drop aggregation (#4772)
* Fix observable instrument not registered on drop aggregation

* Add TestObservableDropAggregation

* Add testcase for dropping unregistered observable

* Update CHANGELOG

* Add observable name const + suggestions

* Add suggestions

* Only error if the instrument is not dropped

* Decrease indentation

* Revert "Decrease indentation"

This reverts commit 9e7e7729bf.

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2024-01-11 15:27:40 -08:00
Robert Pająk
01472db75f
Upgrade use of semconv to v1.24.0 (#4754) 2024-01-11 12:56:07 +01:00
OpenTelemetry Bot
133f943694
dependabot updates Sun Jan 7 15:43:49 UTC 2024 (#4813)
Bump golang.org/x/sys from 0.15.0 to 0.16.0 in /sdk
2024-01-07 09:00:00 -08:00
OpenTelemetry Bot
1cfd83a1ee
dependabot updates Sun Dec 24 21:19:11 UTC 2023 (#4797)
Bump google.golang.org/grpc from 1.60.0 to 1.60.1 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump google.golang.org/protobuf from 1.31.0 to 1.32.0 in /exporters/otlp/otlpmetric/otlpmetrichttp
Bump github.com/go-logr/logr from 1.3.0 to 1.4.1
Bump github.com/go-logr/logr from 1.3.0 to 1.4.1 in /sdk/metric
Bump google.golang.org/protobuf from 1.31.0 to 1.32.0 in /exporters/prometheus
Bump github.com/go-logr/logr from 1.3.0 to 1.4.1 in /sdk
Bump google.golang.org/protobuf from 1.31.0 to 1.32.0 in /exporters/otlp/otlptrace/otlptracehttp
Bump google.golang.org/grpc from 1.60.0 to 1.60.1 in /exporters/otlp/otlptrace/otlptracehttp
Bump google.golang.org/grpc from 1.60.0 to 1.60.1 in /bridge/opentracing/test
Bump google.golang.org/grpc from 1.60.0 to 1.60.1 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump google.golang.org/protobuf from 1.31.0 to 1.32.0 in /exporters/otlp/otlpmetric/otlpmetricgrpc
Bump google.golang.org/protobuf from 1.31.0 to 1.32.0 in /exporters/otlp/otlptrace
Bump github.com/go-logr/logr from 1.3.0 to 1.4.1 in /exporters/zipkin
Bump google.golang.org/grpc from 1.60.0 to 1.60.1 in /example/otel-collector
Bump google.golang.org/grpc from 1.60.0 to 1.60.1 in /exporters/otlp/otlptrace/otlptracegrpc
Bump google.golang.org/protobuf from 1.31.0 to 1.32.0 in /exporters/otlp/otlptrace/otlptracegrpc
2023-12-25 20:21:38 +01:00
Tyler Yahn
e3bf787c21
Add cardinality limiting to the metric SDK as an experimental feature (#4457)
* Add agg limiting func

* Add unit test for limitAttr

* Add limiting to aggregate types

* Add internal x pkg for experimental feature-flagging

* Connect cardinality limit to metric SDK

* Replace limitAttr fn with limiter type

The Attribute method is still inlinable.

* Use x.CardinalityLimit directly

* Simplify limiter test

* Add limiter benchmark

* Document the AggregationLimit field

* Test sum limits

* Test limit for last value

* Test histogram limit

* Refactor expo hist test to use existing fixtures

The tests for the exponential histogram create their own testing
fixtures. There is nothing these new fixtures do that cannot already be
done with the existing testing fixtures used by all the other aggregate
functions. Unify the exponential histogram testing to use the existing
fixtures.

* Test the ExponentialHistogram limit

* Fix lint

* Add docs

* Rename aggregation field to aggLimit

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2023-12-19 07:53:01 -08:00
Robert Pająk
8e756513a6
sdk/metric: Record measurements when context is done (#4671) 2023-12-15 19:14:16 +01:00
Tyler Yahn
215eae31c7
Refactor exponential histogram tests to use existing fixtures (#4747)
* Refactor expo hist test to use existing fixtures

The tests for the exponential histogram create their own testing
fixtures. There is nothing these new fixtures do that cannot already be
done with the existing testing fixtures used by all the other aggregate
functions. Unify the exponential histogram testing to use the existing
fixtures.

* Add alt input for cumulative test
2023-12-09 08:08:24 -08:00
David Ashpole
b5afa704f1
Fix multi-reader observable counter double-counting bug (#4742)
* fix Fix a bug where using multiple readers resulted in incorrect asynchronous counter values

* move addCallback to inserter

* restore comment
2023-12-08 14:21:30 -08:00
Tyler Yahn
d37d851bbc
Add the internal experimental metric feature package (#4715)
* Add the internal experimental metric feature pkg

* Interpret empty envvar same as unset

* Test Exemplars and CardinalityLimit

* Fix empty test for CardinalityLimit

* Abstract common testing patterns

* Add test cases from review feedback

* Rename assertions based on review feedback

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
2023-12-06 10:36:21 -08:00
OpenTelemetry Bot
0905a9d8ab
dependabot updates Sun Dec 3 16:09:27 UTC 2023 (#4740)
Bump golang.org/x/sys from 0.14.0 to 0.15.0 in /sdk
Bump github.com/itchyny/gojq from 0.12.13 to 0.12.14 in /internal/tools
Bump golang.org/x/tools from 0.15.0 to 0.16.0 in /internal/tools
2023-12-03 08:38:12 -08:00
David Ashpole
204be6157f
Fix data race in periodic reader tests (#4731) 2023-11-28 11:12:11 +01:00
Robert Pająk
98b32a6c3a
Release 1.21.0/0.44.0 (#4724) 2023-11-16 21:11:06 +01:00
Robert Pająk
85e4c467da
Release v1.20.0/v0.43.0 (#4705) 2023-11-10 17:42:33 +01:00
Michael Blum
be5064a387
Use url.PathUnescape rather than url.QueryUnescape when parsing OTLP headers and resource attributes env vars (#4698) (#4699) 2023-11-09 12:51:59 -06:00
OpenTelemetry Bot
3560dc5959
dependabot updates Sun Nov 5 15:10:14 UTC 2023 (#4692)
Bump github.com/golangci/golangci-lint from 1.55.1 to 1.55.2 in /internal/tools
Bump golang.org/x/sys from 0.13.0 to 0.14.0 in /sdk
2023-11-05 07:17:26 -08:00
David Ashpole
163573775b
Add summary support in the OpenCensus bridge (#4668)
* support summaries in the OpenCensus bridge

* divide quantiles by 100
2023-11-02 15:07:41 -05:00