Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execute Telemetry events for queries #283

Closed
5 tasks done
whatyouhide opened this issue Mar 21, 2023 · 3 comments
Closed
5 tasks done

Execute Telemetry events for queries #283

whatyouhide opened this issue Mar 21, 2023 · 3 comments

Comments

@whatyouhide
Copy link
Owner

whatyouhide commented Mar 21, 2023

Broken out from #138.

  • [:xandra, :server_warning] - when the server returns a warning in a frame (Emit Telemetry events for warnings #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
Copy link
Contributor

jvf commented Mar 21, 2023

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?

@whatyouhide
Copy link
Owner Author

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 👍

@whatyouhide
Copy link
Owner Author

Done in #294. 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants