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 Event Semantic Conventions #57

Merged
merged 5 commits into from
Aug 24, 2021

Conversation

Oberon00
Copy link
Member

Event semantic conventions were designed with span events in mind but should be extendable to log events. See the new tests for how this can be useful to add a YAML definition for the exception semantic conventions in the spec.

This adds two new elements to the YAML definition:

  • A new semantic convention type "event", with no additional fields
  • A new additional field for "span" semantic conventions to reference associated event semantic conventions.
    The generator validates that the semantic convention exists and the new data is available to the code templates,
    but is not yet used in the markdown output.

It also updates the JSON schema to only allow span_kind and the new events field if the semantic convention type is not specified (defaults to span) or is "span". Unfortunately, we then lose the "additionalProperties": false, this seems to be a limitation of the JSON schema language, see https://stackoverflow.com/questions/22689900/json-schema-allof-with-additionalproperties#comment83207554_23001194

Full disclosure: This is the last feature for this tool we had developed internally at Dynatrace before (promise! 😄), so I'm starting off by submitting the status quo here in hopes our code bases back in sync (we already use the event semantic convention type internally).

@Oberon00 Oberon00 added semconv Related to the semantic convention generator. semconv/model Related to the data model or YAML format of the semantic convention generator labels Jul 29, 2021
@Oberon00 Oberon00 requested a review from thisthat as a code owner July 29, 2021 16:25
@Oberon00 Oberon00 requested a review from a team July 29, 2021 16:25
@Oberon00 Oberon00 added the enhancement New feature or request label Jul 30, 2021
Oberon00 added a commit to dynatrace-oss-contrib/opentelemetry-specification that referenced this pull request Aug 3, 2021
@Oberon00
Copy link
Member Author

@open-telemetry/specs-approvers this still needs reviews.

@tigrannajaryan
Copy link
Member

Maybe @open-telemetry/python-approvers can help review the Python portion and @open-telemetry/specs-logs-approvers can help review the event-related logic?

@Oberon00
Copy link
Member Author

The events here were designed for span events. But if something prevents them from being used as logs (other than missing features) that would be good to know.

Copy link
Member

@aabmass aabmass left a comment

Choose a reason for hiding this comment

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

LGTM

@arminru arminru merged commit 93b80c7 into open-telemetry:main Aug 24, 2021
@arminru arminru deleted the events branch August 24, 2021 09:05
@arminru arminru linked an issue Sep 9, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request semconv/model Related to the data model or YAML format of the semantic convention generator semconv Related to the semantic convention generator.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support semantic convention for Event
6 participants