-
Notifications
You must be signed in to change notification settings - Fork 652
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
Conversation
0c8e0b7
to
c409212
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
a55cc11
to
c31bd4b
Compare
c31bd4b
to
7e8ea37
Compare
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.
How Has This Been Tested?
Does This PR Require a Contrib Repo Change?
Checklist: