:telemetry events Perplexed emits. Attach handlers to track spend or to
be told when a provider needs attention.
Searches and scrapes are spans: each emits :start, then :stop (or
:exception if it raised), with :telemetry.span/3's standard
duration (native time units) on stop.
| Event | Measurements | Metadata |
|---|---|---|
[:perplexed, :search, :start] | system_time | provider, query |
[:perplexed, :search, :stop] | duration, cost, hits | provider, query, result |
[:perplexed, :scrape, :start] | system_time | url |
[:perplexed, :scrape, :stop] | duration, cost, browser_ms | url, tier, attempts, result |
[:perplexed, :model] | token counts, cost (when priced) | model, phase |
[:perplexed, :provider, :alert] | count (always 1) | provider, reason, status, message |
result is :ok or :error. On an alert, status and message are
present when the provider answered with an HTTP error.
An alert fires when a provider answers that credits or quota ran out
(:quota_exhausted), that the credentials were rejected
(:authentication), or that requests are being throttled
(:rate_limited). A missing credential does not alert; unconfigured
providers are expected.
Summary
Functions
Emits [:perplexed | event] with measurements and metadata.
Emits a provider alert when reason is one that needs a person's attention.
Runs fun as a [:perplexed | event] span. fun returns
{result, stop_measurements, stop_metadata}; the span returns result.
Functions
Emits [:perplexed | event] with measurements and metadata.
Emits a provider alert when reason is one that needs a person's attention.
Runs fun as a [:perplexed | event] span. fun returns
{result, stop_measurements, stop_metadata}; the span returns result.