smartcat-labs / cassandra-diagnostics

Cassandra Node Diagnostics Tools
Apache License 2.0
51 stars 6 forks source link

Slow Query Module - statement not logged #296

Open milannister opened 6 years ago

milannister commented 6 years ago

vagrant@192:~$ curl localhost:8998/version 1.4.10

cassandra-diagnostics.yml:

global:
  systemName: "smartcat-cassandra-cluster"

reporters:
  - reporter: io.smartcat.cassandra.diagnostics.reporter.LogReporter

modules:
  - module: io.smartcat.cassandra.diagnostics.module.heartbeat.HeartbeatModule
    measurement: heartbeat
    options:
      period: 15
      timeunit: MINUTES
    reporters:
      - io.smartcat.cassandra.diagnostics.reporter.LogReporter
  - module: io.smartcat.cassandra.diagnostics.module.slowquery.SlowQueryModule
    measurement: slow_query #optional
    options:
      slowQueryThresholdInMilliseconds: 20 #optional
      slowQueryReportEnabled: true #optional
      slowQueryCountReportEnabled: true #optional
      slowQueryCountReportPeriod: 30 #optional
      slowQueryCountReportTimeunit: SECONDS #optional
      queryTypesToLog: # optional
        - ALL

Line in the log:

INFO  [cassandra-diagnostics-connector-0] 2017-12-25 16:04:18,965 LogReporter.java:37 - SIMPLE Measurement SLOW_QUERY [time=1514217853219, value=5746.0, tags={host=192.168.34, systemName=smartcat-cassandra-cluster, statementType=SELECT}, fields={statement=, client=/192.168.34.21:49894, consistencyLevel=QUORUM}]

Note that statement= field is empty. I would expect statement to provide the actual slow query statement.

stephanustedy commented 6 years ago

got same issue. any update regarding this ?

nivancevic commented 6 years ago

The actual mechanism for populating statement field with the respective CQL statement is not fully implemented and it is expected to be completed in upcoming releases. Because of performance impact the cassandra-diagnostics Java agent might have on the cassandra node JVM process, this feature will be probably turned off by default.