Skip to content

Autogenerate semantic convention constants - #1759

Merged
lzchen merged 22 commits into
open-telemetry:mainfrom
srikanthccv:auto-semconv
Apr 20, 2021
Merged

Autogenerate semantic convention constants#1759
lzchen merged 22 commits into
open-telemetry:mainfrom
srikanthccv:auto-semconv

Conversation

@srikanthccv

@srikanthccv srikanthccv commented Apr 10, 2021

Copy link
Copy Markdown
Member

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 review from a team, lzchen and ocelotl and removed request for a team April 10, 2021 10:54
@lzchen

lzchen commented Apr 12, 2021

Copy link
Copy Markdown
Contributor

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

@srikanthccv

Copy link
Copy Markdown
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.

@codeboten codeboten left a comment

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.

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

srikanthccv commented Apr 13, 2021

Copy link
Copy Markdown
Member Author

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
Copy Markdown
Contributor

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

@lzchen

lzchen commented Apr 16, 2021

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member Author

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

@codeboten codeboten left a comment

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.

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

Comment thread opentelemetry-semantic-conventions/README.rst
Comment thread opentelemetry-semantic-conventions/README.rst Outdated
Comment thread opentelemetry-semantic-conventions/setup.cfg Outdated
Comment thread opentelemetry-semantic-conventions/src/opentelemetry/semconv/version.py Outdated
Comment thread opentelemetry-sdk/setup.cfg Outdated
include_package_data = True
install_requires =
opentelemetry-api == 1.0.1.dev0
opentelemetry-semantic-conventions == 1.0.1.dev0

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.

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be fine.

@codeboten codeboten left a comment

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.

Thanks for addressing my comments!

@srikanthccv

Copy link
Copy Markdown
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