Skip to content

Add support for OTEL_SERVICE_NAME env var.#1829

Merged
codeboten merged 3 commits intoopen-telemetry:mainfrom
owais:otel-service-name-env
May 10, 2021
Merged

Add support for OTEL_SERVICE_NAME env var.#1829
codeboten merged 3 commits intoopen-telemetry:mainfrom
owais:otel-service-name-env

Conversation

@owais
Copy link
Copy Markdown
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 review from a team, 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
Copy Markdown
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.

}
service_name = os.environ.get(OTEL_SERVICE_NAME)
if service_name:
env_resource_map["service.name"] = service_name
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@owais owais force-pushed the otel-service-name-env branch from a55cc11 to c31bd4b Compare May 10, 2021 17:46
@owais owais force-pushed the otel-service-name-env branch from c31bd4b to 7e8ea37 Compare May 10, 2021 17:46
@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.

4 participants