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

RUMM-1588 + RUMM-1610 Update E2E test monitors to new metric format #601

Merged
merged 3 commits into from
Sep 23, 2021

Conversation

ncreated
Copy link
Member

@ncreated ncreated commented Sep 21, 2021

What and why?

⚙️ This PR updates our E2E test monitors to new format:

  • it adds feature tag (logs | trace | rum | core) to each monitor;
  • it adds monitor:behavior tag to all monitors asserting data;
  • it adds monitor:performance tag to all monitors asserting performance;
  • from now on, all performance spans use "perf_measure" span with test method sent as a resource name.

It also adds a bonus for troubleshooting, now each monitor renders its corresponding E2E test code in monitor UI, e.g.:

Screenshot 2021-09-21 at 16 55 30

This helps understanding each monitor, especially if it expects "data" or "no data".

How?

  • I added ${{feature}} variable to monitors template - it has no default value, so linter will emit an error if not specified.
  • Both monitor:behaviour and monitor:performance tags are hardcoded in each template.
  • I updated code to differentiate resource_name for each span and use common operation_name.

Code rendering is done through template system. Code is parsed while reading monitors from test files.

I regenerated all monitors by first deleting them, and then running terraform apply.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference

@ncreated ncreated self-assigned this Sep 21, 2021
@ncreated ncreated requested a review from a team as a code owner September 21, 2021 15:02
Comment on lines +235 to +236
It starts from `method_signature_line` and accepts lines until all opening brackets "{" are matched
with enclosing "}" brackets.
Copy link
Member Author

Choose a reason for hiding this comment

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

It's easy to come up with an dummy edge case where this won't work, e.g.:

func testFunction() {
   // {
}

but the linter message comes handy:

Screenshot 2021-09-21 at 17 10 48

It didn't require any code formatting change to make it work, and I consider this "good enough" for the value it is adding. In a very rare edge cases where this would not work (I can't come up with any), this could be easily muted in the test code (e.g. by // }).

@ncreated ncreated merged commit 71d3fc3 into master Sep 23, 2021
@ncreated ncreated deleted the ncreated/RUMM-1588-update-monitors-for-E2E-tests branch September 23, 2021 10:22
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.

2 participants