How to ignore certain spans

I'm using Elastic Cloud and very pleased with it so far. However I've come with a requirement that I can't seem to find a solution for. Is someone able to point in the right direction?

The application uses Mysql and H2, and all queries are being logged, however I don't want the H2 queries logged within a transaction, is it possible to permentently ignore certain types of spans somehow? Either in the Kibana view, or not sending them in the first place? disable_instrumentations allows me to disable jdbc, but I only want to disable a specific DB type.


Hey and welcome to the forum!

One option to deal with this is through ingestion - check out the ingest node pipelines. The drop processor should fulfil your needs.

Another option is to exclude the H2 driver classes from instrumentation at the agent itself - try to set classes_excluded_from_instrumentation with the H2 driver base package (if you use as System property, the property name would be elastic.apm.classes_excluded_from_instrumentation). For example - classes_excluded_from_instrumentation=org.h2.*

I hope this helps.

I corrected the example above, as theclasses_excluded_from_instrumentation config needs to be set with wildcards in order to exclude packages.

Brilliant. That sorts it :ok_hand:
classes_excluded_from_instrumentation is a most useful addition.

However, I can't find any mention of it in the docs? Is it something you don't normally want people to use?

Currently it's a hidden config, and by setting it you actually overrode the defaults, but if you don't get anything instrumented that you don't want - this is not a problem.
We intend to expose it soon, it just requires a small change so it wouldn't override the defaults. Once we do that, it will be documented as well.
Thanks for the feedback!