Using the BackendMarker in the APM Java Agent
search cancel

Using the BackendMarker in the APM Java Agent

book

Article ID: 10309

calendar_today

Updated On:

Products

CA Application Performance Management (APM / Wily / Introscope) DX Application Performance Management

Issue/Introduction

 This KB provides an example how to use BackendMarker 



Environment

DX APM Java Agent 10.x

Resolution

 1. Create a HelloWorld Dummy application:

import java.util.*;
import java.text.*;
public class ProbedHelloWorld {   

    SimpleDateFormat sdf_ = new SimpleDateFormat();

    Date date_ = new Date();   

    public ProbedHelloWorld() throws Exception {

        Thread.sleep(1000);       

        Properties prop = System.getProperties();

        prop.list(System.out);               

        while (true) {

            callA(1000);

        }

    }  

    public void callA(long time) throws Exception {

        date_.setTime(System.currentTimeMillis());       

        System.out.println(sdf_.format(date_) + " Still running...");       

        Thread.sleep(time);

    }

 

    public static void main(String args[]) throws Exception {

        new ProbedHelloWorld();

    }

}

 

 2. Create a custom PBD: HW.pbd

TurnOn: MyCustomTracerGroup
SetFlag: MyCustomTracerGroup
IdentifyClassAs: ProbedHelloWorld MyCustomTracerGroup
IdentifyInheritedAs: ProbedHellowWorld MyCustomTracerGroup
TraceOneMethodOfClass: ProbedHelloWorld callA BackendMarker "{classname}|{method}"

 

 3. Add HW.pbd to the IntroscopeAgent.profile:

introscope.autoprobe.directivesFile=default-typical-legacy.pbl,hotdeploy,HW.pbd


4. Restart the JVM to instrument the backend metric.


5. Review the result in the Metric Browser:

Additional Information

Attachments

1558704369908000010309_sktwi1f5rjvs16qhv.jpeg get_app