# Does elastic.apm.span\_frames\_min\_duration setting apply?

**URL:** <https://discuss.elastic.co/t/does-elastic-apm-span-frames-min-duration-setting-apply/217187>\
**Category:** APM\
**Tags:** java\
**Created:** [January 30, 2020, 12:52pm UTC](https://discuss.elastic.co/t/does-elastic-apm-span-frames-min-duration-setting-apply/217187 "2020-01-30T12:52:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yungyoung\_Ok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yungyoung_ok/32/43465_2.png) [@Yungyoung\_Ok](https://discuss.elastic.co/u/Yungyoung_Ok)\
**Post date:** [January 30, 2020, 12:52pm UTC](https://discuss.elastic.co/t/does-elastic-apm-span-frames-min-duration-setting-apply/217187/1 "2020-01-30T12:52:56Z")

</div>

If you are asking about a problem you are experiencing, please use the following template, as it will help us help you. If you have a different problem, please delete all of this text 🙂

**Kibana version** :7.5.2

**Elasticsearch version** :7.5.2

**APM Server version** :7.5.2

**APM Agent language and version** :apm-java-agent-1.12.0, java 1.8

**Browser version** :chrome 79.9.3945.130

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:

**Fresh install or upgraded from other version?**

**Is there anything special in your setup?** For example, are you using the Logstash or Kafka outputs? Are you using a load balancer in front of the APM Servers? Have you changed index pattern, generated custom templates, changed agent configuration etc.

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
I thought some span was due to short duration time because it was not visible.  
So, i add properties.  
But Stacktrace does not appear even though I have added elastic.apm.span\_frames\_min\_duration = 0ms to the elasticapm.properties file.

here is my config

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/5/85edfe95604175fee20aefe679906a99586a242f.png)

and result

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/5/b5911b6129002fa05918a4f7a67e85e2ad3ab586.png)

How should I set to see stacktrace for all tasks?

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [January 30, 2020, 1:10pm UTC](https://discuss.elastic.co/t/does-elastic-apm-span-frames-min-duration-setting-apply/217187/2 "2020-01-30T13:10:52Z")

</div>

From [the documentation](https://www.elastic.co/guide/en/apm/agent/java/current/config-stacktrace.html#config-span-frames-min-duration):

> To disable stack trace collection for spans completely, set the value to `0ms`

The minimal value is `1ms` and that's on purpose- collecting the stack trace has considerable overhead and shouldn't be collected for too many spans.

---

<div class="post-metadata">

**Author:** ![Yungyoung\_Ok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yungyoung_ok/32/43465_2.png) [@Yungyoung\_Ok](https://discuss.elastic.co/u/Yungyoung_Ok)\
**Post date:** [January 31, 2020, 1:06am UTC](https://discuss.elastic.co/t/does-elastic-apm-span-frames-min-duration-setting-apply/217187/3 "2020-01-31T01:06:22Z")

</div>

thank you!  
However, despite changing the settings, stacktrace is not visible.

span\_frames\_min\_duration=-1ms

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/f/0/f0b862b7308281fb7d2adee6932901848872bda2.png)

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/8/f/8f081998f97f1aba46a617df0cdfb8b798be6380.png)

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [January 31, 2020, 3:14pm UTC](https://discuss.elastic.co/t/does-elastic-apm-span-frames-min-duration-setting-apply/217187/4 "2020-01-31T15:14:21Z")

</div>

Could you set your `log_level` to `debug` and upload the agents logs? I'd like to verify that the configuration option was detected correctly.

See also [https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html](https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html)

---

<div class="post-metadata">

**Author:** ![Yungyoung\_Ok](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yungyoung_ok/32/43465_2.png) [@Yungyoung\_Ok](https://discuss.elastic.co/u/Yungyoung_Ok)\
**Post date:** [February 2, 2020, 4:52am UTC](https://discuss.elastic.co/t/does-elastic-apm-span-frames-min-duration-setting-apply/217187/5 "2020-02-02T04:52:51Z")

</div>

Looking at the log, it seems that all the settings are applied correctly.  
Here is my log.....

```
2020-02-02 13:47:16.520 [apm-server-healthcheck] DEBUG co.elastic.apm.agent.report.ApmServerHealthChecker - Starting healthcheck to http://my-apm-server-ip:8200/
2020-02-02 13:47:16.534 [apm-server-healthcheck] INFO co.elastic.apm.agent.report.ApmServerHealthChecker - Elastic APM server is available: { "build_date": "2020-01-15T10:21:12Z", "build_sha": "0683f8094f42fecedd54cee09c0991febd8ce59a", "version": "7.5.2"}
2020-02-02 13:47:16.536 [apm-server-healthcheck] DEBUG co.elastic.apm.agent.report.ApmServerHealthChecker - APM server http://my-apm-server-ip:8200/ version is: 7.5.2
2020-02-02 13:47:17.052 [main] DEBUG co.elastic.apm.agent.impl.payload.SystemInfo - container ID is null
2020-02-02 13:47:17.070 [main] INFO co.elastic.apm.agent.configuration.StartupInfo - Starting Elastic APM 1.12.0 as mms on Java 1.8.0_231 (Oracle Corporation) Windows 10 10.0
2020-02-02 13:47:17.071 [main] DEBUG co.elastic.apm.agent.configuration.StartupInfo - service_name: 'my-service' (source: path/to/file/elasticapm.properties)
2020-02-02 13:47:17.071 [apm-remote-config-poller] DEBUG co.elastic.apm.agent.configuration.ApmServerConfigurationSource - Reloading configuration from APM Server http://my-apm-server-ip:8200/config/v1/agents
2020-02-02 13:47:17.071 [main] DEBUG co.elastic.apm.agent.configuration.StartupInfo - config_file: 'path/to/file/elasticapm.properties' (source: Java System Properties)
2020-02-02 13:47:17.071 [main] DEBUG co.elastic.apm.agent.configuration.StartupInfo - server_urls: 'http://my-apm-server-ip:8200' (source: path/to/file/elasticapm.properties)
2020-02-02 13:47:17.071 [main] DEBUG co.elastic.apm.agent.configuration.StartupInfo - application_packages: 'my.package.name' (source: path/to/file/elasticapm.properties)
2020-02-02 13:47:17.071 [main] DEBUG co.elastic.apm.agent.configuration.StartupInfo - span_frames_min_duration: '-1ms' (source: path/to/file/elasticapm.properties)
2020-02-02 13:47:17.071 [main] DEBUG co.elastic.apm.agent.configuration.StartupInfo - log_level: 'DEBUG' (source: path/to/file/elasticapm.properties)
2020-02-02 13:47:17.071 [main] DEBUG co.elastic.apm.agent.configuration.StartupInfo - use_path_as_transaction_name: 'true' (source: path/to/file/elasticapm.properties)

```

Also, even though the 'use\_path\_as\_transaction\_name: true' setting is applied, the transaction name appears as shown below.

![image](https://us1.discourse-cdn.com/elastic/original/3X/7/d/7d44aa4f120f51147f83013156617a1719a187a0.png)

How can I represent a transaction name exactly like a url?

---

<div class="post-metadata">

**Author:** ![Eyal\_Koren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eyal_koren/32/36830_2.png) [@Eyal\_Koren](https://discuss.elastic.co/u/Eyal_Koren)\
**Post date:** [February 2, 2020, 6:48am UTC](https://discuss.elastic.co/t/does-elastic-apm-span-frames-min-duration-setting-apply/217187/6 "2020-02-02T06:48:22Z")

</div>

Can you look whether there is additional place where you set the `span_frames_min_duration` config (e.g. system properties or environment variables)?  
If you can provide the entire log from startup to the point your application is running some traces, that might help.

From the [`use_path_as_transaction_name` documentation](https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-use-path-as-transaction-name):

> If set to `true` , transaction names **of unsupported Servlet API-based frameworks** will be in the form of `$method $path` instead of just `$method` .

Meaning - since you are using a supported framework, we use that for naming. You need to turn off the instrumentation that captures your traces. See [`disable_instrumentations`](https://www.elastic.co/guide/en/apm/agent/java/current/config-core.html#config-disable-instrumentations) on how to do that. For example, if you are using JAX-RS, you need to set `disable_instrumentations=jax-rs` in addition to `use_path_as_transaction_name=true`, however, read through all these and understand the implications. You may prefer sticking to the existing names.

---

<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:** [February 23, 2020, 2:48am UTC](https://discuss.elastic.co/t/does-elastic-apm-span-frames-min-duration-setting-apply/217187/7 "2020-02-23T02:48:23Z")

</div>

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