whatyouhide/xandra

Execute Telemetry events for queries

Closed this issue · 3 comments

Broken out from #138.

  • [:xandra, :server_warning] - when the server returns a warning in a frame (#247)
    • Measurements:
      • message - warning message
    • Metatata:
      • connection - PID of the connection
      • connection_name - name of the connection or nil
      • host
      • port
  • [:xandra, :connection | :disconnection] - when a Xandra connection process establishes a connection to the server or disconnects
    • Measurements:
    • Metatata:
      • connection - PID of the connection
      • connection_name - name of the connection or nil
      • host
      • port
      • (if :disconnection) reason
  • [:xandra, :prepare_query] span - when Xandra prepares or re-prepares a query
    • Measurements:
      • :system_time (on :start) and :duration (on :stop)
    • Metatata:
      • query - Xandra.Simple or Xandra.Prepared query
      • connection - PID of the connection
      • connection_name - name of the connection or nil
      • :host/:port
      • :reprepared - boolean to tell whether this query was prepared for the first time or reprepared
  • [:xandra, :execute_query] span - when Xandra executes a query
    • Measurements:
      • :system_time (on :start) and :duration (on :stop)
    • Metadata:
      • query - Xandra.Simple or Xandra.Prepared query
      • connection - PID of the connection
      • connection_name - name of the connection or nil
      • :host/:port
  • [:xandra, :prepared_cache, :hit | :miss] - Xandra looked a query up in the prepared cache
    • Measurements
      • :query - Xandra.Prepared

To be done by @harunzengin

jvf commented

Something I forgot to bring up: For doing throughput and latency metrics on the execute_query event it would be nice to be able to distinguish between reads and writes. It is probably cumbersome to try to get this form the query. Maybe as a first step we could allow users to pass in a tag/label when executing a query?

We can support an :extra_metadata option, which we merge into the event's metadata. This way, you can add whatever you want. We do the same thing in Redix, if you want to look for inspiration 👍

Done in #294. 💯