stagemonitor / stagemonitor-mailinglist

GitHub issues abused as a mailing list
3 stars 0 forks source link

Unable to get Call Tree tab #52

Closed mattjtodd closed 6 years ago

mattjtodd commented 7 years ago

Hi,

I'm trying to get the Call Tree working on a pretty vanilla 1.5.2 Spring Boot app, but to no avail. I'm following the instructions on the website to the letter I'm fairly sure (JDK 8 1.8.0_121) so no javaagent required as I understand. I can only see the Widget Settings, Configuration and Metrics tabs. I can see values appearing in the HTTP Requests and JVM subsections, but no Call Tree. Any suggestion about what could be missing?

felixbarny commented 7 years ago

Hi and thanks for trying out stagemonitor,

please paste the stagemonitor startup logs as explained here

mattjtodd commented 7 years ago

No problems, I've also created a very simple project and Docker to Illustrate the issue.

13:55:35.650 [main] INFO org.stagemonitor.core.Stagemonitor - Measurement Session is initialized: [application=stagemonitor] [instance="localhost"] [host=0d07adb74cec]
13:55:35.696 [main] INFO org.stagemonitor.core.CorePlugin - Not sending metrics to InfluxDB (url=null, interval=60s)
13:55:35.698 [main] INFO org.stagemonitor.core.CorePlugin - Not sending metrics to Elasticsearch (url=[], interval=60s)
13:55:35.708 [main] INFO org.stagemonitor.tracing.TracingPlugin - No OpenTracing implementation found. Falling back to NoopTracer. This is fine if you just want to use stagemonitor for development, for example with the in-browser-widget. If you want to report your traces to Elasticsearch, add a dependency to stagemonitor-tracing-elasticsearch. If you want to report to Zipkin, add stagemonitor-tracing-zipkin.
13:55:35.840 [main] INFO org.stagemonitor.core.Stagemonitor - # stagemonitor status
13:55:35.840 [main] INFO org.stagemonitor.core.Stagemonitor - System information: Java 1.8.0_141 (Oracle Corporation) Linux 4.9.41-moby
13:55:35.842 [main] INFO org.stagemonitor.core.Stagemonitor - OK   - Agent attachment
13:55:35.842 [main] INFO org.stagemonitor.core.Stagemonitor - OK   - CorePlugin (version 0.82.0)
13:55:35.842 [main] INFO org.stagemonitor.core.Stagemonitor - FAIL - DataSource instrumentation (No DataSource instrumented)
13:55:35.842 [main] INFO org.stagemonitor.core.Stagemonitor - FAIL - Elasticsearch (Elasticsearch is not available)
13:55:35.842 [main] INFO org.stagemonitor.core.Stagemonitor - OK   - JdbcPlugin (version 0.82.0)
13:55:35.842 [main] INFO org.stagemonitor.core.Stagemonitor - OK   - JvmPlugin (version 0.82.0)
13:55:35.842 [main] INFO org.stagemonitor.core.Stagemonitor - OK   - ServletPlugin (version 0.82.0)
13:55:35.843 [main] INFO org.stagemonitor.core.Stagemonitor - OK   - SoapTracingPlugin (version 0.82.0)
13:55:35.843 [main] INFO org.stagemonitor.core.Stagemonitor - OK   - TracingPlugin (version 0.82.0)
13:55:35.843 [main] INFO org.stagemonitor.core.Stagemonitor - # stagemonitor configuration, listing non-default values:
13:55:35.844 [main] INFO org.stagemonitor.core.Stagemonitor - stagemonitor.applicationName: stagemonitor (source: stagemonitor.properties)
13:55:35.844 [main] INFO org.stagemonitor.core.Stagemonitor - stagemonitor.instanceName: "localhost" (source: stagemonitor.properties)
13:55:35.844 [main] INFO org.stagemonitor.core.Stagemonitor - stagemonitor.instrument.include: com.mattjtodd.spring.stagemonitor (source: stagemonitor.properties)

Source project:

https://github.com/mattjtodd/spring-boot-stagemonitor

Docker Hub Image

https://hub.docker.com/r/mattjtodd/spring-boot-stagemonitor/

Thanks for looking!

felixbarny commented 7 years ago

Startup logs and config values are looking good.

I'll have a look at your example application. One problem with your demo application is that it does not serve html, thus the in browser widget won't be injected.

felixbarny commented 7 years ago

When adding stagemonitor.tracing.reporting.log=true to stagemonitor.properties, I see a working call tree in the logs.

felixbarny commented 7 years ago

By adding these properties you can force the call tree to not drop any fast executing methods:

stagemonitor.profiler.minExecutionTimePercent=0
stagemonitor.profiler.minExecutionTimeNanos=0

Then the log looks like this:

###########################
# Span report             #
###########################
# name: Index
# duration: 2.335075
###########################
# Tags                    #
###########################
# duration_cpu_ms: 2.372
# instance: "localhost"
# http.headers.accept-language: de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4
# tracking.unique_visitor_id: fcb892954c8a5bec9c898e94a6f003a2c52f557c
# http.url: /index
# type: http
# http.headers.accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
# internal_track_metrics_per_operation_name: true
# bytes_written: 75
# http.headers.cache-control: max-age=0
# http.headers.connection: keep-alive
# http.headers.host: localhost:8080
# span.kind: server
# host: N51.local
# call_tree_ascii: ----------------------------------------------------------------------
Selftime (ms)              Total (ms)                 Method signature
----------------------------------------------------------------------
000000.45  018% █▓░░░░░░░░ 000002.46  100% ██████████ Index
000001.95  079% ███████▓░░ 000002.01  082% ████████░░ └── void org.springframework.web.servlet.FrameworkServlet.service(HttpServletRequest,HttpServletResponse)
000000.00  000% ░░░░░░░░░░ 000000.07  003% ░░░░░░░░░░     └── String com.mattjtodd.spring.stagemonitor.Controller.index()
000000.06  002% ░░░░░░░░░░ 000000.06  002% ░░░░░░░░░░         └── String com.mattjtodd.spring.stagemonitor.Repository.getUUID()

# method: GET
# http.headers.user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36
# peer.port: 52803
# peer.ipv6: 0:0:0:0:0:0:0:1
# http.status_code: 200
# http.headers.accept-encoding: gzip, deflate, br
# application: stagemonitor
# stagemonitor.version: 0.82.0
# http.headers.upgrade-insecure-requests: 1
###########################
felixbarny commented 7 years ago

When slightly modifying the Controller like this:

@RequestMapping("/index")
public String index() {
    return "<html><body>"+repository.getUUID() + " : " + UUID + "</body></html>";
}

The in browser widget will be injected and it also contains the call tree.

mattjtodd commented 7 years ago

That's great I can see this in sout now.

Is it possible to get the call-stack in the widget without the HTML wrapper? The service this is distilled from just serves JSON payloads.

felixbarny commented 7 years ago

But how do you open the widget then? Via /stagemonitor? In this view, you can't see call trees. One option would be to install Elasticsearch and Kibana where you can then see all the traces.