Flc゛
80cb909774
refactor: replace context.Background() with t.Context()/b.Context() in tests ( #7352 )
...
Based on the Go version we currently use, the dependency already
supports 1.24+, which allows using `t.Context()` and `b.Context()` in
unit tests and benchmarks respectively.
- Enable `context-background` and `context-todo` in
[`usetesting`](https://golangci-lint.run/docs/linters/configuration/#usetesting )
- Adjust the code to support linter detection
---------
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
Co-authored-by: Tyler Yahn <codingalias@gmail.com >
Co-authored-by: Damien Mathieu <42@dmathieu.com >
2025-09-23 09:52:45 +02:00
Matthieu MOREL
68841fa6db
chore: enable unused-receiver rule from revive ( #7130 )
...
#### Description
Enable and fixes
[unused-receiver](https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unused-receiver )
rule from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com >
2025-08-08 15:38:22 -07:00
Matthieu MOREL
d464abf1f3
chore: enable unused-parameter rule from revive ( #7122 )
...
#### Description
Enable and fixes
[unused-parameter](https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#unused-parameter )
rule from revive
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com >
2025-08-04 12:48:04 -07:00
Tyler Yahn
7512a2be2e
Add the golines golangci-lint formatter ( #6513 )
...
Ensure consistent line wrapping (<= 120 characters) within the project.
2025-03-30 03:46:44 -07:00
Robert Pająk
ee56fb97e0
Make scope attributes as identifying for Meter ( #5926 )
...
Towards https://github.com/open-telemetry/opentelemetry-go/issues/3368
2024-10-30 06:29:32 +01:00
Jesse Bank
1333b2f73a
Fix delegation for global MeterProviders ( #5828 )
...
Fixes #5827
Fixes #5852
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com >
Co-authored-by: David Ashpole <dashpole@google.com >
Co-authored-by: Damien Mathieu <42@dmathieu.com >
2024-10-04 10:19:41 +02:00
Matthieu MOREL
063239fa37
[chore]: enable len and empty rules from testifylint ( #5832 )
...
#### Description
Testifylint is a linter that provides best practices with the use of
testify.
This PR enables
[empty](https://github.com/Antonboom/testifylint?tab=readme-ov-file#empty )
and
[len](https://github.com/Antonboom/testifylint?tab=readme-ov-file#len )
rules from [testifylint](https://github.com/Antonboom/testifylint )
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com >
2024-09-21 08:04:28 -07:00
Nathan Baulch
506a9baf5e
Fix typos ( #5763 )
2024-09-09 08:53:15 +02:00
Sam Xie
b37e8a9860
SetMeterProvider might miss the delegation for instruments and registries (#5780 )
...
Closes #5757
This PR fixes an issue where `SetMeterProvider` might miss the
delegation for instruments and registries. This bug brings a concurrent
issue that could possibly make instruments and registries unable to
operate correctly, such as recording, after using the `SetMeterProvider`
method. The data put on these instruments and registries might be lost.
2024-09-06 16:42:55 -07:00
David Ashpole
e47618fc36
Fix duplicate instrumentation memory leak ( #5754 )
...
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/5753
The added test fails on main, but passes after the fix.
---------
Co-authored-by: Sam Xie <sam@samxie.me >
2024-08-29 10:30:20 -07:00
Tyler Yahn
525fedbb26
Identify global Tracers and Meters with their schema URLs ( #5426 )
...
Fix #5403
2024-05-30 07:20:05 -07:00
Tyler Yahn
dafe137bbe
Add the synchronous gauge to the metric API and SDK ( #5304 )
...
Resolve #5225
The specification has [added a synchronous gauge
instrument](https://github.com/open-telemetry/opentelemetry-specification/pull/3540 ).
That instrument has now been
[stabilized](https://github.com/open-telemetry/opentelemetry-specification/pull/4019 ),
and that stabilization is included in the [next
release](https://github.com/open-telemetry/opentelemetry-specification/pull/4034 ).
This adds the new synchronous gauge instrument to the metric API and all
implementation we publish.
This change will be a breaking change for any SDK developer. The
`embedded` package is updated to ensure our compatibility guarantees are
meet.
---------
Co-authored-by: David Ashpole <dashpole@google.com >
2024-05-16 09:56:40 -07:00
Tyler Yahn
0fce441edb
Rename sync inst names ( #5303 )
2024-05-08 08:10:41 -07:00
Robert Pająk
7dea232a46
[chore] Simplify the license header ( #4987 )
2024-02-29 07:05:28 +01:00
ntriamme
f793a0575d
Fix registration of multiple callbacks when using the global meter provider ( #4945 )
2024-02-21 08:36:33 +01:00
Robert Pająk
fd5284f75c
styleguide: tests goroutine leaks and naming ( #4348 )
...
* internal/global: Fix goroutine leaks in tests
2023-07-24 09:35:06 +02:00
Tyler Yahn
17903bcdb6
Revert "Move global metric back to otel/metric/global for minor release ( #3986 )" ( #4039 )
...
* Revert "Move global metric back to `otel/metric/global` for minor release (#3986 )"
This reverts commit 8dba38e02f .
* Add changes to changelog
* Fix versions and go mod tidy
* Run go-mod-tidy
2023-05-02 11:15:39 -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
Tyler Yahn
63a0f51c2d
Move metric No-Op to metric/noop ( #3941 )
...
* Revert "Revert "Move metric No-Op to metric/noop (#3893 )" (#3921 )"
This reverts commit 795ad97119 .
* Add PR number
* Move example_test back to `otel/metric`
* Update CHANGELOG.md
Co-authored-by: Robert Pająk <pellared@hotmail.com >
* Remove redundant panic tests
* Update noop pkg docs
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com >
2023-03-29 08:05:07 -07:00
Tyler Yahn
795ad97119
Revert "Move metric No-Op to metric/noop ( #3893 )" ( #3921 )
...
* Revert "Move metric No-Op to `metric/noop` (#3893 )"
This reverts commit 3c75a44f84 .
* Persist removal of NewNoopMeter
2023-03-22 14:41:28 -07:00
Tyler Yahn
3c75a44f84
Move metric No-Op to metric/noop ( #3893 )
...
* Move metric No-Op to noop pkg
* Remove the unneeded embedded ifaces
* Update CHANGELOG.md
Co-authored-by: Peter Liu <lpfvip2008@gmail.com >
---------
Co-authored-by: Peter Liu <lpfvip2008@gmail.com >
Co-authored-by: Aaron Clawson <3766680+MadVikingGod@users.noreply.github.com >
2023-03-21 14:25:23 -05: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
Anthony Mirabella
7728a52135
Remove dependency on metrics packages ( #1988 )
...
* Declare internal/metric module to version it separately
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com >
* Remove dependency on metrics module from soon-to-be-stable modules
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com >
* Add PR ID to CHANGELOG
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com >
* rename metric/oteltest to metric/metrictest
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com >
* Fix metrictest package name in CHANGELOG
Signed-off-by: Anthony J Mirabella <a9@aneurysm9.com >
2021-06-10 15:05:25 -04:00
Punya Biswal
ecf65d7968
Rename otel/label -> otel/attribute ( #1541 )
...
* Rename otel/label -> otel/attr
Leave the imported name alone, to avoid a large diff and conflicts
* Better import comment
* Update CHANGELOG.md
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
* otel/attr -> otel/attribute
* Missed the changelog entry
* Get rid of import renaming
* Merge remaining conflicts
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
Co-authored-by: Anthony Mirabella <a9@aneurysm9.com >
2021-02-18 12:59:37 -05:00
Punya Biswal
9b242bc401
Organize API into Go modules based on stability and dependencies ( #1528 )
...
* Add a tool to auto-generate replace directives
* Auto-generated changes from previous commit
* Create new modules required for trace release
* otel/metric
* otel/trace
* otel/oteltest
* otel/sdk/export/metric
* otel/sdk/metric
Relates to #1467
* Move metric-related public API out of otel/ pkg
Move GetMeterProvider, Meter and SetMeterProvider to new package
otel/metric/global in the otel/metric module.
This will allow otel/ module to be released as v1.0.
* Include PR references in CHANGELOG
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
* Check for root dir
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
2021-02-12 08:23:51 -08:00
Krzesimir Nowak
3d6e8b5078
Move Version function and code from global to toplevel ( #1330 )
...
* Move global code to toplevel package
* Move version function to toplevel package
* Update changelog
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
2020-11-16 09:30:54 -08:00