-
Notifications
You must be signed in to change notification settings - Fork 28
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
feat: map OTEL's span.status: Unset
to event.outcome: success
#188
feat: map OTEL's span.status: Unset
to event.outcome: success
#188
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if I am missing something here, should we be overriding explicitly set event.outcome
or transaction.result
?
@@ -174,9 +174,16 @@ func TestDecodeMapToSpanModel(t *testing.T) { | |||
assert.Equal(t, "failure", out.Event.Outcome) | |||
// derive from other fields - unknown | |||
input.Outcome.Reset() | |||
input.OTel.Reset() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change was only made to OTel input for now, so I needed to reset the Otel attributes here so we don't get confused why it affects also elasticapm
input
input.Context.HTTP.StatusCode.Reset() | ||
mapToSpanModel(&input, &out) | ||
assert.Equal(t, "unknown", out.Event.Outcome) | ||
// outcome is success when not assigned and it's otel | ||
input.Outcome.Reset() | ||
input.OTel.SpanKind.Set(spanKindInternal) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change was only made to OTel input for now, if otel attributes are set, it will use the same logic for mapping the Unset status to success outcome
apm-data translates
Span.status: Unset
asevent.outcome: unknown
. For OTEL, Unset status implies has not been failed/errored. We'd like to map Unset to success so we can calculate the correct transaction failed rate.The OTel specification writes the following on the SpanStatus being Unset:
So it should be ok for us map the Unset to success when we process the data.