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

Fix empty host.id #4317

Merged
merged 6 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Correctly format log messages from the `go.opentelemetry.io/otel/exporters/zipkin` exporter. (#4143)
- Log an error for calls to `NewView` in `go.opentelemetry.io/otel/sdk/metric` that have empty criteria. (#4307)
- Fix `readFile` in `go.opentelemetry.io/otel/sdk/resource` to return an error for non-existent files. `resource.WithHostID()` would previously return a resource with an empty `host.id` instead of returning an error. (#4317)
mwear marked this conversation as resolved.
Show resolved Hide resolved

## [1.16.0/0.39.0] 2023-05-18

Expand Down
2 changes: 1 addition & 1 deletion sdk/resource/host_id_readfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
func readFile(filename string) (string, error) {
b, err := os.ReadFile(filename)
if err != nil {
return "", nil
return "", err

Check warning on line 24 in sdk/resource/host_id_readfile.go

View check run for this annotation

Codecov / codecov/patch

sdk/resource/host_id_readfile.go#L24

Added line #L24 was not covered by tests
}

return string(b), nil
Expand Down