# Capture all traces & spans and custom configuration doubt

**URL:** <https://discuss.elastic.co/t/capture-all-traces-spans-and-custom-configuration-doubt/204362>\
**Category:** APM\
**Tags:** java\
**Created:** [October 20, 2019, 3:45pm UTC](https://discuss.elastic.co/t/capture-all-traces-spans-and-custom-configuration-doubt/204362 "2019-10-20T15:45:09Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![axw](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/axw/32/28197_2.png) [@axw](https://discuss.elastic.co/u/axw)\
**Post date:** [October 22, 2019, 3:46am UTC](https://discuss.elastic.co/t/capture-all-traces-spans-and-custom-configuration-doubt/204362/4 "2019-10-22T03:46:26Z")

</div>

> [@gopikrishnan](#):
>
> the remaining statements surrounding this statement I understood but except this. If and all agent samples all traces then as per below image for 10 requests why there is only one trace sample where it should have been 10 samples for each I guess. Sorry if am mixing things up 🥴

In the "Transactions duration distribution" histogram, hover over the buckets (latency ranges) and you will see how many transactions were captured for that latency range.

When you click on a bucket, you'll be presented with a single sample trace/transaction which falls into that bucket. There is another ongoing Discuss thread regarding being able to look at multiple trace samples: [Look at more than one sampled trace](https://discuss.elastic.co/t/look-at-more-than-one-sampled-trace/203920)

> so for the above statement it means that we have to modify the application code to include the public API correct ?

Correct.

> is there any other way to do it from the elastic UI (Kibana) or through the agent properties ?

For the Java agent specifically, there are a couple of agent properties that may be relevant to your use case:

- [use\_path\_as\_transaction\_name](https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-use-path-as-transaction-name)
- [url\_groups](https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-url-groups)

If these don't help, you could alternatively configure [Ingest Node](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/ingest.html) to rewrite the transaction name field values. You would have to take care to rewrite associated metrics documents as well.

---

_[View the full topic](https://discuss.elastic.co/t/capture-all-traces-spans-and-custom-configuration-doubt/204362)._
