Doubts on Class exclusion

Hey,
In my application, I have specified to exclude a DAO class (extending hibernate dao) using classes_excluded_from_instrumentation.

When I see the dashboard, I can still the db calls via that class instrumented. Am I missing something here.

Also, the dropwizard by default exposes its health check rest endpoint on adminport.
I don't want to instrument any calls coming on this admin port. Is there a way for me to do this.

How are the DAO spans created? If you're using profiler-inferred spans, you have to exclude the classes with this option: https://www.elastic.co/guide/en/apm/agent/java/current/config-profiling.html#config-profiling-inferred-spans-excluded-classes

You can ignore certain paths like /admin*: https://www.elastic.co/guide/en/apm/agent/java/current/config-http.html#config-ignore-urls

This worked out well. Thank you

I am not using profiler-inferred spans. Its a simple span which is getting created as part of my API execution.

In my configuration, I have given the entry like this
"classes_excluded_from_instrumentation": "com.dao.*"

But still, I am getting spans for all APIs which are executing the classes inside this dao.* packages
See the sample entity in the span, that is queried by the class inside this dao package.


If you want to disable JDBC query spans, you can set disable_instrumentations to experimental,jdbc

T

This will disable the jdbc instrumentation for all the classes. My requirement was that I wanted to disable the JDBC instrumentation / HTTP Instrumentation for the specific classes.

Seems like the behaviour of classes exclusion is it only disables the @Capturespan, @CaptureTransaction which are explicitly added to those classes and any inherent instrumentation like JDBC, HTTP will get instrumented irrespective of whether you exclude the class or not.

We don't instrument your application dao classes, but the JDBC driver. That's why excluding your dao classes from instrumentation doesn't have any effect.

We don't have a feature to disable JDBC spans if the calls originate from a specific class. The closest thing we have is setting ignore_urls.

Could you explain your use case including why you want to exclude JDBC spans in certain cases?

My use case is, there are certain DAO in my app which query tables which are quite business-sensitive, hence I don't want its table internals to be exposed via the APM span instrumentation.

But there are other DAO classes in the same app, which query tables which are not so business-sensitive and hence capturing the spans are ok.

You could define a custom ingest node pipeline and drop the query if the db query contains a certain sensitive table name.

If you don't want the information to leave the host, you could deploy APM Server on your host and use processors to drop the field that stores the query.

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