# \[apm\] Question to event.outcome relationship between transaction and span

**URL:** <https://discuss.elastic.co/t/apm-question-to-event-outcome-relationship-between-transaction-and-span/328363>\
**Category:** APM\
**Tags:** java\
**Created:** [March 23, 2023, 3:27pm UTC](https://discuss.elastic.co/t/apm-question-to-event-outcome-relationship-between-transaction-and-span/328363 "2023-03-23T15:27:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dacothe](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dacothe](https://discuss.elastic.co/u/dacothe)\
**Post date:** [March 23, 2023, 3:27pm UTC](https://discuss.elastic.co/t/apm-question-to-event-outcome-relationship-between-transaction-and-span/328363/1 "2023-03-23T15:27:44Z")

</div>

**Kibana version** : 7.16.3

**Elasticsearch version** : 7.16.3

**APM Server version** : 7.16.3

**APM Agent language and version** : Java 1.30

**Browser version** : Chrome 110.0.5481.100

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: SpringBoot - Application JRE11 (2.6.13) with maven

Hello all,

I am currently having a hard time understanding the assignment of the `event.outcome` field for a transaction of type `http-request`.

From your point of view, what should be the value of the `event.outcome` field of a transaction when our microservice makes a REST call to another microservice and the microservice acknowledges the request with HTTP.NOT\_FOUND (code 404)? The REST call is captured in a span below the transaction.

If I understand the documentation ([apm/tracing-instrumentation-http.md at main · elastic/apm · GitHub](https://github.com/elastic/apm/blob/main/specs/agents/tracing-instrumentation-http.md#outcome)) correctly, then in the above case the span must be set to `event.outcome: failure`.

What does this then mean for the parent transaction above it - `event.outcome:failure`?

The question arises for us because we see in our data that the transaction is set to `event.outcome: success` even though a span listed below it has been assigned `event.outcome: failure`.

Thank you for some feedback!

Kind regards,  
Thilo

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [March 23, 2023, 4:16pm UTC](https://discuss.elastic.co/t/apm-question-to-event-outcome-relationship-between-transaction-and-span/328363/2 "2023-03-23T16:16:29Z")

</div>

Hi @dacothe , welcome to our forum !

For HTTP transactions and spans, the outcome depends on the status code and side of the HTTP request.

- when a service is receiving an HTTP request (service provides an HTTP endpoint), the 4xx errors are considered to be client-side errors, thus are not failures
- when a service is making an HTTP request (service uses an HTTP client), the 4xx errors and 5xx errors are failures.

This behavior is defined [in agent specification](https://github.com/elastic/apm/blob/main/specs/agents/tracing-instrumentation-http.md#outcome), with [examples in agent tests](https://github.com/elastic/apm/blob/main/tests/agents/gherkin-specs/outcome.feature#L48-L68)

---

<div class="post-metadata">

**Author:** ![dacothe](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dacothe](https://discuss.elastic.co/u/dacothe)\
**Post date:** [April 4, 2023, 7:20am UTC](https://discuss.elastic.co/t/apm-question-to-event-outcome-relationship-between-transaction-and-span/328363/3 "2023-04-04T07:20:04Z")

</div>

Hi Sylvain,

That sums it up - thank you for this clear explanation!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 25, 2023, 3:20am UTC](https://discuss.elastic.co/t/apm-question-to-event-outcome-relationship-between-transaction-and-span/328363/4 "2023-04-25T03:20:07Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
