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

Autogenerate semantic convention constants #1759

Merged
merged 22 commits into from
Apr 20, 2021

Conversation

srikanthccv
Copy link
Member

@srikanthccv srikanthccv commented Apr 10, 2021

Description

Fixes #1022

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Does This PR Require a Contrib Repo Change?

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated

@srikanthccv srikanthccv marked this pull request as ready for review April 10, 2021 10:54
@srikanthccv srikanthccv requested a review from a team as a code owner April 10, 2021 10:54
@srikanthccv srikanthccv requested review from ocelotl and lzchen and removed request for a team April 10, 2021 10:54
@lzchen
Copy link
Contributor

lzchen commented Apr 12, 2021

This is cool. We will need another PR to replace all the constant usages correct? Maybe another issue is needed?

@srikanthccv
Copy link
Member Author

This is cool. We will need another PR to replace all the constant usages correct? Maybe another issue is needed?

Yes here is the PR that does it open-telemetry/opentelemetry-python-contrib#428. Another thing to point out here, there is manual list of resource related attributes here https://github.com/open-telemetry/opentelemetry-python/blob/main/opentelemetry-sdk/src/opentelemetry/sdk/resources/__init__.py#L74; Because removing them would be a breaking left as is and eventually it will be incomplete list. Going forward we can recommend people to use auto generated ones instead.

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.

Nice, this is great. Any thoughts about putting this in a semconv module to make it easier to differentiate from the rest of the code?

@srikanthccv
Copy link
Member Author

srikanthccv commented Apr 13, 2021

Nice, this is great. Any thoughts about putting this in a semconv module to make it easier to differentiate from the rest of the code?

Sounds good to me. Your suggestion is to move this from attributes to semconv module right? I am open to any kind of alternative placement.

@codeboten
Copy link
Contributor

As discussed in the SIG meeting, let's publish a separate pypi package for all semantic conventions: opentelemetry-semantic-conventions

@lzchen
Copy link
Contributor

lzchen commented Apr 16, 2021

Because removing them would be a breaking left as is and eventually it will be incomplete list. Going forward we can recommend people to use auto generated ones instead.

Maybe we can make them derive from the autogenerated ones?

@srikanthccv
Copy link
Member Author

Yes, that's what we decided on doing in the last SIG meeting.

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.

Thanks for updating this PR, overall it looks good. Blocking on the version number as the spec for this is still not stable.

opentelemetry-semantic-conventions/README.rst Show resolved Hide resolved
opentelemetry-semantic-conventions/README.rst Outdated Show resolved Hide resolved
opentelemetry-semantic-conventions/setup.cfg Outdated Show resolved Hide resolved
@@ -42,6 +42,7 @@ zip_safe = False
include_package_data = True
install_requires =
opentelemetry-api == 1.0.1.dev0
opentelemetry-semantic-conventions == 1.0.1.dev0
Copy link
Contributor

Choose a reason for hiding this comment

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

i wouldnt expect this package to be marked as stable as the spec is still experimental

Copy link
Member Author

Choose a reason for hiding this comment

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

Then does it still make sense to use this unstable package in sdk to derive the resource attributes?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think that's fine, it just means that the SDK will need to be updated as the conventions package is updated. @lzchen any thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Should be fine.

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.

Thanks for addressing my comments!

@srikanthccv
Copy link
Member Author

@lzchen Please review again. There have been some major changes since you last reviewed.

@srikanthccv srikanthccv requested a review from lzchen April 19, 2021 20:15
@lzchen lzchen merged commit c85c409 into open-telemetry:main Apr 20, 2021
@srikanthccv srikanthccv deleted the auto-semconv branch September 24, 2021 08:41
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.

Generate semantic convention constants/classes
3 participants