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.

Environments

Latitude does not require a separate environment object. Add environment context to telemetry so you can filter, search, and review traces by source. Use either pattern:
  • Tags for a small, fixed set of environments you filter by often, such as production, staging, or preview.
  • Metadata when environment is part of a richer deployment context, such as environment, region, service, and deployment id.

Send environment as a tag

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

await capture(
  "support-agent-turn",
  async () => agent.run(userMessage),
  {
    tags: ["production"],
  },
)

Send environment as metadata

await capture(
  "support-agent-turn",
  async () => agent.run(userMessage),
  {
    metadata: {
      environment: "production",
      region: "us-east-1",
    },
  },
)

Use environments in Latitude

With environment context, you can:
  • filter traces to production traffic
  • search only staging or preview traces
  • save searches for production failure modes
  • scope issue monitoring to a specific environment
  • compare whether a behaviour appears in one environment or across all environments
  • Tags: Add lightweight environment labels
  • Metadata: Attach structured deployment context
  • Filters: Filter traces by tags or metadata
  • Search: Search within an environment