• Documentation
  • Tutorials
  • Case studies
  • White papers
  • Product

What's on this Page

  • Key concepts
  • Activating an existing capture tracer
  • Creating your own capture tracers
  • Demo
 > Exense Resource Repository for Djigger
Categories: USER DOCUMENTATION

Object Content Capture

Key concepts

While sampling and distributed tracing will help you understand where time in spent, it might not be enough to figure out *why *it is spent in these layers. For instance, if you’ve been able to figure out that most of the time is being spent in the database layer, it could be very useful to know which SQL statement(s) are responsible for the slow response times.

This is what object inspections can do for you.

Activating an existing capture tracer

The approach used is similar to what we’ve covered in the Distributed Tracing section. We’ll activate a tracer and assign it to target classes which will be candidates for instrumentation, just like in the case of any other subscription.

Here’s our config file for the SQL tracer example:

 <subscriptions>
    <io.djigger.monitoring.java.instrumentation.subscription.RegexSubscription>
        <classNamePattern>
            <pattern>.*SQLTracerTest</pattern>
            <flags>0</flags>
        </classNamePattern>
        <methodNamePattern>
            <pattern>.*</pattern>
            <flags>0</flags>
        </methodNamePattern>
        <tagEvent>true</tagEvent>
    </io.djigger.monitoring.java.instrumentation.subscription.RegexSubscription>
    <io.djigger.monitoring.java.instrumentation.subscription.SQLConnectionTracer/>
    <io.djigger.monitoring.java.instrumentation.subscription.SQLStatementTracer/>
    <io.djigger.monitoring.java.instrumentation.subscription.SQLPreparedStatementTracer/>
</subscriptions>
Notice that in this example, we're activating multiple tracers, due to the fact that SQL queries can originate from multiple types of classes in Java, each requiring their own transformation approach.

Creating your own capture tracers

Using the SQLConnection tracer as an example, we’ll use javaassist to inspect the arguments of methods *prepareStatement() and prepareCall()* and we’ll attach the data to the corresponding instrumentation event and send the resulting information back to the collector.

Please refer to the SQLConnectionTracer class for more details on how to implement object inspection and capture.

Demo

Once an object capture tracer is activated, the corresponding data will simply be displayed in the Data column of the event.

After starting your collector, run the SQLTracerTest example, fire a search over the last 5 minutes, and you should start seeing SQL-related events with the associated query in the Data column:

  • Getting Started
    • Overview
    • Links
    • FAQ
  • Whats new?
    • Release notes
    • Roadmap
    • Weekly news
  • Installation guide
    • Installation
    • Permanent monitoring
  • User interface guide
    • Core functionalities
    • Pseudo events & JMX metrics
  • Instrumentation guide
    • Bytecode Instrumentation
    • Object Content Capture
    • Distributed Transaction Tracing
  • Resources
    • Tutorials
    • Case Studies
    • White papers
    • Libraries
Step Logo
    • Documentation
    • Tutorials
    • Case studies
    • White papers
    • Product
    • Getting Started
    • Whats new?
    • Installation guide
    • User interface guide
    • Instrumentation guide
    • Resources