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

Add support for OTEL_SERVICE_NAME env var. #1829

Merged
merged 3 commits into from
May 10, 2021

Conversation

owais
Copy link
Contributor

@owais owais commented May 7, 2021

Description

Spec PR: open-telemetry/opentelemetry-specification#1677

Please review but don't merge until the spec PR is merged.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Added tests

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@owais owais requested a review from a team as a code owner May 7, 2021 21:20
@owais owais requested review from codeboten and srikanthccv and removed request for a team May 7, 2021 21:20
@owais owais force-pushed the otel-service-name-env branch 2 times, most recently from 0c8e0b7 to c409212 Compare May 7, 2021 21:40
Copy link
Contributor

@codeboten codeboten left a comment

Choose a reason for hiding this comment

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

Overall looks good, just one question regarding using the semconv.

@@ -231,6 +234,9 @@ def detect(self) -> "Resource":
item.split("=") for item in env_resources_items.split(",")
)
}
service_name = os.environ.get(OTEL_SERVICE_NAME)
if service_name:
env_resource_map["service.name"] = service_name
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this use the semconv package instead of the string for the key?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@codeboten codeboten merged commit f7358e9 into open-telemetry:main May 10, 2021
@owais owais deleted the otel-service-name-env branch May 10, 2021 20:16
owais added a commit to owais/opentelemetry-python that referenced this pull request May 11, 2021
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.

None yet

4 participants