1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-01-10 00:29:12 +02:00
Commit Graph

2726 Commits

Author SHA1 Message Date
Sam Xie
5cd7807389
Implement otlploggrpc gRPC client (#5572)
part of https://github.com/open-telemetry/opentelemetry-go/issues/5056

For full usage of this client, check
https://github.com/open-telemetry/opentelemetry-go/pull/5522

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
2024-07-03 21:50:02 -07:00
renovate[bot]
bcb7d42b3f
fix(deps): update module go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp to v0.53.0 (#5574)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp](https://togithub.com/open-telemetry/opentelemetry-go-contrib)
| `v0.52.0` -> `v0.53.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/go.opentelemetry.io%2fcontrib%2finstrumentation%2fnet%2fhttp%2fotelhttp/v0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/go.opentelemetry.io%2fcontrib%2finstrumentation%2fnet%2fhttp%2fotelhttp/v0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/go.opentelemetry.io%2fcontrib%2finstrumentation%2fnet%2fhttp%2fotelhttp/v0.52.0/v0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/go.opentelemetry.io%2fcontrib%2finstrumentation%2fnet%2fhttp%2fotelhttp/v0.52.0/v0.53.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### 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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuOSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-03 10:15:01 -07:00
renovate[bot]
7e5e90576c
fix(deps): update module go.opentelemetry.io/contrib/bridges/otelslog to v0.3.0 (#5573)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[go.opentelemetry.io/contrib/bridges/otelslog](https://togithub.com/open-telemetry/opentelemetry-go-contrib)
| `v0.2.0` -> `v0.3.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/go.opentelemetry.io%2fcontrib%2fbridges%2fotelslog/v0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/go.opentelemetry.io%2fcontrib%2fbridges%2fotelslog/v0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/go.opentelemetry.io%2fcontrib%2fbridges%2fotelslog/v0.2.0/v0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/go.opentelemetry.io%2fcontrib%2fbridges%2fotelslog/v0.2.0/v0.3.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### 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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuOSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-03 09:57:58 -07:00
renovate[bot]
b394515def
fix(deps): update module go.opentelemetry.io/otel/sdk/log to v0.4.0 (#5571)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[go.opentelemetry.io/otel/sdk/log](https://togithub.com/open-telemetry/opentelemetry-go)
| `v0.3.0` -> `v0.4.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/go.opentelemetry.io%2fotel%2fsdk%2flog/v0.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/go.opentelemetry.io%2fotel%2fsdk%2flog/v0.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/go.opentelemetry.io%2fotel%2fsdk%2flog/v0.3.0/v0.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/go.opentelemetry.io%2fotel%2fsdk%2flog/v0.3.0/v0.4.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>open-telemetry/opentelemetry-go
(go.opentelemetry.io/otel/sdk/log)</summary>

###
[`v0.4.0`](https://togithub.com/open-telemetry/opentelemetry-go/releases/tag/v0.4.0)

[Compare
Source](https://togithub.com/open-telemetry/opentelemetry-go/compare/v0.3.0...v0.4.0)

##### Added

- New API package `api/metric/registry` that exposes a `MeterImpl`
wrapper for use by SDKs to generate unique instruments.
([#&#8203;580](https://togithub.com/open-telemetry/opentelemetry-go/issues/580))
- Script to verify examples after a new release.
([#&#8203;579](https://togithub.com/open-telemetry/opentelemetry-go/issues/579))

##### Removed

-   The dogstatsd exporter due to lack of support.
This additionally removes support for statsd.
([#&#8203;591](https://togithub.com/open-telemetry/opentelemetry-go/issues/591))
-   `LabelSet` from the metric API.
This is replaced by a `[]core.KeyValue` slice.
([#&#8203;595](https://togithub.com/open-telemetry/opentelemetry-go/issues/595))
- `Labels` from the metric API's `Meter` interface.
([#&#8203;595](https://togithub.com/open-telemetry/opentelemetry-go/issues/595))

##### Changed

- The metric `export.Labels` became an interface which the SDK
implements and the `export` package provides a simple, immutable
implementation of this interface intended for testing purposes.
([#&#8203;574](https://togithub.com/open-telemetry/opentelemetry-go/issues/574))
- Renamed `internal/metric.Meter` to `MeterImpl`.
([#&#8203;580](https://togithub.com/open-telemetry/opentelemetry-go/issues/580))
- Renamed `api/global/internal.obsImpl` to `asyncImpl`.
([#&#8203;580](https://togithub.com/open-telemetry/opentelemetry-go/issues/580))

##### Fixed

- Corrected missing return in mock span.
([#&#8203;582](https://togithub.com/open-telemetry/opentelemetry-go/issues/582))
- Update License header for all source files to match CNCF guidelines
and include a test to ensure it is present.
([#&#8203;586](https://togithub.com/open-telemetry/opentelemetry-go/issues/586))
([#&#8203;596](https://togithub.com/open-telemetry/opentelemetry-go/issues/596))
- Update to v0.3.0 of the OTLP in the OTLP exporter.
([#&#8203;588](https://togithub.com/open-telemetry/opentelemetry-go/issues/588))
- Update pre-release script to be compatible between GNU and BSD based
systems.
([#&#8203;592](https://togithub.com/open-telemetry/opentelemetry-go/issues/592))
- Add a `RecordBatch` benchmark.
([#&#8203;594](https://togithub.com/open-telemetry/opentelemetry-go/issues/594))
- Moved span transforms of the OTLP exporter to the internal package.
([#&#8203;593](https://togithub.com/open-telemetry/opentelemetry-go/issues/593))
- Build both go-1.13 and go-1.14 in circleci to test for all supported
versions of Go.
([#&#8203;569](https://togithub.com/open-telemetry/opentelemetry-go/issues/569))
- Removed unneeded allocation on empty labels in OLTP exporter.
([#&#8203;597](https://togithub.com/open-telemetry/opentelemetry-go/issues/597))
- Update `BatchedSpanProcessor` to process the queue until no data but
respect max batch size.
([#&#8203;599](https://togithub.com/open-telemetry/opentelemetry-go/issues/599))
- Update project documentation godoc.org links to pkg.go.dev.
([#&#8203;602](https://togithub.com/open-telemetry/opentelemetry-go/issues/602))

##### Changes since v0.3.0


[`f474c34`](f474c349ae)
Script to verify example after new release.
([#&#8203;579](https://togithub.com/open-telemetry/opentelemetry-go/issues/579))

[`5d346a4`](5d346a4190)
update godoc.org links to pkg.go.dev
([#&#8203;602](https://togithub.com/open-telemetry/opentelemetry-go/issues/602))

[`1e8e72b`](1e8e72b530)
Process the queue until no data but respect max batch size
([#&#8203;599](https://togithub.com/open-telemetry/opentelemetry-go/issues/599))

[`e8546e3`](e8546e3bc5)
Remove Labelset
([#&#8203;595](https://togithub.com/open-telemetry/opentelemetry-go/issues/595))

[`e7a9ba1`](e7a9ba1e2e)
Remove unneeded allocation on empty labels
([#&#8203;597](https://togithub.com/open-telemetry/opentelemetry-go/issues/597))

[`e458809`](e458809c41)
Build both go-1.13 and go-1.14 in circleci
([#&#8203;569](https://togithub.com/open-telemetry/opentelemetry-go/issues/569))

[`c97b4f7`](c97b4f726c)
Update project License headers and checking
([#&#8203;596](https://togithub.com/open-telemetry/opentelemetry-go/issues/596))

[`c9dcc1b`](c9dcc1be28)
Move span transforms of the OTLP exporter to internal
([#&#8203;593](https://togithub.com/open-telemetry/opentelemetry-go/issues/593))

[`cfe74cf`](cfe74cf91f)
Add a RecordBatch benchmark
([#&#8203;594](https://togithub.com/open-telemetry/opentelemetry-go/issues/594))

[`4c69dd3`](4c69dd3234)
Remove dogstatsd and statsd support
([#&#8203;591](https://togithub.com/open-telemetry/opentelemetry-go/issues/591))

[`06f833e`](06f833e2ae)
Unique instrument checking
([#&#8203;580](https://togithub.com/open-telemetry/opentelemetry-go/issues/580))

[`dff6265`](dff6265dc5)
Pre-release script fixes
([#&#8203;592](https://togithub.com/open-telemetry/opentelemetry-go/issues/592))

[`d648712`](d648712cf2)
Kick label encoder out of sdk
([#&#8203;574](https://togithub.com/open-telemetry/opentelemetry-go/issues/574))

[`6f881b4`](6f881b4400)
update to proto v0.3.0
([#&#8203;588](https://togithub.com/open-telemetry/opentelemetry-go/issues/588))

[`a485d0e`](a485d0ec64)
Update License header for all source files
([#&#8203;586](https://togithub.com/open-telemetry/opentelemetry-go/issues/586))

[`c16f56e`](c16f56ee61)
Fix missing return in mock span
([#&#8203;582](https://togithub.com/open-telemetry/opentelemetry-go/issues/582))

</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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuOSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Damien Mathieu <damien.mathieu@elastic.co>
2024-07-03 11:34:55 +02:00
renovate[bot]
c508b77058
fix(deps): update module google.golang.org/grpc to v1.65.0 (#5568)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [google.golang.org/grpc](https://togithub.com/grpc/grpc-go) |
`v1.64.0` -> `v1.65.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/google.golang.org%2fgrpc/v1.65.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/google.golang.org%2fgrpc/v1.65.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/google.golang.org%2fgrpc/v1.64.0/v1.65.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/google.golang.org%2fgrpc/v1.64.0/v1.65.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>grpc/grpc-go (google.golang.org/grpc)</summary>

### [`v1.65.0`](https://togithub.com/grpc/grpc-go/releases/tag/v1.65.0):
Release 1.65.0

[Compare
Source](https://togithub.com/grpc/grpc-go/compare/v1.64.0...v1.65.0)

### Dependencies

- Change support policy to cover only the latest TWO releases of Go,
matching the policy for Go itself. See
[#&#8203;7249](https://togithub.com/grpc/grpc-go/issues/7249) for more
information.
([#&#8203;7250](https://togithub.com/grpc/grpc-go/issues/7250))
- Update x/net/http2 to address
[CVE-2023-45288](https://nvd.nist.gov/vuln/detail/CVE-2023-45288)
([#&#8203;7282](https://togithub.com/grpc/grpc-go/issues/7282))

### Behavior Changes

- credentials/tls: clients and servers will now reject connections that
don't support ALPN when environment variable `GRPC_ENFORCE_ALPN_ENABLED`
is set to "true" (case insensitive).
([#&#8203;7184](https://togithub.com/grpc/grpc-go/issues/7184))
    -   NOTE: this behavior will become the default in a future release.
- metadata: remove String method from MD to make printing more
consistent
([#&#8203;7373](https://togithub.com/grpc/grpc-go/issues/7373))

### New Features

- grpc: add `WithMaxCallAttempts` to configure gRPC's retry behavior
per-channel.
([#&#8203;7229](https://togithub.com/grpc/grpc-go/issues/7229))
- Special Thanks: [@&#8203;imoore76](https://togithub.com/imoore76)

### Bug Fixes

- ringhash: properly apply endpoint weights instead of ignoring them
([#&#8203;7156](https://togithub.com/grpc/grpc-go/issues/7156))
- xds: fix a bug that could cause xds-enabled servers to stop accepting
new connections after handshaking errors
([#&#8203;7128](https://togithub.com/grpc/grpc-go/issues/7128))
    -   Special Thanks: [@&#8203;bozaro](https://togithub.com/bozaro)

</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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuOSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Damien Mathieu <damien.mathieu@elastic.co>
2024-07-03 11:12:15 +02:00
Tyler Yahn
83b7bd0b36
Upgrade Go versions in CI (#5570)
Address https://pkg.go.dev/vuln/GO-2024-2963 which is blocking things:
https://github.com/open-telemetry/opentelemetry-go-contrib/actions/runs/9767710483/job/26963575194?pr=5838
2024-07-03 08:07:07 +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
Tyler Yahn
8279a1a12e
Add @XSAM and @dmathieu as repository maintainers (#5558)
After off-line discussions, the existing maintainers have all agreed
that the contributions made by both @XSAM and @dmathieu motivate adding
them as maintainers to the project. Both @XSAM and @dmathieu have
confimed they are interested in the position and willing to accept the
responsibilities.

### TODO

- [ ] Add @XSAM to maintainers group
- [ ] Add @dmathieu to maintainers group
- [ ] Copy the substance of this PR into the contrib repository

Co-authored-by: Sam Xie <sam@samxie.me>
2024-07-02 10:46:43 -07:00
renovate[bot]
cff1a2509a
chore(deps): update otel/opentelemetry-collector-contrib docker tag to v0.104.0 (#5565)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[otel/opentelemetry-collector-contrib](https://togithub.com/open-telemetry/opentelemetry-collector-releases)
| minor | `0.103.1` -> `0.104.0` |

---

### Release Notes

<details>
<summary>open-telemetry/opentelemetry-collector-releases
(otel/opentelemetry-collector-contrib)</summary>

###
[`v0.104.0`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.104.0)

[Compare
Source](https://togithub.com/open-telemetry/opentelemetry-collector-releases/compare/v0.103.1...v0.104.0)

Check the [v0.104.0 contrib
changelog](https://togithub.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.104.0)
and the [v0.104.0 core
changelog](https://togithub.com/open-telemetry/opentelemetry-collector/releases/tag/v0.104.0)
for changelogs on specific components.

#### Changelog

-
[`ee2830f`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/commit/ee2830f)
Update version to 0.104.0
([#&#8203;587](https://togithub.com/open-telemetry/opentelemetry-collector-releases/issues/587))
-
[`3cc7340`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/commit/3cc7340)
Add rabbitmq exporter to otelcol-contrib release
([#&#8203;581](https://togithub.com/open-telemetry/opentelemetry-collector-releases/issues/581))

</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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-02 10:20:07 -07:00
David Ashpole
0485de287e
Move time.Now call into exemplar reservoir to improve performance (#5545)
Part of addressing
https://github.com/open-telemetry/opentelemetry-go/issues/5542.

### Motivation

This removes the `time.Now()` call from filtered-out Exemplars by only
invoking `time.Now()` after the filtering decision is made. This
improvement is especially noticeable for measurements without any
attributes.

```
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/otel/sdk/metric
cpu: AMD EPYC 7B12
                                                                 │   old.txt    │                new.txt                │
                                                                 │    sec/op    │   sec/op     vs base                  │
SyncMeasure/NoView/Int64Counter/Attributes/0-24                    158.20n ± 4%   99.83n ± 1%  -36.90% (p=0.000 n=10)
SyncMeasure/NoView/Int64Counter/Attributes/1-24                     333.3n ± 4%   274.8n ± 1%  -17.55% (p=0.000 n=10)
SyncMeasure/NoView/Int64Counter/Attributes/10-24                    1.640µ ± 1%   1.600µ ± 1%   -2.41% (p=0.000 n=10)
SyncMeasure/NoView/Float64Counter/Attributes/0-24                   159.0n ± 3%   101.3n ± 0%  -36.27% (p=0.000 n=10)
SyncMeasure/NoView/Float64Counter/Attributes/1-24                   340.0n ± 2%   272.0n ± 1%  -20.00% (p=0.000 n=10)
SyncMeasure/NoView/Float64Counter/Attributes/10-24                  1.661µ ± 1%   1.597µ ± 0%   -3.85% (p=0.000 n=10)
SyncMeasure/NoView/Int64UpDownCounter/Attributes/0-24               159.8n ± 1%   103.1n ± 0%  -35.50% (p=0.000 n=10)
SyncMeasure/NoView/Int64UpDownCounter/Attributes/1-24               339.5n ± 1%   273.1n ± 0%  -19.57% (p=0.000 n=10)
SyncMeasure/NoView/Int64UpDownCounter/Attributes/10-24              1.656µ ± 0%   1.589µ ± 0%   -4.05% (p=0.000 n=10)
SyncMeasure/NoView/Float64UpDownCounter/Attributes/0-24             159.3n ± 2%   100.8n ± 0%  -36.74% (p=0.000 n=10)
SyncMeasure/NoView/Float64UpDownCounter/Attributes/1-24             337.9n ± 2%   271.8n ± 1%  -19.55% (p=0.000 n=10)
SyncMeasure/NoView/Float64UpDownCounter/Attributes/10-24            1.657µ ± 0%   1.593µ ± 1%   -3.83% (p=0.000 n=10)
SyncMeasure/NoView/Int64Histogram/Attributes/0-24                  144.65n ± 4%   89.38n ± 0%  -38.21% (p=0.000 n=10)
SyncMeasure/NoView/Int64Histogram/Attributes/1-24                   235.7n ± 2%   183.5n ± 0%  -22.15% (p=0.000 n=10)
SyncMeasure/NoView/Int64Histogram/Attributes/10-24                  900.8n ± 1%   836.8n ± 0%   -7.10% (p=0.000 n=10)
SyncMeasure/NoView/Float64Histogram/Attributes/0-24                145.60n ± 5%   93.48n ± 1%  -35.80% (p=0.000 n=10)
SyncMeasure/NoView/Float64Histogram/Attributes/1-24                 240.9n ± 1%   183.0n ± 0%  -24.06% (p=0.000 n=10)
SyncMeasure/NoView/Float64Histogram/Attributes/10-24                905.6n ± 1%   826.3n ± 0%   -8.76% (p=0.000 n=10)
SyncMeasure/DropView/Int64Counter/Attributes/0-24                   20.33n ± 0%   20.35n ± 0%        ~ (p=0.302 n=10)
SyncMeasure/DropView/Int64Counter/Attributes/1-24                   26.46n ± 0%   26.45n ± 1%        ~ (p=0.868 n=10)
SyncMeasure/DropView/Int64Counter/Attributes/10-24                  26.50n ± 0%   26.47n ± 0%        ~ (p=0.208 n=10)
SyncMeasure/DropView/Float64Counter/Attributes/0-24                 20.34n ± 1%   20.27n ± 0%   -0.34% (p=0.009 n=10)
SyncMeasure/DropView/Float64Counter/Attributes/1-24                 26.55n ± 0%   26.60n ± 1%        ~ (p=0.109 n=10)
SyncMeasure/DropView/Float64Counter/Attributes/10-24                26.59n ± 1%   26.57n ± 1%        ~ (p=0.926 n=10)
SyncMeasure/DropView/Int64UpDownCounter/Attributes/0-24             20.38n ± 1%   20.38n ± 0%        ~ (p=0.725 n=10)
SyncMeasure/DropView/Int64UpDownCounter/Attributes/1-24             26.39n ± 0%   26.44n ± 0%        ~ (p=0.238 n=10)
SyncMeasure/DropView/Int64UpDownCounter/Attributes/10-24            26.52n ± 0%   26.42n ± 0%   -0.36% (p=0.049 n=10)
SyncMeasure/DropView/Float64UpDownCounter/Attributes/0-24           20.30n ± 0%   20.25n ± 0%        ~ (p=0.196 n=10)
SyncMeasure/DropView/Float64UpDownCounter/Attributes/1-24           26.57n ± 0%   26.54n ± 1%        ~ (p=0.540 n=10)
SyncMeasure/DropView/Float64UpDownCounter/Attributes/10-24          26.57n ± 0%   26.51n ± 1%        ~ (p=0.643 n=10)
SyncMeasure/DropView/Int64Histogram/Attributes/0-24                 20.37n ± 0%   20.36n ± 1%        ~ (p=1.000 n=10)
SyncMeasure/DropView/Int64Histogram/Attributes/1-24                 26.41n ± 0%   26.50n ± 0%   +0.32% (p=0.007 n=10)
SyncMeasure/DropView/Int64Histogram/Attributes/10-24                26.44n ± 0%   26.55n ± 1%   +0.42% (p=0.012 n=10)
SyncMeasure/DropView/Float64Histogram/Attributes/0-24               20.30n ± 0%   20.45n ± 0%   +0.74% (p=0.000 n=10)
SyncMeasure/DropView/Float64Histogram/Attributes/1-24               26.52n ± 0%   26.48n ± 0%        ~ (p=0.127 n=10)
SyncMeasure/DropView/Float64Histogram/Attributes/10-24              26.55n ± 0%   26.48n ± 0%   -0.26% (p=0.002 n=10)
SyncMeasure/AttrFilterView/Int64Counter/Attributes/0-24             170.5n ± 2%   110.8n ± 0%  -35.03% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Int64Counter/Attributes/1-24             402.5n ± 1%   331.5n ± 1%  -17.64% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Int64Counter/Attributes/10-24            1.363µ ± 1%   1.281µ ± 1%   -6.02% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Float64Counter/Attributes/0-24           170.6n ± 1%   111.5n ± 1%  -34.64% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Float64Counter/Attributes/1-24           397.1n ± 1%   335.9n ± 0%  -15.41% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Float64Counter/Attributes/10-24          1.371µ ± 1%   1.279µ ± 1%   -6.71% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Int64UpDownCounter/Attributes/0-24       170.1n ± 1%   112.2n ± 0%  -34.09% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Int64UpDownCounter/Attributes/1-24       397.5n ± 1%   330.2n ± 0%  -16.93% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Int64UpDownCounter/Attributes/10-24      1.371µ ± 1%   1.289µ ± 1%   -5.95% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Float64UpDownCounter/Attributes/0-24     171.4n ± 2%   112.9n ± 0%  -34.13% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Float64UpDownCounter/Attributes/1-24     397.0n ± 3%   336.4n ± 0%  -15.24% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Float64UpDownCounter/Attributes/10-24    1.383µ ± 1%   1.305µ ± 1%   -5.61% (p=0.000 n=10)
SyncMeasure/AttrFilterView/Int64Histogram/Attributes/0-24          157.30n ± 2%   98.58n ± 1%  -37.33% (p=0.000 n=6+10)
```

### Changes

* Introduce `exemplar.Filter`, which is a filter function based on the
context. It will not be user-facing, so we can always add other
parameters later if needed.
* Introduce `exemplar.FilteredReservoir`, which is similar to a
reservoir, except it does not receive a timestamp. It gets the current
time after the filter decision has been made. It uses generics to avoid
the call to exemplar.NewValue(), since it is internal-only.
* The `exemplar.Reservoir` is left as-is, so that it can be made public
when exemplars are stable. It still includes a timestamp argument.
* Unit tests are updated to expect a much lower number of calls to
time.Now
* `exemplar.Drop` is now an `exemplar.FilteredReservoir` instead of a
`Reservoir`, since we don't need a Reservoir to store things in if the
measurement is always dropped.

Co-authored-by: Sam Xie <sam@samxie.me>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-07-01 09:36:11 -07:00
renovate[bot]
1cefb17de7
chore(deps): update google.golang.org/genproto/googleapis/rpc digest to f6361c8 (#5564)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[google.golang.org/genproto/googleapis/rpc](https://togithub.com/googleapis/go-genproto)
| indirect | digest | `dc46fd2` -> `f6361c8` |
|
[google.golang.org/genproto/googleapis/rpc](https://togithub.com/googleapis/go-genproto)
| require | digest | `dc46fd2` -> `f6361c8` |

---

### 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-01 09:15:17 -07:00
renovate[bot]
874f2a2a39
chore(deps): update google.golang.org/genproto/googleapis/api digest to f6361c8 (#5563)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[google.golang.org/genproto/googleapis/api](https://togithub.com/googleapis/go-genproto)
| indirect | digest | `dc46fd2` -> `f6361c8` |

---

### 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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-01 08:44:26 -07:00
Robert Pająk
b477e34939
sdk/log: Add filtering Processor example (#5543)
Towards https://github.com/open-telemetry/opentelemetry-go/issues/5065
2024-07-01 15:49:12 +02:00
Robert Pająk
d7e5001b4d
sdk/log: Fix ExampleProcessor_redact to clone the record (#5559)
Towards https://github.com/open-telemetry/opentelemetry-go/issues/5065

Follow our own docs. From `Processor.Enabled` docs:

> Before modifying a Record, the implementation must use Record.Clone to
create a copy that shares no state with the original.
2024-07-01 15:01:22 +02:00
Damien Mathieu
4987a1dd4b
Split the span start/end benchmarks and test start with links and attributes (#5554)
I was looking at the trace benchmarks, and noticed this one, which says
it tests "span start", but ending the span is included within the data.
So this change removes ending the span from the computation, and adds a
new benchmark which only computes span end.

benchstat for span start:

```
pkg: go.opentelemetry.io/otel/sdk/trace
              │ bench-main  │            bench-branch            │
              │   sec/op    │   sec/op     vs base               │
TraceStart-10   725.6n ± 3%   667.2n ± 2%  -8.04% (p=0.000 n=10)

              │ bench-main │          bench-branch          │
              │    B/op    │    B/op     vs base            │
TraceStart-10   704.0 ± 0%   704.0 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

              │ bench-main │          bench-branch          │
              │ allocs/op  │ allocs/op   vs base            │
TraceStart-10   14.00 ± 0%   14.00 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal
```

Benchmark for span end:
```
BenchmarkSpanEnd-10     16486819               147.7 ns/op             0 B/op          0 allocs/op
```
2024-06-28 11:51:09 +02:00
Sam Xie
82fe9aa1e3
Generate internal/transform in otlploggrpc (#5553)
Part of #5056

It abstracts the `transform` package from `otlploghttp` and makes it a
shared template. Then, it generates the abstracted `transform` package
into `otlploggrpc`.

For full usage of this transform package, check
https://github.com/open-telemetry/opentelemetry-go/pull/5522
2024-06-28 10:15:35 +02:00
Fabrice Vaillant
f3a2d96022
Reduces allocation in attributes (#5549)
Remove one allocation in all SliceValue function (going from 3 to 2).

Here is benchstat results

```
goos: linux
goarch: amd64
pkg: go.opentelemetry.io/otel/internal/attribute
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
                    │   old.txt    │               new.txt                │
                    │    sec/op    │    sec/op     vs base                │
BoolSliceValue-8      128.4n ± 22%   103.8n ± 25%  -19.12% (p=0.007 n=10)
Int64SliceValue-8     167.9n ±  7%   130.8n ±  5%  -22.13% (p=0.000 n=10)
Float64SliceValue-8   133.8n ± 14%   122.6n ±  4%   -8.33% (p=0.000 n=10)
StringSliceValue-8    166.4n ±  9%   158.5n ± 10%   -4.75% (p=0.037 n=10)
geomean               148.0n         127.5n        -13.88%

                    │   old.txt   │              new.txt               │
                    │    B/op     │    B/op     vs base                │
BoolSliceValue-8      32.000 ± 0%   8.000 ± 0%  -75.00% (p=0.000 n=10)
Int64SliceValue-8      88.00 ± 0%   64.00 ± 0%  -27.27% (p=0.000 n=10)
Float64SliceValue-8    88.00 ± 0%   64.00 ± 0%  -27.27% (p=0.000 n=10)
StringSliceValue-8     152.0 ± 0%   128.0 ± 0%  -15.79% (p=0.000 n=10)
geomean                78.34        45.25       -42.23%

                    │  old.txt   │              new.txt               │
                    │ allocs/op  │ allocs/op   vs base                │
BoolSliceValue-8      3.000 ± 0%   2.000 ± 0%  -33.33% (p=0.000 n=10)
Int64SliceValue-8     3.000 ± 0%   2.000 ± 0%  -33.33% (p=0.000 n=10)
Float64SliceValue-8   3.000 ± 0%   2.000 ± 0%  -33.33% (p=0.000 n=10)
StringSliceValue-8    3.000 ± 0%   2.000 ± 0%  -33.33% (p=0.000 n=10)
geomean               3.000        2.000       -33.33%
```
2024-06-27 10:27:48 -07:00
renovate[bot]
1d783e14f7
chore(deps): update jaegertracing/all-in-one docker tag to v1.58 (#5556)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| jaegertracing/all-in-one | minor | `1.54` -> `1.58` |

---

### 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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjAuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-27 08:03:51 -07:00
renovate[bot]
4794143527
chore(deps): update jaegertracing/all-in-one docker tag to v1.54 (#5555)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| jaegertracing/all-in-one | patch | `1.58` -> `1.54` |

---

### 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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjAuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-27 07:49:41 -07:00
Damien Mathieu
acb2471488
Add benchmark retrieving a new logger (#5548)
This adds a benchmark to create a logger from a logger provider.

Related: #5054.

```
BenchmarkLoggerProviderLogger-10                         3145390               548.8 ns/op           330 B/op          1 allocs/op
```
2024-06-27 13:39:58 +02:00
Damien Mathieu
12f0db5215
Add walk attributes benchmark (#5547)
This adds a benchmark for `record.WalkAttributes`.

Part of #5054.

```
BenchmarkWalkAttributes/1_attributes-10                 346989372                3.449 ns/op           0 B/op          0 allocs/op
BenchmarkWalkAttributes/10_attributes-10                345712522                3.459 ns/op           0 B/op          0 allocs/op
BenchmarkWalkAttributes/100_attributes-10               349380534                3.455 ns/op           0 B/op          0 allocs/op
BenchmarkWalkAttributes/1000_attributes-10              342041373                3.484 ns/op           0 B/op          0 allocs/op
```
2024-06-27 13:29:38 +02:00
Damien Mathieu
649484ef38
Split the set and add attributes benchmarks (#5546)
This benchmark currently tests two rather different methods within the
same loop, which makes it hard to see what could be causing a
performance degradation.

Related: #5054.

```
BenchmarkSetAddAttributes/SetAttributes-10              14066331                82.80 ns/op           48 B/op          1 allocs/op
BenchmarkSetAddAttributes/AddAttributes-10              19333711               114.7 ns/op             0 B/op          0 allocs/op
```
2024-06-27 13:17:09 +02:00
Robert Pająk
cda5094cdd
sdk/log: Add altering Processor example (#5550)
Towards https://github.com/open-telemetry/opentelemetry-go/issues/5065

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-06-27 11:55:29 +02:00
Sam Xie
418f19d341
Indicate the otlploghttp exporter must be created by the New method (#5521)
The empty Exporter would cause panics.
2024-06-27 11:41:05 +02:00
renovate[bot]
0b1e0b25aa
chore(deps): update module github.com/prometheus/common to v0.55.0 (#5552)
[![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/prometheus/common](https://togithub.com/prometheus/common)
| `v0.54.0` -> `v0.55.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fprometheus%2fcommon/v0.55.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fprometheus%2fcommon/v0.55.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fprometheus%2fcommon/v0.54.0/v0.55.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fprometheus%2fcommon/v0.54.0/v0.55.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>prometheus/common (github.com/prometheus/common)</summary>

###
[`v0.55.0`](https://togithub.com/prometheus/common/releases/tag/v0.55.0)

[Compare
Source](https://togithub.com/prometheus/common/compare/v0.54.0...v0.55.0)

#### What's Changed

- Update Go modules by [@&#8203;SuperQ](https://togithub.com/SuperQ) in
[https://github.com/prometheus/common/pull/643](https://togithub.com/prometheus/common/pull/643)
- enable errcheck linter by
[@&#8203;mmorel-35](https://togithub.com/mmorel-35) in
[https://github.com/prometheus/common/pull/637](https://togithub.com/prometheus/common/pull/637)
- Add a `RELEASE.md` and add
[@&#8203;gotjosh](https://togithub.com/gotjosh) as a mantainer by
[@&#8203;gotjosh](https://togithub.com/gotjosh) in
[https://github.com/prometheus/common/pull/644](https://togithub.com/prometheus/common/pull/644)
- Move goautoneg to external dependency by
[@&#8203;mikelolasagasti](https://togithub.com/mikelolasagasti) in
[https://github.com/prometheus/common/pull/625](https://togithub.com/prometheus/common/pull/625)
- Expose secret as SecretReader and InlineSecret from config package by
[@&#8203;pracucci](https://togithub.com/pracucci) in
[https://github.com/prometheus/common/pull/650](https://togithub.com/prometheus/common/pull/650)
- Fix HTTPClientConfig JSON marshalling by
[@&#8203;pracucci](https://togithub.com/pracucci) in
[https://github.com/prometheus/common/pull/651](https://togithub.com/prometheus/common/pull/651)
- Expose secret as FileSecret from config package by
[@&#8203;alanprot](https://togithub.com/alanprot) in
[https://github.com/prometheus/common/pull/653](https://togithub.com/prometheus/common/pull/653)
- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[https://github.com/prometheus/common/pull/646](https://togithub.com/prometheus/common/pull/646)
- Set http_headers to be omit empty by
[@&#8203;yeya24](https://togithub.com/yeya24) in
[https://github.com/prometheus/common/pull/655](https://togithub.com/prometheus/common/pull/655)
- chore: add HumanizeTimestamp; make ConvertToFloat exportable by
[@&#8203;freak12techno](https://togithub.com/freak12techno) in
[https://github.com/prometheus/common/pull/654](https://togithub.com/prometheus/common/pull/654)
- Bump github.com/aws/aws-sdk-go from 1.53.14 to 1.54.7 in /sigv4 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/prometheus/common/pull/659](https://togithub.com/prometheus/common/pull/659)
- Bump golang.org/x/oauth2 from 0.20.0 to 0.21.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/prometheus/common/pull/656](https://togithub.com/prometheus/common/pull/656)
- Bump google.golang.org/protobuf from 1.34.1 to 1.34.2 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/prometheus/common/pull/658](https://togithub.com/prometheus/common/pull/658)
- Bump golang.org/x/net from 0.25.0 to 0.26.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/prometheus/common/pull/657](https://togithub.com/prometheus/common/pull/657)
- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[https://github.com/prometheus/common/pull/660](https://togithub.com/prometheus/common/pull/660)
- Add SigV4 FIPS STS endpoint config by
[@&#8203;rajagopalanand](https://togithub.com/rajagopalanand) in
[https://github.com/prometheus/common/pull/649](https://togithub.com/prometheus/common/pull/649)

#### New Contributors

- [@&#8203;gotjosh](https://togithub.com/gotjosh) made their first
contribution in
[https://github.com/prometheus/common/pull/644](https://togithub.com/prometheus/common/pull/644)
- [@&#8203;mikelolasagasti](https://togithub.com/mikelolasagasti) made
their first contribution in
[https://github.com/prometheus/common/pull/625](https://togithub.com/prometheus/common/pull/625)
- [@&#8203;alanprot](https://togithub.com/alanprot) made their first
contribution in
[https://github.com/prometheus/common/pull/653](https://togithub.com/prometheus/common/pull/653)
- [@&#8203;yeya24](https://togithub.com/yeya24) made their first
contribution in
[https://github.com/prometheus/common/pull/655](https://togithub.com/prometheus/common/pull/655)
- [@&#8203;rajagopalanand](https://togithub.com/rajagopalanand) made
their first contribution in
[https://github.com/prometheus/common/pull/649](https://togithub.com/prometheus/common/pull/649)

**Full Changelog**:
https://github.com/prometheus/common/compare/v0.54.0...v0.55.0

</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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-26 10:56:13 -07:00
Srijan Rastogi
af317f05ef
Add WithHeaders option for Zipkin exporter (#5530)
- Added `WithHeaders` option func, which allows user to set custom http
request headers while exporting spans.
- Closes: #3474

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-06-26 10:03:32 -07:00
Damien Mathieu
6d45f283c7
Add errorlint linter (#5535)
This is the last PR adding missing linters, adding
[errorlint](https://github.com/polyfloyd/go-errorlint).

Co-authored-by: Sam Xie <sam@samxie.me>
2024-06-25 10:55:00 -07:00
Tyler Yahn
921eb701b1
Decouple codecov upload from coverage testing (#5534)
Do no repeat the whole coverage testing if the codecov upload fails.

### TODO

- [ ] Copy these changes to contrib if this merges
2024-06-24 10:58:55 -07:00
renovate[bot]
bae7be22aa
chore(deps): update otel/opentelemetry-collector-contrib docker tag to v0.103.1 (#5540)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[otel/opentelemetry-collector-contrib](https://togithub.com/open-telemetry/opentelemetry-collector-releases)
| patch | `0.103.0` -> `0.103.1` |

---

### Release Notes

<details>
<summary>open-telemetry/opentelemetry-collector-releases
(otel/opentelemetry-collector-contrib)</summary>

###
[`v0.103.1`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/compare/v0.103.0...v0.103.1)

[Compare
Source](https://togithub.com/open-telemetry/opentelemetry-collector-releases/compare/v0.103.0...v0.103.1)

</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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-24 10:04:41 -07:00
renovate[bot]
7e0813445b
chore(deps): update google.golang.org/genproto/googleapis/rpc digest to dc46fd2 (#5539)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[google.golang.org/genproto/googleapis/rpc](https://togithub.com/googleapis/go-genproto)
| indirect | digest | `68d350f` -> `dc46fd2` |
|
[google.golang.org/genproto/googleapis/rpc](https://togithub.com/googleapis/go-genproto)
| require | digest | `68d350f` -> `dc46fd2` |

---

### 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-24 09:27:58 -07:00
renovate[bot]
399de05c48
chore(deps): update google.golang.org/genproto/googleapis/api digest to dc46fd2 (#5538)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[google.golang.org/genproto/googleapis/api](https://togithub.com/googleapis/go-genproto)
| indirect | digest | `68d350f` -> `dc46fd2` |
|
[google.golang.org/genproto/googleapis/api](https://togithub.com/googleapis/go-genproto)
| indirect | digest | `0867130` -> `dc46fd2` |

---

### 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-24 08:56:37 -07:00
Johannes Tax
4e94f405ab
Populate service.instance.id with a default value when OTEL_GO_X_RESOURCE is set (#5520)
As discussed in a previous SIG meeting, this PR adds support for setting
a default value for
[`service.instance.id`](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/resource#service-experimental)
according to semantic conventions:

> Implementations, such as SDKs, are recommended to generate a random
Version 1 or Version 4 [RFC 4122](https://www.ietf.org/rfc/rfc4122.txt)
UUID, but are free to use an inherent unique ID as the source of this
value if stability is desirable. In that case, the ID SHOULD be used as
source of a UUID Version 5 and SHOULD use the following UUID as the
namespace: `4d63009a-8d0f-11ee-aad7-4c796ed8e320`.

This PR follows the recommendation and populates `service.instance.id`
with a random Version 4 UUID. The functionality is guarded by the
`OTEL_GO_X_RESOURCE` feature flag environment variable.

There are plans to declare `service.instance.id` stable and also make it
a required attribute (similar to `service.name`). Once this happens, the
functionality can be made available regardless of whether
`OTEL_GO_X_RESOURCE` is set.

Closes
https://github.com/open-telemetry/opentelemetry-go-contrib/issues/5423

---------

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Co-authored-by: Tyler Yahn <codingalias@gmail.com>
2024-06-24 08:25:49 -07:00
Tyler Yahn
86df296ef7
Verify versions.yaml is up to date in CI (#5533) 2024-06-24 07:58:21 -07:00
Sam Xie
d99c76fa32
Add newClient method for otlploggrpc gRPC client (#5523)
part of #5056

For full usage of this client, check #5522

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-06-24 07:47:21 -07:00
Joonsoo Park
a814b359a0
Add example for synchronous gauge (#5492)
Added example for synchronous gauge

Related: #5414
2024-06-24 07:37:40 -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
3e91436a3b
Add unconvert linter (#5529)
This adds the unconvert linter, and fixes every new issue related to it.

Co-authored-by: Sam Xie <sam@samxie.me>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-06-21 15:00:26 -07:00
Tyler Yahn
4a509d24e2
Do not fail CI on codecov create report (#5532)
Unblock PRs from the CI failure.
2024-06-21 13:04:57 -07:00
renovate[bot]
eb6bd28f32
chore(deps): update prom/prometheus docker tag to v2.53.0 (#5525)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| prom/prometheus | minor | `v2.52.0` -> `v2.53.0` |

---

### 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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTAuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQxMy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-20 09:15:46 -07:00
renovate[bot]
86a40d5721
chore(deps): update otel/opentelemetry-collector-contrib docker tag to v0.103.0 (#5526)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[otel/opentelemetry-collector-contrib](https://togithub.com/open-telemetry/opentelemetry-collector-releases)
| minor | `0.102.1` -> `0.103.0` |

---

### Release Notes

<details>
<summary>open-telemetry/opentelemetry-collector-releases
(otel/opentelemetry-collector-contrib)</summary>

###
[`v0.103.0`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/releases/tag/v0.103.0)

[Compare
Source](https://togithub.com/open-telemetry/opentelemetry-collector-releases/compare/v0.102.1...v0.103.0)

Check the [v0.103.0 contrib
changelog](https://togithub.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.103.0)
and the [v0.103.0 core
changelog](https://togithub.com/open-telemetry/opentelemetry-collector/releases/tag/v0.103.0)
for changelogs on specific components.

#### Changelog

-
[`d3637d2`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/commit/d3637d2)
Update Makefile OTELCOL_BUILDER_VERSION
([#&#8203;580](https://togithub.com/open-telemetry/opentelemetry-collector-releases/issues/580))
-
[`7029e89`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/commit/7029e89)
Prepare release v0.103.0
([#&#8203;579](https://togithub.com/open-telemetry/opentelemetry-collector-releases/issues/579))
-
[`7e58a5d`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/commit/7e58a5d)
Add googleclientauth extension to release manifest
([#&#8203;577](https://togithub.com/open-telemetry/opentelemetry-collector-releases/issues/577))
-
[`d77bd28`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/commit/d77bd28)
Update manifest.yaml
([#&#8203;563](https://togithub.com/open-telemetry/opentelemetry-collector-releases/issues/563))
-
[`46be8f7`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/commit/46be8f7)
Bump goreleaser/goreleaser-action from 5.1.0 to 6.0.0
([#&#8203;574](https://togithub.com/open-telemetry/opentelemetry-collector-releases/issues/574))
-
[`414594f`](https://togithub.com/open-telemetry/opentelemetry-collector-releases/commit/414594f)
Fix MSI release
([#&#8203;572](https://togithub.com/open-telemetry/opentelemetry-collector-releases/issues/572))

</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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTAuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQxMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-20 09:01:33 -07:00
Damien Mathieu
ef848afa30
Add tenv linter (#5524)
This starts adding more linters we aren't currently using, based on the
ones used by [the
collector](https://github.com/open-telemetry/opentelemetry-collector/blob/main/.golangci.yml#L122-L139).

This linter does not currently have any issues, so it requires no
further changes.
I'll be opening other PRs for linters that do require fixes.

* [tenv](https://github.com/sivchari/tenv) requires using `t.Setenv`
rather than `os.Setenv` in tests.

---------

Co-authored-by: Sam Xie <sam@samxie.me>
2024-06-20 08:54:51 -07:00
David Ashpole
773aec217d
Fix timestamp handling for the lastvalue aggregation (#5517)
Fixes https://github.com/open-telemetry/opentelemetry-go/issues/5510

From https://opentelemetry.io/docs/specs/otel/metrics/sdk/#metricreader:

> The ending timestamp (i.e. TimeUnixNano) MUST always be equal to time
the metric data point took effect, which is equal to when
[MetricReader.Collect](https://opentelemetry.io/docs/specs/otel/metrics/sdk/#collect)
was invoked. These rules apply to all metrics, not just those whose
[point
kinds](https://opentelemetry.io/docs/specs/otel/metrics/data-model/#point-kinds)
includes an aggregation temporality field.

Before https://github.com/open-telemetry/opentelemetry-go/pull/5305, we
used the measurement time as the timestamp, but it didn't matter because
the collection time is always the same as the measurement time for
asynchronous instruments. We didn't catch the issue when we implemented
synchronous instruments.

This PR changes the (end) timestamp handling for the Last Value
aggregation to match the (end) timestamp handling for sum and histogram
aggregations. As described in the spec above, we take the timestamp when
computing the aggregation during Collect.
2024-06-19 12:13:04 +02:00
Fools
ffe855df33
Fix IDGenerator may generate zero TraceId / SpanId (#5514)
# Description
Fix #5462 

## Type of change

add a loop to generate the spanID and traceID. 
the loop will not stop until it generate a valid ID

- [x] Bug fix (non-breaking change which fixes an issue)

---------

Co-authored-by: Damien Mathieu <42@dmathieu.com>
Co-authored-by: Robert Pająk <pellared@hotmail.com>
2024-06-18 15:57:45 -07:00
Sam Xie
f5e613757f
Correct the comment for the priority of options and environments on otlptracegrpc (#5508)
part of #5379

---------

Co-authored-by: David Ashpole <dashpole@google.com>
Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-06-18 10:10:19 -07:00
renovate[bot]
b04f91ae5a
chore(deps): update google.golang.org/genproto/googleapis/api digest to 68d350f (#5515) 2024-06-18 14:05:43 +02:00
renovate[bot]
a4cf372274
chore(deps): update google.golang.org/genproto/googleapis/rpc digest to 68d350f (#5516)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[google.golang.org/genproto/googleapis/rpc](https://togithub.com/googleapis/go-genproto)
| indirect | digest | `a8a6208` -> `68d350f` |
|
[google.golang.org/genproto/googleapis/rpc](https://togithub.com/googleapis/go-genproto)
| require | digest | `a8a6208` -> `68d350f` |

---

### 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:eyJjcmVhdGVkSW5WZXIiOiIzNy40MTAuMSIsInVwZGF0ZWRJblZlciI6IjM3LjQxMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-18 13:53:06 +02:00
Fabio Bozzo
478f85bb15
fix(baggage): validate chars panic with 0x80 (#5494)
The validation rule for baggage key/values chars has a N+1 problem with
the unicode value: `0x80`.

For instance, `baggage.NewMemberRaw` could be called with a string value
including the rune `128` and return no error.

Then `baggage.New` would panic on `validateValueChar`:
```
=== RUN   TestValidateValueChar
--- FAIL: TestValidateValueChar (0.00s)
panic: runtime error: index out of range [128] with length 128 [recovered]
	panic: runtime error: index out of range [128] with length 128
```

---------

Co-authored-by: Sam Xie <sam@samxie.me>
2024-06-17 09:03:57 -07:00
renovate[bot]
e451d1fa3c
fix(deps): update module go.opentelemetry.io/proto/otlp to v1.3.1 (#5505)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[go.opentelemetry.io/proto/otlp](https://togithub.com/open-telemetry/opentelemetry-proto-go)
| `v1.2.0` -> `v1.3.1` |
[![age](https://developer.mend.io/api/mc/badges/age/go/go.opentelemetry.io%2fproto%2fotlp/v1.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/go.opentelemetry.io%2fproto%2fotlp/v1.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/go.opentelemetry.io%2fproto%2fotlp/v1.2.0/v1.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/go.opentelemetry.io%2fproto%2fotlp/v1.2.0/v1.3.1?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>open-telemetry/opentelemetry-proto-go
(go.opentelemetry.io/proto/otlp)</summary>

###
[`v1.3.1`](https://togithub.com/open-telemetry/opentelemetry-proto-go/releases/tag/v1.3.1)

[Compare
Source](https://togithub.com/open-telemetry/opentelemetry-proto-go/compare/v1.2.0...v1.3.1)

Release of the
[v1.3.1](https://togithub.com/open-telemetry/opentelemetry-proto/releases/tag/v1.3.1)
version of the OTLP including the new Profiles signal.

⚠️ This release includes new experimental packages that do not
follow semantic versioning. See [the versioning
policy](https://togithub.com/open-telemetry/opentelemetry-proto-go?tab=readme-ov-file#versioning-policy)
for details.

##### What's Changed

- Bump google.golang.org/protobuf from 1.33.0 to 1.34.0 in /otlp by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/168](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/168)
- Bump google.golang.org/protobuf from 1.33.0 to 1.34.0 in /slim/otlp by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/169](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/169)
- Bump google.golang.org/grpc from 1.63.0 to 1.63.2 in /otlp by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/165](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/165)
- Add Versioning Policy to README by
[@&#8203;florianl](https://togithub.com/florianl) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/167](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/167)
- Bump google.golang.org/protobuf from 1.34.0 to 1.34.1 in /slim/otlp by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/171](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/171)
- Bump google.golang.org/protobuf from 1.34.0 to 1.34.1 in /otlp by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/172](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/172)
- Bump golang.org/x/net from 0.21.0 to 0.23.0 in /otlp by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/173](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/173)
- Bump google.golang.org/grpc from 1.63.2 to 1.64.0 in /otlp by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/174](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/174)
- Bump github.com/grpc-ecosystem/grpc-gateway/v2 from 2.19.1 to 2.20.0
in /otlp by [@&#8203;dependabot](https://togithub.com/dependabot) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/175](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/175)
- Explain stability guarantees for experimental packages by
[@&#8203;MrAlias](https://togithub.com/MrAlias) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/177](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/177)
- Release v1.3.1 by [@&#8203;florianl](https://togithub.com/florianl) in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/170](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/170)

##### New Contributors

- [@&#8203;florianl](https://togithub.com/florianl) made their first
contribution in
[https://github.com/open-telemetry/opentelemetry-proto-go/pull/167](https://togithub.com/open-telemetry/opentelemetry-proto-go/pull/167)

**Full Changelog**:
https://github.com/open-telemetry/opentelemetry-proto-go/compare/v1.2.0...v1.3.1

</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:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQxMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-17 07:58:01 -07:00
renovate[bot]
77fafaf13f
chore(deps): update jaegertracing/all-in-one docker tag to v1.58 (#5504)
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| jaegertracing/all-in-one | minor | `1.57` -> `1.58` |

---

### 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 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:eyJjcmVhdGVkSW5WZXIiOiIzNy4zOTMuMCIsInVwZGF0ZWRJblZlciI6IjM3LjQxMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJTa2lwIENoYW5nZWxvZyIsImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-17 07:46:19 -07:00
ttoad
30e82e01b6
trace: Use non-generic to replace newEvictedQueue in trace.start to reduce memory usage. (#5497)
benchstat:
```
goos: darwin
goarch: arm64
pkg: go.opentelemetry.io/otel/sdk/trace
              │     old     │                 new                 │
              │   sec/op    │   sec/op     vs base                │
TraceStart-10   950.6n ± 1%   641.0n ± 0%  -32.57% (p=0.000 n=10)

              │     old     │                new                 │
              │    B/op     │    B/op     vs base                │
TraceStart-10   1040.0 ± 0%   704.0 ± 0%  -32.31% (p=0.000 n=10)

              │    old     │                new                 │
              │ allocs/op  │ allocs/op   vs base                │
TraceStart-10   20.00 ± 0%   14.00 ± 0%  -30.00% (p=0.000 n=10)
```

---------

Co-authored-by: Damien Mathieu <damien.mathieu@elastic.co>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
2024-06-17 07:39:03 -07:00