stagemonitor / stagemonitor

an open source solution to application performance monitoring for java server applications
www.stagemonitor.org
Apache License 2.0
1.71k stars 290 forks source link

Call tree tab not visible #310

Open prabuj201987 opened 7 years ago

prabuj201987 commented 7 years ago

Hi, I am running a sample Hello world spring boot web application with stage monitor. Below is my startup log.

org.stagemonitor.core.Stagemonitor - Measurement Session is initialized: [application=app-monitor] [instance=StageMonitor Demo] [host=01HW247107]
org.stagemonitor.core.util.HttpClient$ErrorLoggingResponseHandler - http://192.168.xxx.xxx:9200/.kibana: 400 {"error":{"root_cause":[{"type":"index_already_exists_exception","reason":"index [.kibana/h4n7IjZpRZOHoMoYOeVYgA] already exists","index_uuid":"h4n7IjZpRZOHoMoYOeVYgA","index":".kibana"}],"type":"index_already_exists_exception","reason":"index [.kibana/h4n7IjZpRZOHoMoYOeVYgA] already exists","index_uuid":"h4n7IjZpRZOHoMoYOeVYgA","index":".kibana"},"status":400}
org.stagemonitor.core.util.HttpClient$ErrorLoggingResponseHandler - http://192.168.xxx.xxx:9200/.kibana/_mapping/index-pattern: 400 {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [timeFieldName] of different type, current_type [keyword], merged_type [text]"}],"type":"illegal_argument_exception","reason":"mapper [timeFieldName] of different type, current_type [keyword], merged_type [text]"},"status":400}
org.stagemonitor.core.util.HttpClient$ErrorLoggingResponseHandler - http://192.168.xxx.xxx:9200/.kibana/_mapping/search: 400 {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [columns] of different type, current_type [keyword], merged_type [text]"}],"type":"illegal_argument_exception","reason":"mapper [columns] of different type, current_type [keyword], merged_type [text]"},"status":400}
org.stagemonitor.core.util.HttpClient$ErrorLoggingResponseHandler - http://192.168.xxx.xxx:9200/.kibana/_mapping/dashboard: 400 {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [timeTo] of different type, current_type [keyword], merged_type [text]"}],"type":"illegal_argument_exception","reason":"mapper [timeTo] of different type, current_type [keyword], merged_type [text]"},"status":400}
org.stagemonitor.core.util.HttpClient$ErrorLoggingResponseHandler - http://192.168.xxx.xxx:9200/.kibana/_mapping/visualization: 400 {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"mapper [savedSearchId] of different type, current_type [keyword], merged_type [text]"}],"type":"illegal_argument_exception","reason":"mapper [savedSearchId] of different type, current_type [keyword], merged_type [text]"},"status":400}
org.stagemonitor.core.grafana.GrafanaClient - Not requesting grafana, because the url or the api key is not configured.
org.stagemonitor.core.grafana.GrafanaClient - Not requesting grafana, because the url or the api key is not configured.
org.stagemonitor.core.CorePlugin - Not sending metrics to InfluxDB (url=null, interval=60s)
org.stagemonitor.core.CorePlugin - Sending metrics to Elasticsearch ([http://192.168.xxx.xxx:9200]) every 60s
org.stagemonitor.core.grafana.GrafanaClient - Not requesting grafana, because the url or the api key is not configured.
org.stagemonitor.core.grafana.GrafanaClient - Not requesting grafana, because the url or the api key is not configured.
org.stagemonitor.core.grafana.GrafanaClient - Not requesting grafana, because the url or the api key is not configured.
org.stagemonitor.core.Stagemonitor - # stagemonitor status
org.stagemonitor.core.Stagemonitor - System information: Java 1.8.0_111 (Oracle Corporation) Windows 7 6.1
org.stagemonitor.core.Stagemonitor - OK   - Agent attachment 
org.stagemonitor.core.Stagemonitor - OK   - CorePlugin (version 0.82.0)
org.stagemonitor.core.Stagemonitor - FAIL - DataSource instrumentation (No DataSource instrumented)
org.stagemonitor.core.Stagemonitor - OK   - Elasticsearch 
org.stagemonitor.core.Stagemonitor - OK   - ElasticsearchTracingPlugin (version 0.82.0)
org.stagemonitor.core.Stagemonitor - OK   - JdbcPlugin (version 0.82.0)
org.stagemonitor.core.Stagemonitor - OK   - JvmPlugin (version 0.82.0)
org.stagemonitor.core.Stagemonitor - OK   - ServletPlugin (version 0.82.0)
org.stagemonitor.core.Stagemonitor - OK   - SoapTracingPlugin (version 0.82.0)
org.stagemonitor.core.Stagemonitor - OK   - TracingPlugin (version 0.82.0)
org.stagemonitor.core.Stagemonitor - # stagemonitor configuration, listing non-default values:
org.stagemonitor.core.Stagemonitor - stagemonitor.applicationName: app-monitor (source: stagemonitor.properties)
org.stagemonitor.core.Stagemonitor - stagemonitor.instanceName: StageMonitor Demo (source: stagemonitor.properties)
org.stagemonitor.core.Stagemonitor - stagemonitor.reporting.elasticsearch.url: http://192.168.xxx.xxx:9200 (source: stagemonitor.properties)
org.stagemonitor.core.Stagemonitor - stagemonitor.instrument.include: com.app.monitor (source: stagemonitor.properties)

Problems:

  1. Unable to see the widget.
  2. When i go to the url for stagemonitor (http://192.168.xxx.xxx:7380/stagemonitor) could not see below tabs
    • Call Tree
    • Request
    • Alerts What should i do to enable these tabs?
felixbarny commented 7 years ago

The widget will only be injected on html pages. What kind of content is you application serving? JSON?

The Call Tree and Request tabs are not available when accessing the /stagemonitor url as there is no particular request attached to it.

To enable the alerts tab, you have to include the stagemonitor-alerting plugin.

prabuj201987 commented 7 years ago

I tried adding the widget in one of my existing web application which is running on tomcat 7. I could see the widget but no response upon clicking it? kindly advice.

felixbarny commented 7 years ago

Any JS errors in the console?

prabuj201987 commented 7 years ago

Yes there is an

Uncaught SyntaxError: Unexpected number

in below line.

data = {"duration_cpu_ms":998.4064,"instance":192.168.x.x,"http.headers.accept-language":en-US,en;q=0.8,"tracking.unique_visitor_id":7ad9483e97a3f1882a08a1831c3d7967f85d28e7,"http.url":/app-monitor/,"type":http,"http.headers.accept":text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,"http.headers.pragma":no-cache,","http.headers.cache-control":no-cache,"http.headers.connection":keep-alive,"http.headers.host":192.168.x.x:7180,"span.kind":server,"host":xxxxxxxxx,"id":84c671a6004d97fa,"jdbc_get_connection_count":2,"trace_id":84c671a6004d97fa,"method":GET,"http.headers.user-agent":Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36,"session_id":69489BC8DA1817D46323ABB0FEE04F39,"peer.port":60688,"peer.ipv4":-105,"http.status_code":200,"http.headers.accept-encoding":gzip, deflate,"application":My-Application,"call_tree_json":{"signature":"Hello Thyme","executionTime":4231460295,"children":[{"signature":"","executionTime":177440654,"children":[],"ioquery":true,"netExecutionTime":177440654,"shortSignature":""},{"signature":"","executionTime":194076506,"children":[],"ioquery":true,"netExecutionTime":194076506,"shortSignature":""},{"signature":"void org.springframework.web.servlet.FrameworkServlet.service(HttpServletRequest,HttpServletResponse)","executionTime":571366733,"children":[{"signature":"void org.springframework.web.servlet.DispatcherServlet.render(ModelAndView,HttpServletRequest,HttpServletResponse)","executionTime":533597640,"children":[],"ioquery":false,"netExecutionTime":533597640,"shortSignature":"DispatcherServlet#render"}],"ioquery":false,"netExecutionTime":37769093,"shortSignature":"FrameworkServlet#service"}],"ioquery":false,"netExecutionTime":3288576402,"shortSignature":null},"stagemonitor.version":0.82.0,"gc_time_ms":33,"jdbc_connection_wait_time_ms":2912.365781,"http.headers.upgrade-insecure-requests":1,"peer.ipv4_string":192.168.x.x,"error":false,"name":"Hello Thyme","duration_ms":4251.690156,"@timestamp":"2017-09-01T15:11:52.985+0530"},

felixbarny commented 7 years ago

That's a strange one..

Could you send me the whole html page? If you don't want to post it publicly, you can send me a mail to felix(dot)barnsteiner(at)isys.de

wscheele commented 6 years ago

I have a very similar issue. The problem appears to be that the values in the data object embedded in stagemonitor init is not quoted:

function init() {
    var stagemonitorOverlayShow = document.getElementById("stagemonitor-overlay-show"),
    stagemonitorOverlay = document.getElementById("stagemonitor-overlay"),
    data = {"duration_cpu_ms":29.839661,"instance":dev,"http.headers.accept-language":en-US,en;q=0.8,

Note specifically: "http.headers.accept-language":en-US,en;q=0.8, where the (;) causes the syntax error in my case (Uncaught SyntaxError: Unexpected token ;).

felixbarny commented 6 years ago

I don't think the quoting is the problem. When I view the source in chrome i get this:

function init() {
  var stagemonitorOverlayShow = document.getElementById("stagemonitor-overlay-show"),
  stagemonitorOverlay = document.getElementById("stagemonitor-overlay"),
  data = {"duration_cpu_ms":1.567337,"http.headers.accept-language":"de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7"
pkgajulapalli commented 6 years ago

I'm also not able to see Call Tree in http://localhost:8888/stagemonitor.

And spring boot logs are,

o.s.tracing.soap.SoapHandlerTransformer : Adding SOAPHandlers [org.stagemonitor.tracing.soap.TracingServerSOAPHandler@6cc558c6, org.stagemonitor.tracing.soap.TracingClientSOAPHandler@15713d56] org.stagemonitor.core.Stagemonitor : Measurement Session is initialized: [application=asn_dashboard] [instance="localhost"] [host=m-C02RP2M2G8WN] org.stagemonitor.core.CorePlugin : Not sending metrics to InfluxDB (url=null, interval=60s) org.stagemonitor.core.CorePlugin : Not sending metrics to Elasticsearch (url=[], interval=60s) org.stagemonitor.tracing.TracingPlugin : No OpenTracing implementation found. Falling back to DefaultTracerImpl. 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. org.stagemonitor.core.Stagemonitor : # stagemonitor status org.stagemonitor.core.Stagemonitor : System information: Java 1.8.0_101 (Oracle Corporation) Mac OS X 10.12.6 org.stagemonitor.core.Stagemonitor : OK - Agent attachment org.stagemonitor.core.Stagemonitor : OK - CorePlugin (version 0.85.0) org.stagemonitor.core.Stagemonitor : FAIL - Elasticsearch (Elasticsearch is not available) org.stagemonitor.core.Stagemonitor : OK - JdbcPlugin (version 0.85.0) org.stagemonitor.core.Stagemonitor : OK - JvmPlugin (version 0.85.0) org.stagemonitor.core.Stagemonitor : OK - ServletPlugin (version 0.85.0) org.stagemonitor.core.Stagemonitor : OK - SoapTracingPlugin (version 0.85.0) org.stagemonitor.core.Stagemonitor : OK - Startup org.stagemonitor.core.Stagemonitor : OK - TracingPlugin (version 0.85.0) org.stagemonitor.core.Stagemonitor : # stagemonitor configuration, listing non-default values: org.stagemonitor.core.Stagemonitor : stagemonitor.profiler.minExecutionTimeNanos: 0 (source: stagemonitor.properties) org.stagemonitor.core.Stagemonitor : stagemonitor.profiler.minExecutionTimePercent: 0 (source: stagemonitor.properties) org.stagemonitor.core.Stagemonitor : stagemonitor.tracing.reporting.log: true (source: stagemonitor.properties) org.stagemonitor.core.Stagemonitor : stagemonitor.applicationName: my_app_name (source: stagemonitor.properties) org.stagemonitor.core.Stagemonitor : stagemonitor.instanceName: "localhost" (source: stagemonitor.properties) org.stagemonitor.core.Stagemonitor : stagemonitor.instrument.include: com (source: stagemonitor.properties)

In the html page, I can see that call tree tab is there but it is hidden by default. Even if I change the html, it is getting hidden on clicking it.

<li id="call-stack-tab" class="" style="display: none;"> <a href="#stagemonitor-home" role="tab" data-toggle="tab" class="tip" data-placement="bottom" title="" data-original-title="View method call tree of the current request including SQL statements" aria-expanded="true"> Call Tree </a> </li>

wscheele commented 6 years ago

had just encountered this issue again with a coworker on a different branch. we managed to pinpoint it to a bug in jackson. upgrade of jackson resolved the issue (with the "Unexpected token" manifestation i commented about earlier).

benterprise commented 6 years ago

I also cannot see the call tree tab, just Widget Settings, Configuration, Metrics and Alerts.

I have these in my pom

    <dependency>
        <groupId>org.stagemonitor</groupId>
        <artifactId>stagemonitor-web-servlet</artifactId>
        <version>0.88.4</version>
    </dependency>

    <dependency>
        <groupId>org.stagemonitor</groupId>
        <artifactId>stagemonitor-tracing</artifactId>
        <version>0.88.4</version>
    </dependency>

    <dependency>
        <groupId>org.stagemonitor</groupId>
        <artifactId>stagemonitor-logging</artifactId>
        <version>0.88.4</version>
    </dependency>

    <dependency>
        <groupId>org.stagemonitor</groupId>
        <artifactId>stagemonitor-jvm</artifactId>
        <version>0.88.4</version>
    </dependency>

    <dependency>
        <groupId>org.stagemonitor</groupId>
        <artifactId>stagemonitor-alerting</artifactId>
        <version>0.88.4</version>
    </dependency>

    <dependency>
        <groupId>org.stagemonitor</groupId>
        <artifactId>stagemonitor-core</artifactId>
        <version>0.88.4</version>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>4.0.1</version>
        <scope>provided</scope>
    </dependency>