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

Support span/resource/metric types #14

Merged
merged 4 commits into from
Oct 23, 2020

Conversation

thisthat
Copy link
Member

@thisthat thisthat commented Oct 16, 2020

This PR makes the following contributions:

  • Add more tests
  • Verifies that attributes used in AnyOf constraints are correctly defined
  • Add initial support to differentiate YAML semantic convention between span, metric, and resource

@justinfoote please, have a look :)

@thisthat thisthat requested a review from a team October 16, 2020 10:43
@Oberon00
Copy link
Member

Ideally, we should minimize the unit test files. Right now they contain quite a lot superfluous code.

I think you should add the tests in a separate PR beforehand, so we can also see what changes in expectations, etc. with the functional changes in the follow-up PR.

@arminru arminru requested a review from justinfoote October 16, 2020 12:32
@justinfoote
Copy link
Member

:awesome: There's a lot here. I'll pull this down and review it soon!

Copy link
Member

@Oberon00 Oberon00 left a comment

Choose a reason for hiding this comment

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

Approving this because we used this internally at Dynatrace for some time with success.

Copy link
Member

@justinfoote justinfoote left a comment

Choose a reason for hiding this comment

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

I started a full PR review, but there's a lot here, and I don't think I've fully processed what all of the tests are doing.
In addition, the style of testing is considerably different between my earlier PR (which used pytest) and this one (which uses unittest). The result is that this repo is kind of a mess, but maybe that's OK for a build-tools project.

I'd love to see us come back and refactor and clean this up in the future.
And we'll need a followup PR to support metrics.

But given those caveats, I approve.

@thisthat
Copy link
Member Author

@justinfoote I know about the different testing styles. We wrote these tests while developing the tool and, honestly, changing them was too much of an effort for this project 😅

@Oberon00
Copy link
Member

The result is that this repo is kind of a mess, but maybe that's OK for a build-tools project.

I think it's not really OK but we can IMHO live with it, as it's still better than fewer tests.

Comment on lines +59 to +61
# Gracefully transition to the new types
if type_value is None:
return SemanticConventionType.SPAN
Copy link
Member

Choose a reason for hiding this comment

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

That's a good idea! Otherwise we'd end up with a broken spec build since the version is not pinned and we don't define types there yet.

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