View Source Guesswork.Telemetry (Guesswork v0.6.0)

Used to track queries and their metrics.

Summary

Functions

Returns a specification to start this module under a supervisor.

Indicates that a query run has crashed.

Indicates that a query run has crashed.

Pulls all metrics for the requested query_id.

Increases the number of assignments tracked for a query.

Increases the number of precomputed streams tracked for a query.

Increases the number of substitutions tracked for a query.

Increases the number of test computations tracked for a query.

Pulls all query runs for a specific or all queries from the system.

Pulls all spans for a specific query.

Indicates that a query run has started. If the run has already been started the insert will fail, but quietly.

Indicates that a query span has started. If the span has already been started the insert will fail, but quietly.

Indicates that a query run has stopped.

Indicates that a query span has stopped.

Types

@type pagination_opts() :: [page_size: integer(), page_token: term()]

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

fail_run(pid, query_id, run_id, duration, error)

View Source
@spec fail_run(pid() | module(), String.t(), String.t(), integer(), term()) :: :ok

Indicates that a query run has crashed.

Note that the duration is assumed to be the native time from a telemetry event.

Link to this function

fail_span(pid, query_id, ctx, duration, error)

View Source
@spec fail_span(pid() | module(), String.t(), term(), integer(), term()) :: :ok

Indicates that a query run has crashed.

Note that the duration is assumed to be the native time from a telemetry event.

Link to this function

get_query_metrics(pid, query_id)

View Source
@spec get_query_metrics(pid() | module(), String.t()) ::
  Guesswork.Telemetry.QueryMetrics.t()

Pulls all metrics for the requested query_id.

Link to this function

increment_assignments(pid, query_id, assignments)

View Source
@spec increment_assignments(pid() | module(), String.t(), non_neg_integer()) :: :ok

Increases the number of assignments tracked for a query.

Link to this function

increment_precomputed_streams(pid, query_id, streams)

View Source
@spec increment_precomputed_streams(pid() | module(), String.t(), non_neg_integer()) ::
  :ok

Increases the number of precomputed streams tracked for a query.

Link to this function

increment_substitutions(pid, query_id, substitutions)

View Source
@spec increment_substitutions(pid() | module(), String.t(), non_neg_integer()) :: :ok

Increases the number of substitutions tracked for a query.

Link to this function

increment_tests(pid, query_id, tests)

View Source
@spec increment_tests(pid() | module(), String.t(), non_neg_integer()) :: :ok

Increases the number of test computations tracked for a query.

Link to this function

list_query_runs(pid, query_id \\ nil, opts \\ [])

View Source

Pulls all query runs for a specific or all queries from the system.

Available Options:

  • :page_size (integer/0) - The number of items to pull per page. The default value is 100.

  • :page_token (term/0) - The continuation used to get the next page.

Link to this function

list_query_spans(pid, query_id, opts \\ [])

View Source

Pulls all spans for a specific query.

Available Options:

  • :page_size (integer/0) - The number of items to pull per page. The default value is 100.

  • :page_token (term/0) - The continuation used to get the next page.

Link to this function

start_run(pid, query_id, run_id, start_time)

View Source
@spec start_run(pid() | module(), String.t(), String.t(), integer()) :: :ok

Indicates that a query run has started. If the run has already been started the insert will fail, but quietly.

Note that the start_time is assumed to be the native time from a telemetry event.

Link to this function

start_span(pid, query_id, span_type, ctx, start_time)

View Source
@spec start_span(pid() | module(), String.t(), atom(), term(), integer()) :: :ok

Indicates that a query span has started. If the span has already been started the insert will fail, but quietly.

Note that the start_time is assumed to be the native time from a telemetry event.

Link to this function

stop_run(pid, query_id, run_id, duration)

View Source
@spec stop_run(pid() | module(), String.t(), String.t(), integer()) :: :ok

Indicates that a query run has stopped.

Note that the duration is assumed to be the native time from a telemetry event.

Link to this function

stop_span(pid, query_id, ctx, duration, metadata \\ %{})

View Source
@spec stop_span(
  pid() | module(),
  String.t(),
  term(),
  integer(),
  Guesswork.Telemetry.QuerySpan.metadata()
) :: :ok

Indicates that a query span has stopped.

Note that the duration is assumed to be the native time from a telemetry event.