Launch Week 02 wrapped — explore all five launches

Set Trace Environments

Set your environments during tracing for better debugging

Included on the Enterprise plan. Book a demo, opens in a new tab. Included on the Team plan. Included on the Starter plan. Not included on the Free plan.

Overview

The environment feature allows you to specify which environment your traces are coming from. This is useful for separating traces from different environments in "development", "staging", "production", or "testing".

Configure Environment

You can configure the environment with the CONFIDENT_TRACE_ENVIRONMENT environment variable.

export CONFIDENT_TRACE_ENVIRONMENT="staging"

Alternatively, you can set the environment directly in code:

main.py
from openai import OpenAI 
from deepeval.tracing import observe, trace_manager

trace_manager.configure(environment="production")
client = OpenAI()

@observe()
def llm_app(query: str):
    return client.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": query}]
    ).choices[0].message.content

llm_app("Write me a poem.")

The environment can be either "production", "staging", or "development", and helps you identify where your traces are coming from.

Ready to monitor AI in production?Connect traces, alerts, dashboards, and evals in one production workflowBook a demo

Last updated on

Built byConfident AI