Telemetry events emitted by the driver.
Attach to these to get request rates, latency and error breakdowns without instrumenting call sites.
[:typedb, :request, :start | :stop | :exception]
One span per HTTP request, including each retry and each renew-and-retry
attempt — so a single TypeDB.query/4 can produce several spans.
Measurements follow :telemetry.span/3: :system_time on start,
:duration (native units) on stop and exception.
Metadata:
:connection— the connection name:method—:get,:post,:putor:delete:path— the API path, e.g."/transactions/open". Database and user names are not stripped, so treat it as potentially high-cardinality:attempt— 1-based attempt number within this request:status— HTTP status, on:stoponly:error— theTypeDB.Errorwhen one was produced, on:stoponly
[:typedb, :sign_in, :start | :stop | :exception]
One span per sign-in. A healthy connection produces one on start-up and one per token lifetime; a spike means tokens are being rejected.
Metadata: :connection, and :error on failure.
Example
:telemetry.attach_many(
"typedb-logger",
[[:typedb, :request, :stop], [:typedb, :sign_in, :stop]],
fn event, %{duration: duration}, metadata, _config ->
Logger.info("#{inspect(event)} #{System.convert_time_unit(duration, :native, :millisecond)}ms " <>
"#{inspect(Map.take(metadata, [:method, :path, :status]))}")
end,
nil
)Prometheus / telemetry_metrics
Telemetry.Metrics.distribution("typedb.request.stop.duration",
unit: {:native, :millisecond},
tags: [:method, :status]
)