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

Create resource.Default() with required attributes/default values #1507

Merged
merged 5 commits into from
Feb 15, 2021

Conversation

evantorrie
Copy link
Contributor

@evantorrie evantorrie commented Jan 31, 2021

As per changes to the OpenTelemetry spec open-telemetry/opentelemetry-specification#1294, this PR makes available a "default" Resource. If a metric or trace provider does not explicitly have a Resource assigned to it using WithResource() when creating the metric controller or the trace provider, the default Resource is used instead.

Resolves #1391

@codecov
Copy link

codecov bot commented Jan 31, 2021

Codecov Report

Merging #1507 (46bd88c) into main (76f9342) will decrease coverage by 0.0%.
The diff coverage is 75.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #1507     +/-   ##
=======================================
- Coverage   77.7%   77.7%   -0.1%     
=======================================
  Files        127     127             
  Lines       6683    6697     +14     
=======================================
+ Hits        5195    5205     +10     
- Misses      1244    1246      +2     
- Partials     244     246      +2     
Impacted Files Coverage Δ
sdk/resource/resource.go 55.5% <60.0%> (+0.5%) ⬆️
sdk/resource/builtin.go 88.2% <66.6%> (-11.8%) ⬇️
sdk/metric/controller/basic/controller.go 93.3% <100.0%> (+0.1%) ⬆️
sdk/trace/provider.go 94.6% <100.0%> (+<0.1%) ⬆️

@evantorrie evantorrie marked this pull request as ready for review February 1, 2021 00:15
Copy link
Member

@XSAM XSAM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@MrAlias MrAlias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍, one question about the error reporting.

sdk/resource/resource.go Outdated Show resolved Hide resolved
+ some small CHANGELOG PR addition, rewording
+ change default resource servicename to `unknown_service:go` (this
matches the Java codebase which uses `unknown_service:java`)
@MrAlias MrAlias merged commit 8fae0a6 into open-telemetry:main Feb 15, 2021
@Aneurysm9 Aneurysm9 mentioned this pull request Mar 3, 2021
ldelossa pushed a commit to ldelossa/opentelemetry-go that referenced this pull request Mar 5, 2021
…en-telemetry#1507)

* Create resource.Default() with required attributes/default values

Add metric controller and tracer provider tests for resources

* Updated CHANGELOG

* PR comments

+ some small CHANGELOG PR addition, rewording
+ change default resource servicename to `unknown_service:go` (this
matches the Java codebase which uses `unknown_service:java`)
This was referenced Mar 7, 2021
This was referenced Mar 11, 2021
@pellared pellared added this to the untracked milestone Nov 8, 2024
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.

Install default SDK resources if none are configured
5 participants