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

chore!: refer to resource labels as attributes #1419

Merged
merged 5 commits into from
Aug 14, 2020

Conversation

mwear
Copy link
Member

@mwear mwear commented Aug 12, 2020

Which problem is this PR solving?

Short description of the changes

  • Key value pairs describing a resource were originally called labels. The terminology in OTel has been updated to use attributes instead. In addition to updating the EnvDetector to use OTEL_RESOURCE_ATTRIBUTES instead of OTEL_RESOURCE_LABELS, this PR updates the rest of the codebase to consistently use attributes instead of labels for Resources.

@codecov
Copy link

codecov bot commented Aug 12, 2020

Codecov Report

Merging #1419 into master will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1419   +/-   ##
=======================================
  Coverage   94.11%   94.11%           
=======================================
  Files         145      145           
  Lines        4335     4335           
  Branches      883      883           
=======================================
  Hits         4080     4080           
  Misses        255      255           
Impacted Files Coverage Δ
...rces/src/platform/node/detectors/AwsEc2Detector.ts 87.50% <ø> (ø)
.../opentelemetry-exporter-collector/src/transform.ts 96.70% <100.00%> (ø)
...ges/opentelemetry-exporter-jaeger/src/transform.ts 100.00% <100.00%> (ø)
...ges/opentelemetry-exporter-zipkin/src/transform.ts 100.00% <100.00%> (ø)
...ckages/opentelemetry-exporter-zipkin/src/zipkin.ts 98.46% <100.00%> (ø)
packages/opentelemetry-resources/src/Resource.ts 100.00% <100.00%> (ø)
...ry-resources/src/platform/node/detect-resources.ts 96.29% <100.00%> (ø)
...sources/src/platform/node/detectors/EnvDetector.ts 95.55% <100.00%> (ø)
...sources/src/platform/node/detectors/GcpDetector.ts 95.34% <100.00%> (ø)

Copy link
Member

@mayurkale22 mayurkale22 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
Member

@obecny obecny left a comment

Choose a reason for hiding this comment

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

lgtm

@dyladan
Copy link
Member

dyladan commented Aug 13, 2020

/cc @markwolff since your new packages will need to incorporate these changes

@markwolff
Copy link
Member

confirm. I'll resolve the conflicts

*
* @param config The resource detection config with a required logger
*/
async detect(config: ResourceDetectionConfigWithLogger): Promise<Resource> {
try {
const labelString = process.env.OTEL_RESOURCE_LABELS;
if (!labelString) {
const rawAttributes = process.env.OTEL_RESOURCE_ATTRIBUTES;
Copy link
Member

@obecny obecny Aug 13, 2020

Choose a reason for hiding this comment

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

I'm wondering one thing here, above all should this be a part of environment instead of accessing process.env directly. I know this under platform node, but still I would be in favour of getting env variables through getEnv(), I'm fine to do it in next PR as it was already like this before, WDYT ?

Copy link
Member

Choose a reason for hiding this comment

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

I agree, but I think it is outside the scope of this PR.

@dyladan dyladan changed the title chore: refer to resource labels as attributes chore!: refer to resource labels as attributes Aug 14, 2020
@dyladan
Copy link
Member

dyladan commented Aug 14, 2020

Conventional Commits requires that a ! be appended to the commit type or a footer BREAKING CHANGE be added to breaking change commit messages. I have renamed the PR to include the !

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.

Use OTEL_RESOURCE_ATTRIBUTES instead of OTEL_RESOURCE_LABELS
5 participants