1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2024-12-26 21:05:00 +02:00
Commit Graph

64 Commits

Author SHA1 Message Date
Matthieu MOREL
6edc7a63df
[chore]: enable expected-actual rule from testifylint (#5848)
Testifylint is a linter that provides best practices with the use of
testify.

This PR enables
[expected-actual](https://github.com/Antonboom/testifylint?tab=readme-ov-file#expected-actual)
rule from [testifylint](https://github.com/Antonboom/testifylint)

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2024-09-26 12:04:33 +02:00
Robert Pająk
f710cecfc5
log: Make Record not comparable (#5847)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/5696
2024-09-26 08:32:36 +02:00
David Ashpole
84677a6554
clarify that users should not directly use the log bridge API (#5837)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/5681
2024-09-25 11:58:35 +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
Matthieu MOREL
aef9e4fa2f
[chore]: enable bool-compare rule from testifylint (#5829)
#### Description

Testifylint is a linter that provides best practices with the use of
testify.

This PR enables
[bool-compare](https://github.com/Antonboom/testifylint?tab=readme-ov-file#bool-compare)
rule from [testifylint](https://github.com/Antonboom/testifylint)

It's linter provided by golangci-lint.

Here all available rules are activated except those who require to be
fixed. This PR only fixes bool-compare so the quantity of changes stays
reasonnable for reviewers.

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
2024-09-20 09:39:27 +02:00
Damien Mathieu
a3c512aa95
Fix gosec overflow alerts (#5799)
To allow the golangci-lint upgrade in #5796.

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-09-13 09:11:50 +02:00
Robert Pająk
23f7b41e0a
log: Introduce EnabledParameters (#5791)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/5769

Related spec PR:
https://github.com/open-telemetry/opentelemetry-specification/pull/4203

Remark: A follow-up in contrib is required and afterwards here to fix
the `example/dice`.

Benchstat results for `sdk/log` (`log` has no benchmarks related to
Enabled):

```
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/otel/sdk/log
cpu: Intel(R) Core(TM) i9-10885H CPU @ 2.40GHz
                                  │    old.txt    │               new.txt                │
                                  │    sec/op     │    sec/op     vs base                │
BatchProcessorOnEmit-16              398.8n ± 10%   395.6n ± 12%        ~ (p=0.971 n=10)
Processor/Simple-16                  882.2n ±  8%   869.8n ±  9%        ~ (p=0.811 n=10)
Processor/Batch-16                   1.478µ ±  3%   1.485µ ±  5%        ~ (p=0.646 n=10)
Processor/SetTimestampSimple-16      847.8n ±  1%   844.6n ±  3%        ~ (p=0.247 n=10)
Processor/SetTimestampBatch-16       1.480µ ±  3%   1.473µ ±  4%        ~ (p=0.700 n=10)
Processor/AddAttributesSimple-16     930.0n ±  1%   933.8n ±  1%        ~ (p=0.172 n=10)
Processor/AddAttributesBatch-16      1.624µ ±  2%   1.639µ ±  2%        ~ (p=0.839 n=10)
Processor/SetAttributesSimple-16     903.4n ±  1%   895.1n ±  1%        ~ (p=0.190 n=10)
Processor/SetAttributesBatch-16      1.554µ ±  4%   1.529µ ±  3%        ~ (p=0.159 n=10)
LoggerNewRecord/5_attributes-16      346.0n ±  2%   343.3n ±  2%        ~ (p=0.448 n=10)
LoggerNewRecord/10_attributes-16     1.608µ ±  6%   1.503µ ±  2%   -6.53% (p=0.007 n=10)
LoggerEnabled-16                    34.305n ±  8%   6.706n ±  1%  -80.45% (p=0.000 n=10)
LoggerProviderLogger-16              636.9n ± 10%   605.8n ±  3%        ~ (p=0.105 n=10)
WalkAttributes/1_attributes-16       5.363n ±  3%   4.540n ± 14%  -15.34% (p=0.002 n=10)
WalkAttributes/10_attributes-16      5.436n ±  7%   4.461n ±  2%  -17.95% (p=0.000 n=10)
WalkAttributes/100_attributes-16     5.126n ±  9%   4.465n ±  1%  -12.90% (p=0.000 n=10)
WalkAttributes/1000_attributes-16    5.316n ±  9%   4.502n ±  5%  -15.32% (p=0.002 n=10)
SetAddAttributes/SetAttributes-16    220.5n ± 18%   192.6n ± 11%  -12.67% (p=0.007 n=10)
SetAddAttributes/AddAttributes-16    165.3n ± 21%   127.3n ± 22%  -22.96% (p=0.011 n=10)
SimpleProcessorOnEmit-16             2.159n ±  9%   2.167n ±  9%        ~ (p=0.739 n=10)
geomean                              178.3n         154.5n        -13.31%

                        │    old.txt    │             new.txt             │
                        │      B/s      │      B/s       vs base          │
BatchProcessorOnEmit-16   76.52Mi ± 11%   77.14Mi ± 14%  ~ (p=0.971 n=10)

                                  │    old.txt     │                new.txt                │
                                  │      B/op      │     B/op      vs base                 │
BatchProcessorOnEmit-16               0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
Processor/Simple-16                   417.0 ± 0%       417.0 ± 0%       ~ (p=1.000 n=10) ¹
Processor/Batch-16                  1.093Ki ± 1%     1.088Ki ± 1%       ~ (p=0.254 n=10)
Processor/SetTimestampSimple-16       417.0 ± 0%       417.0 ± 0%       ~ (p=1.000 n=10) ¹
Processor/SetTimestampBatch-16      1.095Ki ± 1%     1.084Ki ± 2%       ~ (p=0.361 n=10)
Processor/AddAttributesSimple-16      417.0 ± 0%       417.0 ± 0%       ~ (p=1.000 n=10) ¹
Processor/AddAttributesBatch-16     1.085Ki ± 1%     1.086Ki ± 1%       ~ (p=1.000 n=10)
Processor/SetAttributesSimple-16      465.0 ± 0%       465.0 ± 0%       ~ (p=1.000 n=10) ¹
Processor/SetAttributesBatch-16     1.129Ki ± 1%     1.125Ki ± 1%       ~ (p=0.084 n=10)
LoggerNewRecord/5_attributes-16       0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
LoggerNewRecord/10_attributes-16      610.0 ± 0%       610.0 ± 0%       ~ (p=1.000 n=10) ¹
LoggerEnabled-16                      0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
LoggerProviderLogger-16               359.0 ± 6%       346.0 ± 3%       ~ (p=0.117 n=10)
WalkAttributes/1_attributes-16        0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
WalkAttributes/10_attributes-16       0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
WalkAttributes/100_attributes-16      0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
WalkAttributes/1000_attributes-16     0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
SetAddAttributes/SetAttributes-16     48.00 ± 0%       48.00 ± 0%       ~ (p=1.000 n=10) ¹
SetAddAttributes/AddAttributes-16     0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
SimpleProcessorOnEmit-16              0.000 ± 0%       0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                          ²                 -0.27%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean

                                  │   old.txt    │               new.txt               │
                                  │  allocs/op   │ allocs/op   vs base                 │
BatchProcessorOnEmit-16             0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
Processor/Simple-16                 1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=10) ¹
Processor/Batch-16                  1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=10) ¹
Processor/SetTimestampSimple-16     1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=10) ¹
Processor/SetTimestampBatch-16      1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=10) ¹
Processor/AddAttributesSimple-16    1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=10) ¹
Processor/AddAttributesBatch-16     1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=10) ¹
Processor/SetAttributesSimple-16    2.000 ± 0%     2.000 ± 0%       ~ (p=1.000 n=10) ¹
Processor/SetAttributesBatch-16     2.000 ± 0%     2.000 ± 0%       ~ (p=1.000 n=10) ¹
LoggerNewRecord/5_attributes-16     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
LoggerNewRecord/10_attributes-16    4.000 ± 0%     4.000 ± 0%       ~ (p=1.000 n=10) ¹
LoggerEnabled-16                    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
LoggerProviderLogger-16             1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=10) ¹
WalkAttributes/1_attributes-16      0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
WalkAttributes/10_attributes-16     0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
WalkAttributes/100_attributes-16    0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
WalkAttributes/1000_attributes-16   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
SetAddAttributes/SetAttributes-16   1.000 ± 0%     1.000 ± 0%       ~ (p=1.000 n=10) ¹
SetAddAttributes/AddAttributes-16   0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
SimpleProcessorOnEmit-16            0.000 ± 0%     0.000 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                        ²               +0.00%                ²
¹ all samples are equal
² summaries must be >0 to compute geomean
```
2024-09-13 06:35:01 +02:00
Sam Xie
ed4fc75758
Release v1.30.0/v0.52.0/v0.6.0/v0.0.9 (#5797)
### Added

- Support `OTEL_EXPORTER_OTLP_LOGS_INSECURE` and
`OTEL_EXPORTER_OTLP_INSECURE` environments in
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. (#5739)
- The `WithResource` option for `NewMeterProvider` now merges the
provided resources with the ones from environment variables. (#5773)
- The `WithResource` option for `NewLoggerProvider` now merges the
provided resources with the ones from environment variables. (#5773)
- Add UTF-8 support to `go.opentelemetry.io/otel/exporters/prometheus`.
(#5755)
### Fixed

- Fix memory leak in the global `MeterProvider` when identical
instruments are repeatedly created. (#5754)
- Fix panic instruments creation when setting meter provider. (#5758)
- Fix panic on instruments creation when setting meter provider. (#5758)
- Fix an issue where `SetMeterProvider` in `go.opentelemetry.io/otel`
might miss the delegation for instruments and registries. (#5780)

### Removed

- Drop support for [Go 1.21](https://go.dev/doc/go1.21). (#5736, #5740,
#5800)
2024-09-10 14:10:56 -07:00
Nathan Baulch
506a9baf5e
Fix typos (#5763) 2024-09-09 08:53:15 +02:00
Sam Xie
172cfb7208
Replace go 1.21 with go 1.22 in go mod (#5740)
Related #5736
2024-08-26 18:50:33 -07:00
Tyler Yahn
6b1d94f21c
Release v1.29.0/v0.51.0/v0.5.0 (#5732)
This release is the last to support [Go 1.21]. The next release will
require at least [Go 1.22].

### Added

- Add MacOS ARM64 platform to the compatibility testing suite. (#5577)
- Add `InstrumentationScope` field to `SpanStub` in
`go.opentelemetry.io/otel/sdk/trace/tracetest`, as a replacement for the
deprecated `InstrumentationLibrary`. (#5627)
- Make the initial release of
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`. This new
module contains an OTLP exporter that transmits log telemetry using
gRPC. This module is unstable and breaking changes may be introduced.
See our [versioning policy](VERSIONING.md) for more information about
these stability guarantees. (#5629)
- Add `Walk` function to `TraceState` in
`go.opentelemetry.io/otel/trace` to iterate all the key-value pairs.
(#5651)
- Bridge the trace state in
`go.opentelemetry.io/otel/bridge/opencensus`. (#5651)
- Zero value of `SimpleProcessor` in `go.opentelemetry.io/otel/sdk/log`
no longer panics. (#5665)
- The `FilterProcessor` interface type is added in
`go.opentelemetry.io/otel/sdk/log/internal/x`. This is an optional and
experimental interface that log `Processor`s can implement to instruct
the `Logger` if a `Record` will be processed or not. It replaces the
existing `Enabled` method that is removed from the `Processor` interface
itself. It does not fall within the scope of the OpenTelemetry Go
versioning and stability [policy](./VERSIONING.md) and it may be changed
in backwards incompatible ways or removed in feature releases. (#5692)
- Support [Go 1.23]. (#5720)

### Changed

- `NewMemberRaw`, `NewKeyProperty` and `NewKeyValuePropertyRaw` in
`go.opentelemetry.io/otel/baggage` allow UTF-8 string in key. (#5132)
- `Processor.OnEmit` in `go.opentelemetry.io/otel/sdk/log` now accepts a
pointer to `Record` instead of a value so that the record modifications
done in a processor are propagated to subsequent registered processors.
(#5636)
- `SimpleProcessor.Enabled` in `go.opentelemetry.io/otel/sdk/log` now
returns `false` if the exporter is `nil`. (#5665)
- Update the concurrency requirements of `Exporter` in
`go.opentelemetry.io/otel/sdk/log`. (#5666)
- `SimpleProcessor` in `go.opentelemetry.io/otel/sdk/log` synchronizes
`OnEmit` calls. (#5666)
- The `Processor` interface in `go.opentelemetry.io/otel/sdk/log` no
longer includes the `Enabled` method. See the `FilterProcessor`
interface type added in `go.opentelemetry.io/otel/sdk/log/internal/x` to
continue providing this functionality. (#5692)
- The `SimpleProcessor` type in `go.opentelemetry.io/otel/sdk/log` is no
longer comparable. (#5693)
- The `BatchProcessor` type in `go.opentelemetry.io/otel/sdk/log` is no
longer comparable. (#5693)

### Fixed

- Correct comments for the priority of the `WithEndpoint` and
`WithEndpointURL` options and their corresponding environment variables
in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`.
(#5584)
- Pass the underlying error rather than a generic retry-able failure in
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`,
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` and
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`.
(#5541)
- Correct the `Tracer`, `Meter`, and `Logger` names used in
`go.opentelemetry.io/otel/example/dice`. (#5612)
- Correct the `Tracer` names used in
`go.opentelemetry.io/otel/example/namedtracer`. (#5612)
- Correct the `Tracer` name used in
`go.opentelemetry.io/otel/example/opencensus`. (#5612)
- Correct the `Tracer` and `Meter` names used in
`go.opentelemetry.io/otel/example/otel-collector`. (#5612)
- Correct the `Tracer` names used in
`go.opentelemetry.io/otel/example/passthrough`. (#5612)
- Correct the `Meter` name used in
`go.opentelemetry.io/otel/example/prometheus`. (#5612)
- Correct the `Tracer` names used in
`go.opentelemetry.io/otel/example/zipkin`. (#5612)
- Correct comments for the priority of the `WithEndpoint` and
`WithEndpointURL` options and their corresponding environment variables
in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`
and `go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`.
(#5641)
- Correct comments for the priority of the `WithEndpoint` and
`WithEndpointURL` options and their corresponding environment variables
in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`.
(#5650)
- Stop percent encoding header environment variables in
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`,
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`,
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`
(#5705)
- Remove invalid environment variable header keys in
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`,
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`,
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc` and
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`
(#5705)

### Removed

- The `Enabled` method of the `SimpleProcessor` in
`go.opentelemetry.io/otel/sdk/log` is removed. (#5692)
- The `Enabled` method of the `BatchProcessor` in
`go.opentelemetry.io/otel/sdk/log` is removed. (#5692)

[Go 1.23]: https://go.dev/doc/go1.23
[Go 1.22]: https://go.dev/doc/go1.22
[Go 1.21]: https://go.dev/doc/go1.21
2024-08-23 13:13:40 -07:00
renovate[bot]
4875735fd8
fix(deps): update module github.com/golangci/golangci-lint to v1.60.2 (#5711)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[github.com/golangci/golangci-lint](https://togithub.com/golangci/golangci-lint)
| `v1.60.1` -> `v1.60.2` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgolangci%2fgolangci-lint/v1.60.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgolangci%2fgolangci-lint/v1.60.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgolangci%2fgolangci-lint/v1.60.1/v1.60.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgolangci%2fgolangci-lint/v1.60.1/v1.60.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>golangci/golangci-lint
(github.com/golangci/golangci-lint)</summary>

###
[`v1.60.2`](https://togithub.com/golangci/golangci-lint/compare/v1.60.1...v1.60.2)

[Compare
Source](https://togithub.com/golangci/golangci-lint/compare/v1.60.1...v1.60.2)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View the
[repository job
log](https://developer.mend.io/github/open-telemetry/opentelemetry-go).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4yNi4xIiwidXBkYXRlZEluVmVyIjoiMzguMjYuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiU2tpcCBDaGFuZ2Vsb2ciLCJkZXBlbmRlbmNpZXMiXX0=-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
2024-08-23 08:07:25 -07:00
Sam Xie
5b2ce02911
Stabilize benchmark result of BenchmarkValueEqual (#5717)
`BenchmarkValueEqual` does not run the target code with `b.N`, as
https://pkg.go.dev/testing#hdr-Benchmarks states. Thus, it cannot
produce a stable benchmark result. And, it would fail the benchmark:
https://github.com/open-telemetry/opentelemetry-go/actions/runs/10412186663.
This PR fixes this issue.

Here is the result of `benchstat`

```
goos: darwin
goarch: arm64
pkg: go.opentelemetry.io/otel/log
                       │       old.txt        │                      new.txt                       │
                       │        sec/op        │       sec/op        vs base                        │
ValueEqual/2_with_1-10   0.0000002000n ± 100%   3.1450000000n ± 1%  +1572499900.00% (p=0.000 n=10)

                       │  old.txt   │            new.txt             │
                       │    B/op    │    B/op     vs base            │
ValueEqual/2_with_1-10   0.000 ± 0%   0.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

                       │  old.txt   │            new.txt             │
                       │ allocs/op  │ allocs/op   vs base            │
ValueEqual/2_with_1-10   0.000 ± 0%   0.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal
```
2024-08-16 09:33:36 -07:00
Robert Pająk
e2b0751cd1
[chore] Add asasalint linter (#5653)
Add https://golangci-lint.run/usage/linters/#asasalint linter.

Fix the bugs detected by the linter.

PR in Contrib:
https://github.com/open-telemetry/opentelemetry-go-contrib/pull/5957
2024-07-31 08:41:11 +02:00
Tyler Yahn
776ceb7cc9
Document Logger name and version recommendations (#5613)
Part of #5412

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-07-12 20:28:43 +02:00
Robert Pająk
1384c27ad0
log: Add missing notice to Bytes, Slice, Map doc comment (#5598)
Add comment which is already in `BytesValue`, `SliceValue`, `MapValue`.

Maybe it would help mitigating issues like
https://github.com/open-telemetry/opentelemetry-go-contrib/issues/5879.
2024-07-11 06:39:08 +02:00
Tyler Yahn
81216fb002
Releases v1.28.0/v0.50.0/v0.4.0 (#5569)
### Added

- The `IsEmpty` method is added to the `Instrument` type in
`go.opentelemetry.io/otel/sdk/metric`.
This method is used to check if an `Instrument` instance is a
zero-value. (#5431)
- Store and provide the emitted `context.Context` in `ScopeRecords` of
`go.opentelemetry.io/otel/sdk/log/logtest`. (#5468)
- The `go.opentelemetry.io/otel/semconv/v1.26.0` package.
The package contains semantic conventions from the `v1.26.0` version of
the OpenTelemetry Semantic Conventions. (#5476)
- The `AssertRecordEqual` method to
`go.opentelemetry.io/otel/log/logtest` to allow comparison of two log
records in tests. (#5499)
- The `WithHeaders` option to
`go.opentelemetry.io/otel/exporters/zipkin` to allow configuring custom
http headers while exporting spans. (#5530)

### Changed

- `Tracer.Start` in `go.opentelemetry.io/otel/trace/noop` no longer
allocates a span for empty span context. (#5457)
- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to
`go.opentelemetry.io/otel/semconv/v1.26.0` in
`go.opentelemetry.io/otel/example/otel-collector`. (#5490)
- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to
`go.opentelemetry.io/otel/semconv/v1.26.0` in
`go.opentelemetry.io/otel/example/zipkin`. (#5490)
- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to
`go.opentelemetry.io/otel/semconv/v1.26.0` in
`go.opentelemetry.io/otel/exporters/zipkin`. (#5490)
- The exporter no longer exports the deprecated "otel.library.name" or
"otel.library.version" attributes.
- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to
`go.opentelemetry.io/otel/semconv/v1.26.0` in
`go.opentelemetry.io/otel/sdk/resource`. (#5490)
- Upgrade `go.opentelemetry.io/otel/semconv/v1.25.0` to
`go.opentelemetry.io/otel/semconv/v1.26.0` in
`go.opentelemetry.io/otel/sdk/trace`. (#5490)
- `SimpleProcessor.OnEmit` in `go.opentelemetry.io/otel/sdk/log` no
longer allocates a slice which makes it possible to have a
zero-allocation log processing using `SimpleProcessor`. (#5493)
- Use non-generic functions in the `Start` method of
`"go.opentelemetry.io/otel/sdk/trace".Trace` to reduce memory
allocation. (#5497)
- `service.instance.id` is populated for a `Resource` created with
`"go.opentelemetry.io/otel/sdk/resource".Default` with a default value
when `OTEL_GO_X_RESOURCE` is set. (#5520)
- Improve performance of metric instruments in
`go.opentelemetry.io/otel/sdk/metric` by removing unnecessary calls to
`time.Now`. (#5545)

### Fixed

- Log a warning to the OpenTelemetry internal logger when a `Record` in
`go.opentelemetry.io/otel/sdk/log` drops an attribute due to a limit
being reached. (#5376)
- Identify the `Tracer` returned from the global `TracerProvider` in
`go.opentelemetry.io/otel/global` with its schema URL. (#5426)
- Identify the `Meter` returned from the global `MeterProvider` in
`go.opentelemetry.io/otel/global` with its schema URL. (#5426)
- Log a warning to the OpenTelemetry internal logger when a `Span` in
`go.opentelemetry.io/otel/sdk/trace` drops an attribute, event, or link
due to a limit being reached. (#5434)
- Document instrument name requirements in
`go.opentelemetry.io/otel/metric`. (#5435)
- Prevent random number generation data-race for experimental rand
exemplars in `go.opentelemetry.io/otel/sdk/metric`. (#5456)
- Fix counting number of dropped attributes of `Record` in
`go.opentelemetry.io/otel/sdk/log`. (#5464)
- Fix panic in baggage creation when a member contains `0x80` char in
key or value. (#5494)
- Correct comments for the priority of the `WithEndpoint` and
`WithEndpointURL` options and their corresponding environment variables
in `go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`.
(#5508)
- Retry trace and span ID generation if it generated an invalid one in
`go.opentelemetry.io/otel/sdk/trace`. (#5514)
- Fix stale timestamps reported by the last-value aggregation. (#5517)
- Indicate the `Exporter` in
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp` must be
created by the `New` method. (#5521)
- Improved performance in all `{Bool,Int64,Float64,String}SliceValue`
functions of `go.opentelemetry.io/attributes` by reducing the number of
allocations. (#5549)
2024-07-02 13:29:45 -07:00
Damien Mathieu
f6a5aa2c3f
Add unparam linter (#5531)
This adds the [unparam](https://github.com/mvdan/unparam) linter.

Co-authored-by: Sam Xie <sam@samxie.me>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-06-21 16:02:07 -07:00
Damien Mathieu
5331939a74
Introduce logtest.AssertRecordEqual (#5499)
This is a follow-up to the comments in
https://github.com/open-telemetry/opentelemetry-go/pull/5468#discussion_r1624173196,
introducing `logtest.AssertRecordEqual` so bridges can compare log
records more easily.

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-06-12 11:35:11 -07:00
Damien Mathieu
a2505aa68c
log/logtest: provide record with their context (#5468)
So the instrumentation tests can check the provided context.
See https://github.com/open-telemetry/opentelemetry-go-contrib/pull/5707

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Sam Xie <sam@samxie.me>
2024-06-06 08:28:28 -07:00
renovate[bot]
7c5e64cccc
chore(deps): update dependency codespell to v2.3.0 (#5409)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-05-24 18:09:31 +02:00
renovate[bot]
8ea894949f
fix(deps): update module github.com/go-logr/logr to v1.4.2 (#5393)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/go-logr/logr](https://togithub.com/go-logr/logr) |
`v1.4.1` -> `v1.4.2` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fgo-logr%2flogr/v1.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fgo-logr%2flogr/v1.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fgo-logr%2flogr/v1.4.1/v1.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fgo-logr%2flogr/v1.4.1/v1.4.2?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>go-logr/logr (github.com/go-logr/logr)</summary>

### [`v1.4.2`](https://togithub.com/go-logr/logr/releases/tag/v1.4.2)

[Compare
Source](https://togithub.com/go-logr/logr/compare/v1.4.1...v1.4.2)

#### What's Changed

- Fix lint: named but unused params by
[@&#8203;thockin](https://togithub.com/thockin) in
[https://github.com/go-logr/logr/pull/268](https://togithub.com/go-logr/logr/pull/268)
- Add a Go report card, fix lint by
[@&#8203;thockin](https://togithub.com/thockin) in
[https://github.com/go-logr/logr/pull/271](https://togithub.com/go-logr/logr/pull/271)
- funcr: Handle nested empty groups properly by
[@&#8203;thockin](https://togithub.com/thockin) in
[https://github.com/go-logr/logr/pull/274](https://togithub.com/go-logr/logr/pull/274)

##### Dependencies:

- build(deps): bump github/codeql-action from 3.22.11 to 3.22.12 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/254](https://togithub.com/go-logr/logr/pull/254)
- build(deps): bump github/codeql-action from 3.22.12 to 3.23.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/256](https://togithub.com/go-logr/logr/pull/256)
- build(deps): bump actions/upload-artifact from 4.0.0 to 4.1.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/257](https://togithub.com/go-logr/logr/pull/257)
- build(deps): bump github/codeql-action from 3.23.0 to 3.23.1 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/259](https://togithub.com/go-logr/logr/pull/259)
- build(deps): bump actions/upload-artifact from 4.1.0 to 4.2.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/260](https://togithub.com/go-logr/logr/pull/260)
- build(deps): bump actions/upload-artifact from 4.2.0 to 4.3.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/263](https://togithub.com/go-logr/logr/pull/263)
- build(deps): bump github/codeql-action from 3.23.1 to 3.23.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/262](https://togithub.com/go-logr/logr/pull/262)
- build(deps): bump github/codeql-action from 3.23.2 to 3.24.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/264](https://togithub.com/go-logr/logr/pull/264)
- build(deps): bump actions/upload-artifact from 4.3.0 to 4.3.1 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/266](https://togithub.com/go-logr/logr/pull/266)
- build(deps): bump golangci/golangci-lint-action from 3.7.0 to 4.0.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/267](https://togithub.com/go-logr/logr/pull/267)
- build(deps): bump github/codeql-action from 3.24.0 to 3.24.3 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/270](https://togithub.com/go-logr/logr/pull/270)
- build(deps): bump github/codeql-action from 3.24.3 to 3.24.5 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/272](https://togithub.com/go-logr/logr/pull/272)
- build(deps): bump github/codeql-action from 3.24.5 to 3.24.6 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/275](https://togithub.com/go-logr/logr/pull/275)
- build(deps): bump actions/checkout from 4.1.1 to 4.1.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/276](https://togithub.com/go-logr/logr/pull/276)
- build(deps): bump github/codeql-action from 3.24.6 to 3.24.7 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/277](https://togithub.com/go-logr/logr/pull/277)
- build(deps): bump github/codeql-action from 3.24.7 to 3.24.9 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/278](https://togithub.com/go-logr/logr/pull/278)
- build(deps): bump github/codeql-action from 3.24.9 to 3.24.10 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/279](https://togithub.com/go-logr/logr/pull/279)
- build(deps): bump actions/upload-artifact from 4.3.1 to 4.3.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/280](https://togithub.com/go-logr/logr/pull/280)
- build(deps): bump actions/checkout from 4.1.2 to 4.1.3 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/281](https://togithub.com/go-logr/logr/pull/281)
- build(deps): bump github/codeql-action from 3.24.10 to 3.25.1 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/282](https://togithub.com/go-logr/logr/pull/282)
- build(deps): bump github/codeql-action from 3.25.1 to 3.25.3 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/283](https://togithub.com/go-logr/logr/pull/283)
- build(deps): bump golangci/golangci-lint-action from 4.0.0 to 5.0.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/284](https://togithub.com/go-logr/logr/pull/284)
- build(deps): bump actions/checkout from 4.1.3 to 4.1.4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/285](https://togithub.com/go-logr/logr/pull/285)
- build(deps): bump actions/upload-artifact from 4.3.2 to 4.3.3 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/286](https://togithub.com/go-logr/logr/pull/286)
- build(deps): bump actions/setup-go from 5.0.0 to 5.0.1 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/288](https://togithub.com/go-logr/logr/pull/288)
- build(deps): bump golangci/golangci-lint-action from 5.0.0 to 5.3.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/289](https://togithub.com/go-logr/logr/pull/289)
- build(deps): bump golangci/golangci-lint-action from 5.3.0 to 6.0.1 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/293](https://togithub.com/go-logr/logr/pull/293)
- build(deps): bump github/codeql-action from 3.25.3 to 3.25.4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/292](https://togithub.com/go-logr/logr/pull/292)
- build(deps): bump actions/checkout from 4.1.4 to 4.1.5 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/291](https://togithub.com/go-logr/logr/pull/291)
- build(deps): bump ossf/scorecard-action from 2.3.1 to 2.3.3 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/290](https://togithub.com/go-logr/logr/pull/290)
- build(deps): bump github/codeql-action from 3.25.4 to 3.25.5 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/294](https://togithub.com/go-logr/logr/pull/294)
- build(deps): bump actions/checkout from 4.1.5 to 4.1.6 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/go-logr/logr/pull/295](https://togithub.com/go-logr/logr/pull/295)

**Full Changelog**:
https://github.com/go-logr/logr/compare/v1.4.1...v1.4.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/open-telemetry/opentelemetry-go).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4zNjguMTAiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbIlNraXAgQ2hhbmdlbG9nIiwiZGVwZW5kZW5jaWVzIl19-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-05-21 13:58:14 -07:00
Tyler Yahn
5661ff0ded
Release v1.27.0/v0.49.0/v0.3.0 (#5392)
This release includes the first beta release of the OpenTelemetry Logs
Bridge API and SDK for Go.

### Added

- Add example for `go.opentelemetry.io/otel/exporters/stdout/stdoutlog`.
(#5242)
- Add `RecordFactory` in `go.opentelemetry.io/otel/sdk/log/logtest` to
facilitate testing exporter and processor implementations. (#5258)
- Add `RecordFactory` in `go.opentelemetry.io/otel/log/logtest` to
facilitate testing bridge implementations. (#5263)
- The count of dropped records from the `BatchProcessor` in
`go.opentelemetry.io/otel/sdk/log` is logged. (#5276)
- Add metrics in the `otel-collector` example. (#5283)
- Add the synchronous gauge instrument to
`go.opentelemetry.io/otel/metric`. (#5304)
- An `int64` or `float64` synchronous gauge instrument can now be
created from a `Meter`.
- All implementations of the API
(`go.opentelemetry.io/otel/metric/noop`,
`go.opentelemetry.io/otel/sdk/metric`) are updated to support this
instrument.
- Add logs to `go.opentelemetry.io/otel/example/dice`. (#5349)

### Changed

- The `Shutdown` method of `Exporter` in
`go.opentelemetry.io/otel/exporters/stdout/stdouttrace` ignores the
context cancellation and always returns `nil`. (#5189)
- The `ForceFlush` and `Shutdown` methods of the exporter returned by
`New` in `go.opentelemetry.io/otel/exporters/stdout/stdoutmetric` ignore
the context cancellation and always return `nil`. (#5189)
- Apply the value length limits to `Record` attributes in
`go.opentelemetry.io/otel/sdk/log`. (#5230)
- De-duplicate map attributes added to a `Record` in
`go.opentelemetry.io/otel/sdk/log`. (#5230)
- `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` won't print
timestamps when `WithoutTimestamps` option is set. (#5241)
- The `go.opentelemetry.io/otel/exporters/stdout/stdoutlog` exporter
won't print `AttributeValueLengthLimit` and `AttributeCountLimit` fields
now, instead it prints the `DroppedAttributes` field. (#5272)
- Improved performance in the `Stringer` implementation of
`go.opentelemetry.io/otel/baggage.Member` by reducing the number of
allocations. (#5286)
- Set the start time for last-value aggregates in
`go.opentelemetry.io/otel/sdk/metric`. (#5305)
- The `Span` in `go.opentelemetry.io/otel/sdk/trace` will record links
without span context if either non-empty `TraceState` or attributes are
provided. (#5315)
- Upgrade all dependencies of `go.opentelemetry.io/otel/semconv/v1.24.0`
to `go.opentelemetry.io/otel/semconv/v1.25.0`. (#5374)

### Fixed

- Comparison of unordered maps for
`go.opentelemetry.io/otel/log.KeyValue` and
`go.opentelemetry.io/otel/log.Value`. (#5306)
- Fix the empty output of `go.opentelemetry.io/otel/log.Value` in
`go.opentelemetry.io/otel/exporters/stdout/stdoutlog`. (#5311)
- Split the behavior of `Recorder` in
`go.opentelemetry.io/otel/log/logtest` so it behaves as a
`LoggerProvider` only. (#5365)
- Fix wrong package name of the error message when parsing endpoint URL
in `go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`.
(#5371)
- Identify the `Logger` returned from the global `LoggerProvider` in
`go.opentelemetry.io/otel/log/global` with its schema URL. (#5375)
2024-05-21 10:59:36 -07:00
Tyler Yahn
14441aefdf
Identify logger with schemaURL in global logger provider (#5375)
Fix #5366
2024-05-18 11:00:00 +02:00
Damien Mathieu
ebd0adee35
Split log/logtest into a recorder and a logger (#5365)
The current logtest.Recorder implementation is wrong. We have a single
`Recorder`, which acts as both a `LoggerProvider`, and a `Logger`,
making it possible to emit a log entry with the root recorder, which
shouldn't be possible with the API.

This change introduces a new private struct, `logger` that acts as the
recording logger, while `Recorder` becomes only a LoggerProvider and not
a Logger anymore.

Closes #5357.

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-05-17 07:28:40 -07:00
Robert Pająk
166b3473dd
[chore] Fix wrong type in DESIGN.md (#5368) 2024-05-16 13:56:22 +02:00
Yijie Ma
bf06b80a77
[chore] Fix 2 places in log design doc (#5364) 2024-05-16 09:02:37 +02:00
Damien Mathieu
08c8b3224a
log: Fix comparison of unordered map values (#5306) 2024-05-15 12:28:23 +02:00
Damien Mathieu
f33d40886d
log/logtest: add Record Factory (#5263) 2024-04-25 07:22:39 +02:00
Sam Xie
9656d0afa7
Release 1.26.0/0.48.0/0.2.0-alpha (#5260)
* Bump versions in versions.yaml

* Prepare stable-v1 for version v1.26.0

* Prepare experimental-metrics for version v0.48.0

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

* Prepare experimental-schema for version v0.0.9

* Update CHANGELOG

* Unbump experimental-schema

* 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>
2024-04-24 07:27:22 -07:00
Damien Mathieu
8d1d62b905
logtest: Add Recorder (#5134)
* introduce in-memory log exporter

* add changelog entry

* move logtest into a recorder within the api

* rename GetRecords to Result

* rename InMemoryRecorder to Recorder

* name the struct r

* ensure Logger creates a struct copy

* replace severity with enabledFn

* Update CHANGELOG.md

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

* kUpdate log/logtest/config.go

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

* store all scope records, so we can retrieve everything with `Result()`

* store child loggers instead of all scope records

* no need to explicitly create a new slice

* add concurrent safe test

* handle default enabled function if the struct was manually created

* rename WithEnabledFn to WithEnabledFunc

* test result/reset with child loggers

* add enabled to concurrent safe

* fix lint missing period

* rename defaultEnabledFn to defaultEnabledFunc

* merge recorder.go and config.go

* Update log/logtest/recorder_test.go

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

* create empty recorder in concurrent safe test

* Update log/logtest/recorder_test.go

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

* fix lint

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* Update log/logtest/recorder.go

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

* make enabledFunc callable from outside the package

* replace expected with want

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Sam Xie <sam@samxie.me>
2024-04-09 06:45:25 -07:00
Tyler Yahn
66284071de
Release v1.25.0/v0.47.0/v0.0.8/v0.1.0-alpha (#5154)
* Bump versions in versions.yaml

* Prepare stable-v1 for version v1.25.0

* Prepare experimental-metrics for version v0.47.0

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

* Prepare experimental-schema for version v0.0.8

* Update changelog

* Run go mod tidy

* Update CHANGELOG.md

---------

Co-authored-by: Damien Mathieu <damien.mathieu@elastic.co>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-04-05 07:34:02 -07:00
Robert Pająk
e6e44dee90
log: Add String method to Value and KeyValue (#5117) 2024-04-02 10:50:07 +02:00
Robert Pająk
068b6c87c4
[chore] Remove open issues for design docs (#5112) 2024-03-27 18:34:31 +01:00
Damien Mathieu
edb788bf49
Add READMEs to every package (#5103) 2024-03-26 20:13:54 +01:00
Tyler Yahn
335f4de960
Add global log package (#5085)
* Add the log/global package

* Implement the stubbed features

* Add ConcurrentSafe tests

* Restructure with internal implementation

* Add internal global state

* Use internal state in log/global

* Add TestDelegation

* Fix lint

* Clean log_test.go

* Clean up

* Add changelog entry

* Simplify TestMultipleGlobalLoggerProvider

* Shorten log.go

* Fix comment text wrapping

* Shorten state_test.go

* Don't pollute output in TestSetLoggerProvider
2024-03-19 11:28:11 -07:00
Robert Pająk
6fb46a1211
Simplify log design docs (#5077) 2024-03-16 11:06:06 +01: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
Sam Xie
47ac0d4df8
logs: Add empty value for KeyValue (#5076)
* Add empty value for KeyValue

* Update CHANGELOG

* Apply suggestions from code review

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>

* Fix comments

* Update log/keyvalue.go

Co-authored-by: Damien Mathieu <42@dmathieu.com>

---------

Co-authored-by: Robert Pająk <pellared@hotmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Damien Mathieu <42@dmathieu.com>
2024-03-15 07:52:24 -07:00
Tyler Yahn
42c1708ed5
Add SeverityUndefined to otel/log (#5072)
* Add SeverityUndefined

* Add changelog entry

---------

Co-authored-by: Sam Xie <sam@samxie.me>
2024-03-14 13:22:12 -07:00
Robert Pająk
6bc8314a55
[chore] Update open issues in log design docs (#5052) 2024-03-13 09:15:31 +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
Robert Pająk
1d1ecbc5f9
[chore] log: Remove resolved issue from DESIGN.md (#4984) 2024-02-27 19:51:23 +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
08c38ab6f5
Add links to published packages (#4970) 2024-02-25 07:39:05 -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
Tyler Yahn
8df89f6aff
log: Remove Value.AsAny (#4963) 2024-02-22 20:56:07 +01:00
Tyler Yahn
7cc660fc0f
log: Add allocation tests (#4957) 2024-02-22 20:47:40 +01:00