Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: fix bug where WithResourceAsConstantLabels wasn't set #6260

Merged
merged 3 commits into from
Oct 17, 2024

Conversation

codeboten
Copy link
Contributor

There was a bug in the config package where the WithResourceAsConstantLabels option wasn't appended to the list of options for the Prometheus reader. Fixed that issue and added a test to validate the correct number of options is set.

There was a bug in the config package where the WithResourceAsConstantLabels
option wasn't appended to the list of options for the Prometheus reader. Fixed
that issue and added a test to validate the correct number of options is
set.

Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
@codeboten codeboten requested review from pellared and a team as code owners October 16, 2024 21:47
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

Attention: Patch coverage is 76.47059% with 4 lines in your changes missing coverage. Please review.

Project coverage is 67.1%. Comparing base (d9c9bbe) to head (bbe69b3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
config/metric.go 76.4% 2 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #6260     +/-   ##
=======================================
- Coverage   67.1%   67.1%   -0.1%     
=======================================
  Files        191     191             
  Lines      12637   12642      +5     
=======================================
+ Hits        8492    8495      +3     
- Misses      3855    3856      +1     
- Partials     290     291      +1     
Files with missing lines Coverage Δ
config/metric.go 85.9% <76.4%> (-0.5%) ⬇️

config/metric.go Show resolved Hide resolved
Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com>
@pellared pellared merged commit 13536dd into open-telemetry:main Oct 17, 2024
25 checks passed
@codeboten codeboten deleted the codeboten/fix-bug branch October 17, 2024 15:00
@pellared pellared added this to the v1.32.0 milestone Nov 8, 2024
pellared added a commit that referenced this pull request Nov 8, 2024
### Added

- Add the `WithSource` option to the
`go.opentelemetry.io/contrib/bridges/otelslog` log bridge to set the
`code.*` attributes in the log record that includes the source location
where the record was emitted. (#6253)
- Add `ContextWithStartTime` and `StartTimeFromContext` to
`go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp`, which
allows setting the start time using go context. (#6137)
- Set the `code.*` attributes in
`go.opentelemetry.io/contrib/bridges/otelzap` if the `zap.Logger` was
created with the `AddCaller` or `AddStacktrace` option. (#6268)
- Add a `LogProcessor` to
`go.opentelemetry.io/contrib/processors/baggagecopy` to copy baggage
members to log records. (#6277)
  - Use `baggagecopy.NewLogProcessor` when configuring a Log Provider.
- `NewLogProcessor` accepts a `Filter` function type that selects which
baggage members are added to the log record.

### Changed 

- Transform raw (`slog.KindAny`) attribute values to matching
`log.Value` types.
For example, `[]string{"foo", "bar"}` attribute value is now transformed
to `log.SliceValue(log.StringValue("foo"), log.StringValue("bar"))`
instead of `log.String("[foo bar"])`. (#6254)
- Upgrade `go.opentelemetry.io/otel/semconv/v1.17.0` to
`go.opentelemetry.io/otel/semconv/v1.21.0` in
`go.opentelemetry.io/contrib/instrumentation/go.mongodb.org/mongo-driver/mongo/otelmongo`.
(#6272)
- Resource doesn't merge with defaults if a valid resource is configured
in `go.opentelemetry.io/contrib/config`. (#6289)

### Fixed

- Transform nil attribute values to `log.Value` zero value instead of
panicking in `go.opentelemetry.io/contrib/bridges/otellogrus`. (#6237)
- Transform nil attribute values to `log.Value` zero value instead of
panicking in `go.opentelemetry.io/contrib/bridges/otelzap`. (#6237)
- Transform nil attribute values to `log.Value` zero value instead of
`log.StringValue("<nil>")` in
`go.opentelemetry.io/contrib/bridges/otelslog`. (#6246)
- Fix `NewClientHandler` so that `rpc.client.request.*` metrics measure
requests instead of responses and `rpc.client.responses.*` metrics
measure responses instead of requests in
`go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc`.
(#6250)
- Fix issue in `go.opentelemetry.io/contrib/config` causing
`otelprom.WithResourceAsConstantLabels` configuration to not be
respected. (#6260)
- `otel.Handle` is no longer called on a successful shutdown of the
Prometheus exporter in `go.opentelemetry.io/contrib/config`. (#6299)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants