Splunk Dev

splunk java agent

1234testtest
Path Finder

I have downloaded SplunkJavaAgent and set it to run in eclipse by giving arguments for javaagent during Tomcat startup and am getting events in Splunk through TCP but not what I want.

Following are the challenges I have.

*1. I would like to have method names, execution timings, call trace, application/thread stalls, errors/exceptions/throwables 2. Heap analysis

*

I am not sure if I am doing right in splunkagent.properties - giving the details of the file.

agent.app.name=Tomcat
agent.app.instance=MyJVM
agent.userEventTags=key1=value1,key2=value2
splunk.transport.internalQueueSize=10000
splunk.transport.impl=com.splunk.javaagent.transport.SplunkTCPTransport
splunk.transport.tcp.host=localhost
splunk.transport.tcp.port=5150
splunk.transport.tcp.maxQueueSize=5MB
splunk.transport.tcp.dropEventsOnQueueFull=false
trace.whitelist=com/myinit
trace.methodEntered=true
trace.methodExited=true
trace.classLoaded=true
trace.errors=true
trace.hprof=false
trace.hprof.tempfile=mydump.hprof
trace.hprof.frequency=6

trace.jmx=true
trace.jmx.configfiles=jmx
trace.jmx.default.frequency=6

**

And the output I get is

**
vax.management.openmbean.CompositeType(name=java.lang.management.MemoryUsage,items=((itemName=committed,itemType=javax.management.openmbean.SimpleType(name=java.lang.Long)),(itemName=init,itemType=javax.management.openmbean.SimpleType(name=java.lang.Long)),(itemName=max,itemType=javax.management.openmbean.SimpleType(name=java.lang.Long)),(itemName=used,itemType=javax.management.openmbean.SimpleType(name=java.lang.Long)))),contents={committed=15466496, init=12582912, max=67108864, used=15221296})}), [Survivor Space]=javax.management.openmbean.CompositeDataSupport(compositeType=javax.management.openmbean.CompositeType(name=Map,items=((itemName=key,itemType=javax.management.openmbean.SimpleType(name=java.lang.String)),(itemName=value,itemType=javax.management.openmbean.CompositeType(name=java.lang.management.MemoryUsage,items=((itemName=committed,itemType=javax.management.openmbean.SimpleType(name=java.lang.Long)),(itemName=init,itemType=javax.management.openmbean.SimpleType(name=java.lang.Long)),(itemName=max,itemType=javax.management.openmbean.SimpleType(name=java.lang.Long)),(itemName=used,itemType=javax.management.openmbean.SimpleType(name=java.lang.Long))))))),contents={key=Survivor Space,

3:43:08.024 PM

1365070388024 name=jmx event_id=splunkagent mbean_domain=java.lang mbean_property_name=Code Cache mbean_property_type=MemoryPool usageUsed=3579264 memManagerNames=[CodeCacheManager] usageInit=163840 memoryType=NON_HEAP peakUsageMax=33554432 usageMax=33554432 peakUsageCommitted=3604480 peakUsageUsed=3579264 colUsageMax= colUsageUsed= colUsageInit= name=Code Cache peakUsageInit=163840 colUsageCommitted= usageCommitted=3604480 appName=Tomcat appID=MyJVM key2=value2 key1=value1

Tags (1)
0 Karma

Damien_Dallimor
Ultra Champion

Go and get the latest code now :

https://github.com/damiendallimore/SplunkJavaAgent

0 Karma

Damien_Dallimor
Ultra Champion

It will be this week.

0 Karma

1234testtest
Path Finder

Hi Damien Dallimore, Kindly let me know if the update is available.

0 Karma

Damien_Dallimor
Ultra Champion

Give me a day or 2.

0 Karma

1234testtest
Path Finder

And also forgot to mention, there some ognl exceptions that were in the eclipse console...believe these also would go withthenew release

0 Karma

1234testtest
Path Finder

Thank you. If there is Any tentative timeline for the release, Pl let me know

0 Karma

Damien_Dallimor
Ultra Champion

I'm going to release an updated version to github. The JMX logic is a port of the engine from the Splunk for JMX app. When running in embedded mode with the SplunkJavaAgent the GCInfo Object returned from the java.lang GarbageCollector MBean is a different base type , hence the above object dump for the GC Mbean.

You should be able to see tracing details for all classes in the com/myinit package also (presuming those classes are getting classloaded) , the above config looks mostly ok. I'd drop the "agent.userEventTags" if you are not using it.

0 Karma

1234testtest
Path Finder

OS windows xp JVM java 7 tomcat 6 IDE eclipse ( running tomcat via eclipse)

0 Karma

Damien_Dallimor
Ultra Champion

Can you describe your environment: OS , Java Runtime , JVM type , were you running Tomcat standalone or via an IDE etc..

0 Karma

1234testtest
Path Finder

Am posting only part because of character restriction of comments. I havent made any changes to jmx.xml. I went through the site but as I couldnt get what are the minimum changes that need to be done - I didnt attempt it.







<attribute name="ThreadContentionMonitor

0 Karma

Damien_Dallimor
Ultra Champion

can you post a copy of the jmx.xml config you are using ?

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...