Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.latitude.so/llms.txt

Use this file to discover all available pages before exploring further.

Log levels

Latitude does not require a first-class log-level field. If your application uses severity levels such as debug, info, warn, or error, send them as metadata and filter on those fields. Use log-level metadata for application-defined severity; use trace status and error-count filters for OpenTelemetry span errors.

Send a log level

import { capture } from "@latitude-data/telemetry"

await capture(
  "support-agent-turn",
  async () => agent.run(userMessage),
  {
    metadata: {
      logLevel: "warn",
      reason: "tool_retry",
    },
  },
)
Choose one naming convention and keep it consistent across your application, such as metadata.logLevel or metadata.log_level.

Filter by log level

After sending log-level metadata, filter by fields such as:
  • metadata.logLevel = error
  • metadata.logLevel = warn
  • metadata.log_level = error
Combine log-level filters with other filters and search queries. For example:
  • search for agent got stuck with metadata.logLevel = warn
  • filter production traces where metadata.logLevel = error
  • find expensive traces where metadata.reason = tool_retry

Log levels vs trace status

Log levels are application-defined metadata. Trace status is derived from OpenTelemetry span status. Use:
  • Trace status / error count when an operation errored
  • Metadata log levels when your application marks severity even if the trace succeeded
  • Metadata: Attach structured context to traces
  • Filters: Filter by metadata, status, and error count
  • Search: Combine severity metadata with semantic search