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
982391315f
chore: enable gocritic linter ( #7095 )
...
#### Description
Enable and fixes several rules from
[gocritic](https://golangci-lint.run/usage/linters/#gocritic ) linter
---------
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com >
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
2025-07-29 09:20:32 -07:00
James Moessis
f410084b21
propagation: extract of multiple header values ( #5973 )
...
* Add `ValuesGetter` interface, an optional `TextMapCarrier` feature
that adds `Values(string) []string`.
* `HeaderCarrier` implements `ValuesGetter`.
* Change `Baggage` to use the `Values()` method if it's implemented.
Notable comment:
https://github.com/open-telemetry/opentelemetry-go/pull/5973#discussion_r2074894706
Adds tests extracting requests with multiple 'baggage' headers set.
Does not introduce any breaking changes or alter any existing tests.
Spec issue:
https://github.com/open-telemetry/opentelemetry-specification/issues/433
Corresponding Java prototype:
https://github.com/open-telemetry/opentelemetry-java/pull/6852
---------
Co-authored-by: Robert Pająk <pellared@hotmail.com >
Co-authored-by: dmathieu <42@dmathieu.com >
2025-05-15 09:14:35 +02:00
Matthieu MOREL
e98ef1bfdb
[chore]: enable usestdlibvars linter ( #6001 )
...
#### Description
[usestdlibvars](https://golangci-lint.run/usage/linters/#usestdlibvars )
is a linter that detect the possibility to use variables/constants from
the Go standard library.
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com >
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
2024-11-25 12:02:46 -08:00
Robert Pająk
7dea232a46
[chore] Simplify the license header ( #4987 )
2024-02-29 07:05:28 +01:00
Robert Pająk
259143a662
baggage: Add NewMemberRaw and NewKeyValuePropertyRaw ( #4804 )
2024-01-10 14:02:57 +01:00
Robert Pająk
885210bf33
baggage: Fix escaping in Member.String ( #4756 )
...
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
2023-12-21 09:16:13 +01:00
Robert Pająk
43bd47de6e
baggage: Fix Parse to validate member value before percent-decoding ( #4755 )
2023-12-19 14:38:58 +01:00
ReStartercc
0963f59955
Fix baggage.NewMember to decode the accepted value ( #3226 )
...
* Fix baggage.NewMember to decode the accepted value
`value` is decoded and stored after validating the input parameters.
Corresponding test cases are modified so that we can make sure `value` is properly encoded before creating Member.
* fix md lint
* add function document to NewMember for value encoding and decoding
* remove redundant comments and fix CHANGELOG.md
* fix wrong PR number in the changelog
* fix wrong PR number
* fix md-lint
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com >
2022-10-18 12:45:04 -07:00
Aaron Clawson
5f41868675
Un-escape url coding when parsing baggage. ( #2529 )
...
* un-escape url coding when parsing baggage.
* Added changelog
Co-authored-by: Aaron Clawson <MadVikingGod@users.noreply.github.com >
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
2022-01-24 09:17:45 -08:00
Tyler Yahn
4bf6150fa9
Add baggage implementation based on the W3C and OpenTelemetry specification ( #1967 )
...
* Rename baggage context file
* Initial baggage implementation
* Initial tests
* More tests
* Update baggage context functionality
* Add New method to baggage pkg
* Update namedtracer example
* URL encode baggage values
* Refactor and use internal baggage pkg
* Update OpenTracing bridge
* Update baggage propagator
* Fix lint and test errors
* Add changes to changelog
* Apply suggestions from code review
* Rename testcase field per suggestion
* Update test to verify last-one-wins semantics
* Explicitly seed random numbers with static seed in tests
* Parse Member key/value with string split
* Add test for member parse with equal signs in value
* Trim whitespaces for member key/value
2021-06-08 08:06:37 -07: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
3bce9c97f8
Add Keys() method to propagation.TextMapCarrier ( #1544 )
...
...and propagation.HeaderCarrier to adapt http.Header to this interface.
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
2021-02-17 08:04:49 -08:00
Daniil Rutskiy
7de3b58ce9
Remove extra labels types ( #1314 )
...
* Remove extra labels types
Remove the following labels types: INT32, UINT32, UINT64
and FLOAT32.
Fix all extra labels types occurrences in the project.
Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com >
* Update CHANGELOG.md
Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com >
* Delete unused helpers
Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com >
* Convert passed values into remaining types
Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com >
* Clarify func description
* Fix uint64 convertion
Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com >
* Fix uint conversion
Signed-off-by: Daniil Rutskiy <dstdfx@gmail.com >
* Update OTLP exporter label types
Co-authored-by: Tyler Yahn <codingalias@gmail.com >
2021-02-16 16:23:58 -08:00
Krzesimir Nowak
63a11144cf
Move baggage and propagation to separate packages ( #1325 )
...
* Move propagation code to propagation package
* Move baggage code to baggage package
* Update changelog
* Make docs of baggage.Set more clear
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com >
2020-11-13 07:34:24 -08:00