Capture all traces & spans and custom configuration doubt

Hi All,

Am totally new to elastic apm and elastic search as well and am trying to evaluate elastic apm and its capabilities. Can someone please help to answer below queries

  1. how to capture trace and spans for all the request coming to server. By far I got to know that spans are captured if the span is greater or equal to span_frames_min_duration which is default 5ms. But can we make the agent to capture all spans and traces? and if we can how to do it and where?

  2. If i want to do some manual configuration like change the name for the transactions captured then how to do it and where to change the configuration. I saw documentation on public API but am since am so naive :sweat_smile: i dont understand how to use those configuration and where to put it.

Regards,
Gopikrishnan

how to capture trace and spans for all the request coming to server. By far I got to know that spans are captured if the span is greater or equal to span_frames_min_duration which is default 5ms. But can we make the agent to capture all spans and traces? and if we can how to do it and where?

span_frames_min_duration is not related to capturing spans, but rather is related to capturing stack traces when starting spans. See the docs here: Stacktrace configuration options | APM Java Agent Reference [1.x] | Elastic

By default the agents will sample all traces. You can control the sampling rate (transaction_sample_rate). Non-sampled traces will suppress spans. Sampled traces will include all spans, up to a maximum number of spans per transaction (transaction_max_spans, defaults to 500).

If i want to do some manual configuration like change the name for the transactions captured then how to do it and where to change the configuration. I saw documentation on public API but am since am so naive :sweat_smile: i dont understand how to use those configuration and where to put it.

You will need to modify your application code to use the public API, so to answer this fully we would need to know what language, what frameworks, etc. If for example you were using a Java servlet, you could modify your servlet to use the Java agent's public API, calling ElasticApm.currentTransaction, followed by Transaction.setName.

Thanks for the reply @axw.

By default the agents will sample all traces.

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 :woozy_face:

You will need to modify your application code to use the public API, so to answer this fully we would need to know what language, what frameworks, etc. If for example you were using a Java servlet, you could modify your servlet to use the Java agent's public API, calling ElasticApm.currentTransaction, followed by Transaction.setName.

so for the above statement it means that we have to modify the application code to include the public API correct ? is there any other way to do it from the elastic UI (Kibana) or through the agent properties ?

I can see there are alot of options available here to configure agent properties.

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

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:

If these don't help, you could alternatively configure Ingest Node to rewrite the transaction name field values. You would have to take care to rewrite associated metrics documents as well.

Thanks @axw.

It was very helpful. Lastly I saw the basic plan for elastic apm pricing and am able to get APM feature for free. So is it like elastic APM is free for lifetime? for any amount of data?

Yes, assuming you're self-managing the stack on your own hardware (i.e. "Standalone" on Subscriptions | Elastic Stack Products & Support | Elastic). The amount of data you store does not affect this.

So does basic have the alerting feature by any chance. What is the difference between Basic and Gold subscriptions? what i understand is basic doesn't have alerting and Gold has it.

You understand correctly -- the Alerting feature is Gold+.

To get a full comparison between the different subscription levels (Basic, Gold, Platinum), on the subscriptions page click "Expand all features".

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