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

Set default outcome according to spec #1160

Merged
merged 1 commit into from
Nov 25, 2021
Merged

Conversation

axw
Copy link
Member

@axw axw commented Nov 25, 2021

Apart from HTTP and gRPC, which set outcome based on the status code, set the default outcome to "success" by default, or "failure" if any errors were captured within the transaction or span.

This brings us into line with the agent spec for transaction and span outcome:

For other protocols, we can default to the following behavior:

  • failure when an error is reported
  • success otherwise

Apart from HTTP and gRPC, which set outcome based on
the status code, set the default outcome to "success"
by default, or "failure" if any errors were captured
within the transaction or span.
@elastic-apm-tech elastic-apm-tech added this to In Progress in APM-Agents (OLD) Nov 25, 2021
@axw axw requested a review from a team November 25, 2021 03:18
@axw axw marked this pull request as ready for review November 25, 2021 03:18
@apmmachine
Copy link
Collaborator

💚 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 preview

Expand to view the summary

Build stats

  • Start Time: 2021-11-25T03:14:03.006+0000

  • Duration: 32 min 15 sec

  • Commit: b43c021

Test stats 🧪

Test Results
Failed 0
Passed 11976
Skipped 268
Total 12244

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark test.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

Copy link
Contributor

@marclop marclop 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, very cool use of read locks and locks

@@ -346,6 +348,13 @@ func (s *Span) End() {
}
if s.Outcome == "" {
s.Outcome = s.Context.outcome()
if s.Outcome == "" {
if s.errorCaptured {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, this access doesn't need to be coordinated because the writer acquires a s.mu.Rlock and modifications won't be allowed to happen since this function holds s.mu.Lock

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup :) Maybe it would be worth commenting on the locks when they should be held. The SpanData/TransactionData locks only need to be held when holding an RLock on the Span/Transaction lock.

@axw axw merged commit 4fae17e into elastic:master Nov 25, 2021
APM-Agents (OLD) automation moved this from In Progress to Done Nov 25, 2021
@axw axw deleted the outcome-capture-error branch November 25, 2021 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants