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

Implement outcome for transactions & spans #1613

Merged
merged 51 commits into from
Feb 9, 2021

Conversation

SylvainJuge
Copy link
Member

@SylvainJuge SylvainJuge commented Jan 13, 2021

What does this PR do?

Fixes #1354

Fixes #1298
Fixes #1280

Implementation checklist

add outcome to the following plugins:

  • public API (so it can be set by user)
  • gRPC
  • HTTP client plugins
    • httpclient
    • asynchttpclient
    • jdk-httpclient
    • ok-http
    • urlconnection
  • Servlet
  • Opentracing
  • Other plugins

Extra:

Checklist

  • This is an enhancement of existing features, or a new feature in existing plugins
    • I have updated CHANGELOG.asciidoc
    • I have added tests that prove my fix is effective or that my feature works
    • Added an API method or config option? Document in which version this will be introduced
    • I have made corresponding changes to the documentation

@apmmachine
Copy link
Collaborator

apmmachine commented Jan 13, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: Pull request #1613 updated

  • Start Time: 2021-02-09T08:50:13.326+0000

  • Duration: 43 min 41 sec

  • Commit: 54c4b43

Test stats 🧪

Test Results
Failed 0
Passed 1815
Skipped 13
Total 1828

Trends 🧪

Image of Build Times

Image of Tests

💚 Flaky test report

Tests succeeded.

Expand to view the summary

Test stats 🧪

Test Results
Failed 0
Passed 1815
Skipped 13
Total 1828

@SylvainJuge SylvainJuge added this to Planned in APM-Agents (OLD) via automation Jan 14, 2021
@SylvainJuge SylvainJuge moved this from Planned to In Progress in APM-Agents (OLD) Jan 14, 2021
}

@Test
void destroyWithoutProcessTerminatedShouldEndSpan() {
Process process = mock(Process.class);
verifyNoMoreInteractions(process); // we should not even use any method of process

// we have to opt-in to allow unknown outcome
reporter.checkUnknownOutcome(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

@eyalkoren external process execution is one case where we might not always know the outcome if the process hasn't yet terminated. But I have to admit that it's quite likely to be a very narrow corner case.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is a fair exception to make - if we never report unknown to terminated processes and always report unknown to unterminated processes it sounds reasonable.

Copy link
Contributor

@eyalkoren eyalkoren left a comment

Choose a reason for hiding this comment

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

Looks great. The main comment is what we discussed about reflecting the revised spec where by default we set an outcome to spans, with some exceptions for specific span types.

Other than that, ResultUtilTest requires updating.

Copy link
Contributor

@eyalkoren eyalkoren left a comment

Choose a reason for hiding this comment

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

Once the tests pass, I am good with merging this PR.
If it's easy enough, switching to not allow unknown outcome for spans in the MockReporter and changing only for specific span types would be preferable as it means we cover all plugins, including future ones. If this complicates things, we can wait with that.

@@ -85,7 +85,7 @@
private final List<byte[]> bytes = new CopyOnWriteArrayList<>();
private final ObjectMapper objectMapper;
private final boolean verifyJsonSchema;
private boolean checkUnknownOutcomes = false;
private boolean checkUnknownOutcomes = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

@SylvainJuge SylvainJuge merged commit b099880 into elastic:master Feb 9, 2021
APM-Agents (OLD) automation moved this from In Progress to Done Feb 9, 2021
@SylvainJuge SylvainJuge deleted the add-outcome branch February 9, 2021 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
5 participants