1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-11-30 08:46:54 +02:00
Commit Graph

863 Commits

Author SHA1 Message Date
Tyler Yahn
32e3a3d994
Implement the BatchingProcessor configuration (#5088)
* Implement the batching config

* Unify on setting type

* Add setting_test.go

* Test NewBatchingProcessor

* Comment setting

* Fix lint

* Check invalid after envar

---------

Co-authored-by: Sam Xie <sam@samxie.me>
2024-03-25 07:50:19 -07:00
Kevin Burke
8b147470f4
sdk/trace: fix spelling errors (#4996) 2024-03-25 13:10:08 +01:00
Tyler Yahn
a5172ab422
Fix spelling errors in batch.go (#5097) 2024-03-22 08:58:02 -07:00
Sam Xie
b77a5c3968
sdk/log: ObservedTimestamp should be set (#5091)
* Set ObservedTimestamp

* Update sdk/log/logger.go

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

* Reuse value

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-03-22 07:39:01 -07:00
Tyler Yahn
12c5651ec7
Do not alloc multiple noop exporters (#5083) 2024-03-19 10:33:57 -07:00
Sam Xie
77d9192803
Implement logger (#5081)
* Implement logger

* Remove todo comment

* Add tests

* Fix

* Check processors in Enabled method
2024-03-18 16:07:43 -07:00
Tyler Yahn
4580e06de0
Implement the LoggerProvider (#5080) 2024-03-18 06:57:43 +01:00
Tyler Yahn
3542ee68a9
Implement the SimpleProcessor (#5079)
* Implement the SimpleProcessor

* Add BenchmarkSimpleProcessorOnEmit

* Remove stale comment

* Run benchmarks in parallel
2024-03-17 07:47:05 -07:00
Robert Pająk
6fb46a1211
Simplify log design docs (#5077) 2024-03-16 11:06:06 +01:00
Tyler Yahn
3a72c5ea94
Implement the providerConfig (#5074)
* Implement the providerConfig

* Add test for NewLoggerProvider configuration

* Add TestLimitValueFailsOpen

* Fix merge
2024-03-15 10:24:32 -07:00
Tyler Yahn
da047e70ef
Add the Enabled method to the Logger (#5071)
* Add the Enabled method to the Logger

* Add a changelog entry

* Rename enabled.go to min_sev.go

* Remove MinSeverityProcessor

* Document lack of interaction between OnEmit and Enabled

* Update sdk/log/processor.go

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-03-15 08:15:44 -07:00
Tyler Yahn
ca35244789
sdk/log: Implement Record (#5073) 2024-03-14 15:40:48 +01:00
Robert Pająk
54b6ee4174
sdk/log: Scaffolding (#5068) 2024-03-13 17:47:07 +01:00
Robert Pająk
6bc8314a55
[chore] Update open issues in log design docs (#5052) 2024-03-13 09:15:31 +01:00
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