1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-02-05 13:15:41 +02:00

Handle Resource env error when non-nil (#1851)

* Handle Resource env error when non-nil

* Add changes to changelog

* Update PR number
This commit is contained in:
Tyler Yahn 2021-04-27 16:52:48 +00:00 committed by GitHub
parent 24a91628f1
commit 62cd933da5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -21,6 +21,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Fixed
- Only report errors from the `"go.opentelemetry.io/otel/sdk/resource".Environment` function when they are not `nil`. (#1850, #1851)
### Security
## [0.20.0] - 2021-04-23

View File

@ -149,7 +149,7 @@ func Default() *Resource {
func Environment() *Resource {
detector := &FromEnv{}
resource, err := detector.Detect(context.Background())
if err == nil {
if err != nil {
otel.Handle(err)
}
return resource