8000 feat(server): Add support for measurement ingestion by dashed · Pull Request #724 · getsentry/relay · GitHub
[go: up one dir, main page]

Skip to content
8000

feat(server): Add support for measurement ingestion #724

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

Merged
merged 92 commits into from
Sep 28, 2020
Merged

Conversation

dashed
Copy link
Member
@dashed dashed commented Aug 19, 2020

TODO

Integration tests

  • simple case: envelope with transaction event with measurements interface
  • measure interface is stripped out for non-transaction events
  • any empty measurement interface is stripped out
  • measurements with non-numbers (e.g. null) are stripped out
  • revert requirements-test.txt (EDIT: pin to getsentry/sentry-python@e234998)

@dashed dashed requested a review from a team August 19, 2020 15:18
@dashed dashed self-assigned this Aug 19, 2020
@dashed dashed requested a review from rhcarvalho August 21, 2020 01:16
Copy link
Contributor
@rhcarvalho rhcarvalho left a comment

Choose a reason for hiding this comment

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

Hey, @dashed becoming a rustacean, really cool!

Sorry I didn't have much time to focus on this in the depth it deserves, here goes a partial and a bit distracted review, but wanted to get it out before the end of the week :)

@dashed dashed changed the title WIP: feat(measures): Add support for measurements WIP: feat(measurements): Add support for measurements Sep 15, 2020
@dashed
Copy link
Member Author
dashed commented Sep 16, 2020

@jan-auer This should be good for your review. I'm currently testing this locally with getsentry.

@jan-auer jan-auer changed the title WIP: feat(measurements): Add support for measurements feat(server): Add support for measurement ingestion Sep 16, 2020
@jan-auer jan-auer marked this pull request as ready for review September 16, 2020 16:19
@dashed dashed requested a review from a team September 17, 2020 08:21
@@ -7,5 +7,5 @@ pytest-xdist==1.31.0
pytest==5.3.5
redis==3.4.1
r 8000 equests==2.23.0
sentry_sdk==0.14.3
git+git://github.com/getsentry/sentry-python@e234998ae82a9cffa6fb3718801c55ba24a86bab#egg=sentry_sdk
Copy link
Member Author

Choose a reason for hiding this comment

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

@jan-auer I'm pinning this to getsentry/sentry-python@e234998 . I've confirmed with @untitaker that we can just pin this for the test python dependencies.

Copy link
Member

Choose a reason for hiding this comment

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

yeah just for context I want to scale down on the py sdk releases I do because customers may be get pinged via dependabot for those and it may be kinda annoying. I already pushed out two releases in the past 5 days

Copy link
Member

Choose a reason for hiding this comment

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

Looks like the only APIs we need are for tests and can be achieved with helper functions in our tests, too?

8000
),
};

return Some((name.to_lowercase(), Annotated::new(new_value)));
Copy link
Member Author

Choose a reason for hiding this comment

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

Attaching the processing error here instead of at the map level will look like this:

Screen Shot 2020-09-24 at 8 44 59 AM

Copy link
Member

Choose a reason for hiding this comment

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

Why can't we have the error in-place for the remaining measurements as well? I'd say that's what we should do and have downstream deal with null in those places (like we already have to with the inner value field)

Copy link
Member Author

Choose a reason for hiding this comment

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

@untitaker I don't quite follow. If the remaining measurements are valid, they won't have errors.

Copy link
Member

Choose a reason for hiding this comment

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

You are currently filtering out invalid measurements vs replacing them with null, I think we should go with setting them to null like you showed in teh screenshot basically.

Copy link
Member

Choose a reason for hiding this comment

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

@dashed I think this is the only thing I am rather adamant about, the rest seems fine and I'd merge cc @jan-auer

Copy link
Member Author

Choose a reason for hiding this comment

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

@untitaker They're now replaced with nulls. I've already included some tests to cover these test cases.

Unless there's a test case I missed 🤔

Copy link
Member

Choose a reason for hiding this comment

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

Ah sorry you're doing this only for invalid key names, nvm

@dashed dashed requested a review from jan-auer September 25, 2020 08:40
}
} else {
processing_errors.push(Error::invalid(format!(
"measurement name '{}' can contain only characters a-z0-9.-_",
Copy link
Member

Choose a reason for hiding this comment

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

Can we use Error::expected here

Copy link
Member Author

Choose a reason for hiding this comment

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

This was initially Error::expected, but @jan-auer changed this to Error::invalid.

} else {
let new_value = Measurement {
value: Annotated::from_error(
Error::invalid("measurement value must be numeric"),
Copy link
Member

Choose a reason for hiding this comment

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

please check how numeric values are asserted for otherwise, I think Error::expected("a numeric value")

Copy link
Member

Choose a reason for hiding this comment

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

My understanding is that this is already done by the derived from value implementation. I think you simply have to leave the deserialized measurement in the map, and you'll see an error.

@dashed dashed requested a review from untitaker September 25, 2020 19:57
@dashed
Copy link
Member Author
dashed commented Sep 27, 2020

@jan-auer Can this PR be merged soon? This is blocking @Zylphrex 's PR at getsentry/sentry#20719 (specifically for certain tests he's writing -- as travis ci is failing right now).

We don't anticipate the processing errors to crop up at all since we're not allowing custom measurement for the time being.

Any remaining changes could be performed in follow up PRs.

@untitaker
Copy link
Member
untitaker commented Sep 28, 2020

@dashed

there are some branches here that you literally don't have to account for
specifically:

https://github.com/getsentry/relay/pull/724/files#diff-e0b61eea6a940c0d6d91dd0ca83cc002R50
https://github.com/getsentry/relay/pull/724/files#diff-e0b61eea6a940c0d6d91dd0ca83cc002R36

there are duplicate errors created when going through store normalization, which is not invoked as part of your tests. required=true already does a bunch of stuff you then also explicitly handle, so you end up with multiple errors per attribute

just skip adding the errors (only on the branches I linked), then I'll merge

Other than that, let's ship it

@dashed
Copy link
Member Author
dashed commented Sep 28, 2020

Please don't merge before getsentry/snuba#1369 is merged.

@dashed dashed merged commit c030d66 into master Sep 28, 2020
@dashed dashed deleted the measurements branch September 28, 2020 17:20
Zylphrex added a commit to getsentry/sentry that referenced this pull request Sep 29, 2020
This change makes the measurement columns available to Sentry. Specifically, a
measurement x can be queried under the name measurements.x.

All measurements are of the type number, and are treated as such. Furthermore,
fp, fcp, lcp, and fid are special cased to be treated as durations as well.

Measurements can also be used under aggregate functions, provided they are of
the appropriate types.

This change depends on getsentry/relay/pull/724 and getsentry/relay#785
jan-auer added a commit that referenced this pull request Oct 5, 2020
* master:
  fix: use MIN_SRING_LEN in all branches (#791)
  ci: Simplify GitHub workflows (#790)
  fix(wstring): Correct out-of-range indexing and is_char_boundary (#787)
  fix(minidump): Accept big-endian minidumps (#789)
  release: 0.8.1
  fix(server): Allow numbers in measurement names (#785)
  feat(server): Add support for measurement ingestion (#724)
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.

6 participants
0