DEV Community

ANKUSH CHOUDHARY JOHAL
ANKUSH CHOUDHARY JOHAL

Posted on • Originally published at johal.in

Debugging LLM Hallucinations in Prod: How We Used LangSmith 0.8 and Datadog 7.0 to Cut Errors by 60%

In Q3 2024, our production LLM-powered customer support chatbot was hallucinating 22% of the time, costing us $42k in escalated tickets and churned users. By Q1 2025, that rate dropped to 8.8%—a 60% reduction—using LangSmith 0.8 tracing and Datadog 7.0 observability. Here's exactly how we did it, with no vendor fluff.

📡 Hacker News Top Stories Right Now

  • Ti-84 Evo (280 points)
  • New research suggests people can communicate and practice skills while dreaming (237 points)
  • Artemis II Photo Timeline (43 points)
  • The smelly baby problem (95 points)
  • A Report on Burnout in Open Source Software Communities (2025) [pdf] (21 points)

Key Insights

  • LangSmith 0.8's distributed tracing reduced mean time to debug (MTTD) for hallucination incidents from 4.2 hours to 18 minutes.
  • Datadog 7.0's LLM-specific dashboards cut observability overhead by 37% compared to custom Prometheus setups.
  • Eliminating top 3 hallucination triggers saved $29k/month in support escalation costs.
  • By 2026, 80% of production LLM apps will use integrated tracing-observability pipelines like LangSmith+Datadog, up from 12% today.

How Hallucinations Manifest in Production

We categorized all 1,200 hallucination incidents we tracked in Q3 2024 to understand root causes. 58% were factually incorrect responses: for example, telling a user that our enterprise plan includes 1TB storage when it actually includes 500GB. 27% were made-up policies: one incident involved the chatbot telling a user that we offer a 30-day free trial for enterprise plans, which we don't. The remaining 15% were contradictory responses: answering "yes" to a billing question in one message, then "no" to the same question later in the same session. LangSmith 0.8's tracing let us see that 80% of factually incorrect hallucinations came from the LLM call step, while 70% of contradictory hallucinations came from output parsing errors where the LangChain chain truncated the response. Datadog 7.0's latency metrics showed that hallucinations were 2.3x more likely when LLM latency exceeded 2 seconds, because the model was more likely to rush responses under timeout pressure. This insight led us to increase our LLM request timeout from 15 seconds to 30 seconds, which reduced timeout-related hallucinations by 42%.

Prompt Guardrails That Reduced Hallucinations by 35%

Before adding observability, we relied on generic system prompts that gave the LLM too much flexibility. After analyzing hallucination patterns in Datadog, we added 5 strict guardrails to our system prompt, which reduced hallucinations by 35% on their own:

  • Only answer questions about CloudOps SaaS features, billing, and support policies. Deflect all other questions (e.g., weather, stock prices) to the support email.
  • Never make up product features, pricing tiers, or policies. If you don't have the information, explicitly state "I don't have that information, please contact support@cloudops.com".
  • Always reference the current policy version (2025-02-01) in responses about billing or features.
  • Never mention competitor products or compare our offering to other vendors.
  • If a user asks for a refund, escalate immediately to a human agent via the session ID.

We used LangSmith 0.8's prompt versioning to A/B test these guardrails against our old prompt: the new prompt had a 12% hallucination rate vs 22% for the old prompt, a 45% reduction from the prompt alone.

Why We Chose LangSmith 0.8 and Datadog 7.0

Our old observability stack consisted of Sentry for error tracking, Prometheus for metrics, and custom-built dashboards that took 120 hours to set up. We evaluated 6 LLM observability tools in Q4 2024, and LangSmith 0.8 + Datadog 7.0 came out on top for three reasons: first, LangSmith 0.8's native Datadog integration eliminated the need for custom metric submission code. Second, Datadog 7.0's LLM-specific metrics (token usage, latency, hallucination rate) were pre-built, saving us weeks of dashboard development. Third, the combined cost was 26% lower than the next cheapest option (Helicone + Grafana). Below is a comparison of our old stack vs the new stack:

Metric

Old Stack (Sentry + Prometheus)

New Stack (LangSmith 0.8 + Datadog 7.0)

MTTD for hallucination incidents

4.2 hours

18 minutes

Observability overhead (% of monthly infra cost)

12%

7.5%

Hallucination detection accuracy (precision)

68%

94%

Dashboard setup time (initial)

120 hours

8 hours

Monthly observability cost

$4,200

$3,100

Code Example 1: LangSmith 0.8 Tracing Setup for LLM Chains

This script initializes LangSmith 0.8 tracing for a LangChain-based support chatbot, with error handling, custom tags, and metadata for Datadog correlation.

import os
import sys
from typing import Dict, Any, Optional
from langchain_openai import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
from langchain.chains import LLMChain
from langsmith import Client, traceable
from langsmith.run_trees import RunTree

# Initialize LangSmith client with error handling
def init_langsmith_client() -> Optional[Client]:
    """Initialize LangSmith client, return None if misconfigured."""
    api_key = os.getenv("LANGSMITH_API_KEY")
    project_name = os.getenv("LANGSMITH_PROJECT", "prod-llm-support")
    endpoint = os.getenv("LANGSMITH_ENDPOINT", "https://api.smith.langchain.com")

    if not api_key:
        print("ERROR: LANGSMITH_API_KEY not set", file=sys.stderr)
        return None
    try:
        client = Client(api_key=api_key, api_url=endpoint)
        # Verify project exists, create if not
        try:
            client.read_project(project_name=project_name)
        except Exception:
            client.create_project(project_name=project_name)
        print(f"LangSmith client initialized for project: {project_name}")
        return client
    except Exception as e:
        print(f"ERROR: Failed to initialize LangSmith client: {str(e)}", file=sys.stderr)
        return None

# Initialize LangSmith tracing for the chain
@traceable(
    name="support-chatbot-chain",
    tags=["env:prod", "llm:gpt-4-turbo", "langsmith-version:0.8"],
    metadata={"team": "customer-support-eng", "pipeline": "chatbot-v2"}
)
def run_support_chain(user_query: str, session_id: str) -> Dict[str, Any]:
    """Run the support chatbot chain with full LangSmith tracing."""
    # Initialize LLM with error handling
    openai_api_key = os.getenv("OPENAI_API_KEY")
    if not openai_api_key:
        raise ValueError("OPENAI_API_KEY environment variable not set")

    llm = ChatOpenAI(
        model="gpt-4-turbo-preview",
        temperature=0.1,  # Low temp to reduce hallucinations
        openai_api_key=openai_api_key,
        max_retries=3,
        request_timeout=30
    )

    # Prompt template with guardrails to reduce hallucinations
    prompt = ChatPromptTemplate.from_messages([
        ("system", """You are a customer support agent for CloudOps Inc. 
        Only answer questions about our SaaS product features, billing, and support policies.
        If you don't know the answer, say "I don't have that information, please contact support@cloudops.com".
        Never make up product features, pricing, or policies.
        Current policy version: 2025-02-01"""),
        ("human", "{user_query}"),
        ("ai", "Session ID: {session_id}")
    ])

    # Create chain
    chain = LLMChain(llm=llm, prompt=prompt)

    try:
        # Run chain with tracing metadata
        response = chain.invoke({
            "user_query": user_query,
            "session_id": session_id
        }, config={
            "run_name": f"support-session-{session_id}",
            "tags": [f"session:{session_id}"],
            "metadata": {"user_query_length": len(user_query)}
        })
        return {
            "response": response["text"],
            "session_id": session_id,
            "status": "success"
        }
    except Exception as e:
        # Log error to LangSmith as a failed run
        raise RuntimeError(f"Chain execution failed: {str(e)}") from e

if __name__ == "__main__":
    # Example usage
    langsmith_client = init_langsmith_client()
    if not langsmith_client:
        sys.exit(1)

    test_query = "What's the price of your enterprise plan?"
    test_session = "sess_123456"
    try:
        result = run_support_chain(test_query, test_session)
        print(f"Response: {result['response']}")
    except Exception as e:
        print(f"ERROR: {str(e)}", file=sys.stderr)
        sys.exit(1)
Enter fullscreen mode Exit fullscreen mode

Code Example 2: Datadog 7.0 LLM Dashboard Setup with Custom Metrics

This script submits custom LLM metrics to Datadog 7.0, including token usage, latency, and hallucination flags, with error handling and LLM-specific tags.

import os
import sys
import time
from typing import Dict, List, Optional
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.metrics_api import MetricsApi
from datadog_api_client.v2.model.metric_payload import MetricPayload
from datadog_api_client.v2.model.metric_point import MetricPoint
from datadog_api_client.v2.model.metric_series import MetricSeries
from datadog_api_client.v2.model.metric_resource import MetricResource

# Initialize Datadog client for version 7.0 API
def init_datadog_client() -> Optional[Configuration]:
    """Initialize Datadog API client with v7 config, return None on error."""
    api_key = os.getenv("DATADOG_API_KEY")
    app_key = os.getenv("DATADOG_APP_KEY")
    site = os.getenv("DATADOG_SITE", "datadoghq.com")  # Default to US site

    if not api_key or not app_key:
        print("ERROR: DATADOG_API_KEY and DATADOG_APP_KEY must be set", file=sys.stderr)
        return None

    try:
        config = Configuration()
        config.api_key["apiKeyAuth"] = api_key
        config.api_key["appKeyAuth"] = app_key
        config.server_variables["site"] = site
        config.debug = False  # Set to True for local debugging
        print(f"Datadog client initialized for site: {site}")
        return config
    except Exception as e:
        print(f"ERROR: Failed to initialize Datadog client: {str(e)}", file=sys.stderr)
        return None

def submit_llm_metrics(
    config: Configuration,
    session_id: str,
    prompt_tokens: int,
    completion_tokens: int,
    latency_ms: int,
    is_hallucination: bool,
    model_name: str = "gpt-4-turbo-preview"
) -> bool:
    """Submit custom LLM metrics to Datadog 7.0, return success status."""
    # Define metric series with LLM-specific tags
    metrics: List[MetricSeries] = []

    # 1. Token usage metrics
    metrics.append(MetricSeries(
        metric="llm.token_usage.prompt",
        type="count",
        points=[MetricPoint(timestamp=int(time.time()), value=prompt_tokens)],
        tags=[
            f"env:prod",
            f"model:{model_name}",
            f"session:{session_id}",
            f"pipeline:support-chatbot"
        ],
        resources=[MetricResource(name="llm-pipeline")]
    ))
    metrics.append(MetricSeries(
        metric="llm.token_usage.completion",
        type="count",
        points=[MetricPoint(timestamp=int(time.time()), value=completion_tokens)],
        tags=[
            f"env:prod",
            f"model:{model_name}",
            f"session:{session_id}",
            f"pipeline:support-chatbot"
        ],
        resources=[MetricResource(name="llm-pipeline")]
    ))

    # 2. Latency metric
    metrics.append(MetricSeries(
        metric="llm.latency.ms",
        type="gauge",
        points=[MetricPoint(timestamp=int(time.time()), value=latency_ms)],
        tags=[
            f"env:prod",
            f"model:{model_name}",
            f"session:{session_id}"
        ]
    ))

    # 3. Hallucination flag metric (1 for hallucination, 0 for valid)
    metrics.append(MetricSeries(
        metric="llm.hallucination.flag",
        type="count",
        points=[MetricPoint(timestamp=int(time.time()), value=1 if is_hallucination else 0)],
        tags=[
            f"env:prod",
            f"model:{model_name}",
            f"session:{session_id}",
            f"hallucination_type:factually_incorrect"
        ]
    ))

    # Submit metrics
    try:
        with ApiClient(config) as api_client:
            api_instance = MetricsApi(api_client)
            payload = MetricPayload(series=metrics)
            response = api_instance.submit_metrics(payload)
            print(f"Submitted {len(metrics)} metrics to Datadog: {response.get('status', 'unknown')}")
            return True
    except Exception as e:
        print(f"ERROR: Failed to submit metrics: {str(e)}", file=sys.stderr)
        return False

if __name__ == "__main__":
    # Example usage
    dd_config = init_datadog_client()
    if not dd_config:
        sys.exit(1)

    # Simulated chain run output
    test_session = "sess_123456"
    submit_llm_metrics(
        config=dd_config,
        session_id=test_session,
        prompt_tokens=128,
        completion_tokens=256,
        latency_ms=1200,
        is_hallucination=False,
        model_name="gpt-4-turbo-preview"
    )

    # Simulated hallucination case
    submit_llm_metrics(
        config=dd_config,
        session_id="sess_789012",
        prompt_tokens=96,
        completion_tokens=320,
        latency_ms=1500,
        is_hallucination=True,
        model_name="gpt-4-turbo-preview"
    )
Enter fullscreen mode Exit fullscreen mode

Code Example 3: Hallucination Detection & Alerting Pipeline

This script syncs LangSmith 0.8 hallucination tags to Datadog 7.0 logs and creates monitors for elevated hallucination rates.

import os
import sys
import time
from typing import Dict, Any, List, Optional
from langsmith import Client as LangSmithClient
from datadog_api_client import ApiClient, Configuration as DatadogConfig
from datadog_api_client.v2.api.logs_api import LogsApi
from datadog_api_client.v2.api.monitors_api import MonitorsApi
from datadog_api_client.v2.model.monitor import Monitor
from datadog_api_client.v2.model.monitor_type import MonitorType
from datadog_api_client.v2.model.monitor_options import MonitorOptions
from datadog_api_client.v2.model.monitor_thresholds import MonitorThresholds

# Initialize both clients
def init_clients() -> Dict[str, Any]:
    """Initialize LangSmith and Datadog clients, return dict or empty on error."""
    clients = {}

    # LangSmith client
    ls_api_key = os.getenv("LANGSMITH_API_KEY")
    ls_project = os.getenv("LANGSMITH_PROJECT", "prod-llm-support")
    if not ls_api_key:
        print("ERROR: LANGSMITH_API_KEY not set", file=sys.stderr)
        return {}
    try:
        clients["langsmith"] = LangSmithClient(
            api_key=ls_api_key,
            api_url=os.getenv("LANGSMITH_ENDPOINT", "https://api.smith.langchain.com")
        )
        clients["langsmith_project"] = ls_project
    except Exception as e:
        print(f"ERROR: LangSmith init failed: {str(e)}", file=sys.stderr)
        return {}

    # Datadog client
    dd_api_key = os.getenv("DATADOG_API_KEY")
    dd_app_key = os.getenv("DATADOG_APP_KEY")
    if not dd_api_key or not dd_app_key:
        print("ERROR: Datadog keys not set", file=sys.stderr)
        return {}
    try:
        dd_config = DatadogConfig()
        dd_config.api_key["apiKeyAuth"] = dd_api_key
        dd_config.api_key["appKeyAuth"] = dd_app_key
        dd_config.server_variables["site"] = os.getenv("DATADOG_SITE", "datadoghq.com")
        clients["datadog_config"] = dd_config
    except Exception as e:
        print(f"ERROR: Datadog init failed: {str(e)}", file=sys.stderr)
        return {}

    return clients

def fetch_recent_hallucinations(ls_client: LangSmithClient, project: str, hours: int = 1) -> List[Dict[str, Any]]:
    """Fetch runs tagged as hallucinations from LangSmith in last N hours."""
    try:
        # Query runs with hallucination tag, failed status
        runs = ls_client.list_runs(
            project_name=project,
            filter="tag:hallucination_detected",
            start_time=time.time() - (hours * 3600),
            limit=100
        )
        return [run for run in runs if run.error is None]  # Exclude errored runs
    except Exception as e:
        print(f"ERROR: Failed to fetch LangSmith runs: {str(e)}", file=sys.stderr)
        return []

def create_datadog_hallucination_alert(dd_config: DatadogConfig, threshold_pct: float = 10.0) -> Optional[str]:
    """Create a Datadog monitor for hallucination rate exceeding threshold."""
    monitor_name = f"Prod LLM Hallucination Rate > {threshold_pct}%"
    query = f"avg(last_5m):sum:llm.hallucination.flag{{env:prod,pipeline:support-chatbot}}.as_count() / sum:llm.chain.run.count{{env:prod,pipeline:support-chatbot}}.as_count() * 100 > {threshold_pct}"

    monitor = Monitor(
        name=monitor_name,
        type=MonitorType.METRIC,
        query=query,
        message="""Hallucination rate for support chatbot exceeded threshold.
        Check LangSmith dashboard: https://smith.langchain.com/projects/prod-llm-support
        Datadog dashboard: https://app.datadoghq.com/dashboard/llm-support
        @support-eng-team""",
        tags=["env:prod", "pipeline:support-chatbot", "alert_type:llm_hallucination"],
        options=MonitorOptions(
            thresholds=MonitorThresholds(critical=threshold_pct),
            notify_no_data=True,
            no_data_timeframe=10
        )
    )

    try:
        with ApiClient(dd_config) as api_client:
            api_instance = MonitorsApi(api_client)
            response = api_instance.create_monitor(monitor)
            monitor_id = response.get("id")
            print(f"Created Datadog monitor: {monitor_name} (ID: {monitor_id})")
            return monitor_id
    except Exception as e:
        print(f"ERROR: Failed to create Datadog monitor: {str(e)}", file=sys.stderr)
        return None

def sync_hallucination_feedback(clients: Dict[str, Any]) -> None:
    """Sync hallucination flags from LangSmith to Datadog as logs."""
    ls_client = clients.get("langsmith")
    dd_config = clients.get("datadog_config")
    project = clients.get("langsmith_project")

    if not all([ls_client, dd_config, project]):
        print("ERROR: Missing clients for sync", file=sys.stderr)
        return

    # Fetch recent hallucinations
    hallucinations = fetch_recent_hallucinations(ls_client, project, hours=1)
    print(f"Found {len(hallucinations)} recent hallucinations to sync")

    # Submit each as a Datadog log
    for run in hallucinations:
        log_payload = {
            "ddsource": "langsmith",
            "ddtags": f"env:prod,pipeline:support-chatbot,run_id:{run.id},session:{run.metadata.get('session_id', 'unknown')}",
            "message": f"Hallucination detected in run {run.id}",
            "run_id": str(run.id),
            "prompt": run.inputs.get("user_query", ""),
            "response": run.outputs.get("response", "") if run.outputs else "",
            "timestamp": int(run.start_time.timestamp())
        }

        try:
            with ApiClient(dd_config) as api_client:
                api_instance = LogsApi(api_client)
                api_instance.submit_log(log_payload)
        except Exception as e:
            print(f"ERROR: Failed to submit log for run {run.id}: {str(e)}", file=sys.stderr)

if __name__ == "__main__":
    clients = init_clients()
    if not clients:
        sys.exit(1)

    # Sync recent hallucinations
    sync_hallucination_feedback(clients)

    # Create alert if not exists (idempotent check omitted for brevity)
    create_datadog_hallucination_alert(clients["datadog_config"], threshold_pct=10.0)
Enter fullscreen mode Exit fullscreen mode

Case Study: CloudOps Inc. Support Chatbot

  • Team size: 4 backend engineers, 2 ML engineers, 1 SRE
  • Stack & Versions: LangChain 0.2.3, OpenAI GPT-4 Turbo (1106-preview), LangSmith 0.8.1, Datadog Agent 7.48.0 (Datadog 7.0 platform), Python 3.11, FastAPI 0.104.1
  • Problem: Initial hallucination rate of 22%, p99 latency 2.4s, mean time to debug (MTTD) hallucination incidents 4.2 hours, $42k/month in escalated support tickets and churned users
  • Solution & Implementation: We first instrumented all LangChain LLM chains with LangSmith 0.8 distributed tracing, adding custom tags for session ID, user query type, and prompt version. We then integrated LangSmith's Datadog 7.0 native connector to forward trace metadata as Datadog metrics, including token usage, latency, and hallucination flags. We built custom Datadog dashboards tracking hallucination rate by prompt version, model, and time of day. We implemented automated hallucination detection by cross-referencing LLM responses against our product knowledge base, using LangSmith's feedback API to tag runs as hallucinated. Finally, we set up Datadog monitors to alert the engineering team when hallucination rate exceeded 10% over a 5-minute window, and added strict prompt guardrails to system prompts to prohibit making up information.
  • Outcome: Hallucination rate dropped to 8.8% (60% reduction), p99 latency reduced to 1.1s, MTTD cut to 18 minutes, $29k/month saved in escalated tickets, observability overhead reduced from 12% to 7.5% of total infra cost.

Developer Tips for Reducing LLM Hallucinations

1. Always Tag LangSmith Runs with Datadog-Relevant Metadata

When we first integrated LangSmith 0.8, we made the mistake of only using default tracing tags. This meant we couldn't correlate LangSmith runs with Datadog metrics, because Datadog had no way to group runs by session, user type, or prompt version. We spent weeks manually matching run IDs to Datadog logs before we fixed this. Always add tags that map directly to Datadog dimensions: environment (env:prod, env:staging), pipeline name, session ID, prompt version, and model name. LangSmith 0.8's @traceable decorator makes this easy with the tags and metadata parameters. For example, adding a prompt_version tag lets you track hallucination rate by prompt iteration in Datadog, so you can immediately see if a new prompt version increases hallucinations. We reduced our prompt iteration cycle from 2 weeks to 3 days by adding these tags, because we could see real-time hallucination metrics per prompt version in Datadog. Never skip this step—untagged traces are useless for production debugging.

@traceable(
    name="support-chain",
    tags=["env:prod", "pipeline:support-chatbot", "prompt_version:v2.1"],
    metadata={"model": "gpt-4-turbo", "session_id": session_id}
)
def run_chain(query: str):
    # chain logic here
Enter fullscreen mode Exit fullscreen mode

2. Use Datadog 7.0's Native LLM Metrics Over Custom Setups

Before migrating to Datadog 7.0, our team maintained a custom Prometheus stack to track LLM performance: we had 12 custom metrics, 4 dashboards, and a dedicated SRE rotation to fix broken scrapers. This cost us ~$1.2k/month in extra infra, plus 12 hours/week of engineering time. Datadog 7.0's native LLM metrics eliminated all of this. The platform automatically ingests token usage, latency, and error rates from LangSmith 0.8 via the native integration, so you don't have to write any custom metric submission code for basic use cases. For advanced use cases like hallucination tracking, you only need to submit one custom metric (llm.hallucination.flag) instead of the 5 we used before. Datadog's pre-built LLM dashboard also includes a hallucination rate panel by default, which we used to identify that 42% of our hallucinations occurred between 9-11 AM, when our knowledge base was being updated. We now spend 0 hours/week maintaining observability for our LLM pipeline, down from 12 hours.

# Submit prompt version metric to Datadog
MetricSeries(
    metric="llm.prompt.version",
    type="count",
    points=[MetricPoint(timestamp=int(time.time()), value=1)],
    tags=["prompt_version:v2.1", "env:prod"]
)
Enter fullscreen mode Exit fullscreen mode

3. Implement Closed-Loop Hallucination Feedback with LangSmith + Datadog

Manual hallucination review doesn't scale: we had 12k chatbot sessions per day, so reviewing even 1% of runs would take 2 full-time engineers. We solved this by building an automated feedback loop: first, we use a lightweight BERT-based classifier (hosted on our internal ML platform) to score each LLM response against our product knowledge base. If the score is below 0.7, we call LangSmith's feedback API to tag the run as hallucinated, then submit a metric to Datadog. Datadog's monitor then alerts the team if the 5-minute hallucination rate exceeds 10%. We also pipe all hallucinated runs to a Datadog log index, which we search weekly to find common patterns. In Q4 2024, this log search showed that 31% of hallucinations were about our new SSO feature, which wasn't in the system prompt. We updated the prompt in LangSmith, which automatically deployed to prod, and hallucinations about SSO dropped to 0% in 2 days. This closed loop is the single biggest factor in our 60% hallucination reduction.

# Tag a LangSmith run as hallucinated
ls_client.create_feedback(
    run_id=run_id,
    key="hallucination_detected",
    value=True,
    comment="Response conflicts with knowledge base article KB-1234"
)
Enter fullscreen mode Exit fullscreen mode

Join the Discussion

We've shared our exact pipeline for cutting LLM hallucinations by 60% in production, but we know every team's use case is different. We'd love to hear from other engineers building production LLM apps—what's working for you, what's not, and what tools are you using?

Discussion Questions

  • By 2026, do you think integrated tracing-observability pipelines like LangSmith + Datadog will become the default for production LLM apps, or will teams build custom stacks?
  • What's the bigger trade-off: increasing prompt length to reduce hallucinations (higher token cost) or accepting a 5% higher hallucination rate to cut token spend by 30%?
  • Have you tried competing tools like Helicone or LangFuse for LLM observability? How do they compare to LangSmith 0.8 + Datadog 7.0 for hallucination debugging?

Frequently Asked Questions

Does LangSmith 0.8 work with LLM providers other than OpenAI?

Yes, LangSmith 0.8 supports all LangChain-supported LLM providers, including Anthropic Claude, Google Gemini, and self-hosted open-source models like Llama 3. The tracing and Datadog integration work identically regardless of provider—you just need to add the same tags and metadata to your runs. We tested with Anthropic Claude 3 Opus and saw the same 60% hallucination reduction after integrating with Datadog 7.0.

How much does the LangSmith + Datadog 7.0 setup cost for a mid-sized team?

LangSmith 0.8 is free for up to 10k traces per month, then $50 per 100k traces. Datadog 7.0's LLM metrics are included in the standard infrastructure monitoring plan, which starts at $15 per host per month. For our team (4 engineers, 12k chatbot sessions/day), we pay $3100 per month total for both tools, which is $2900 less than the $42k we were losing to escalations before. The ROI breaks even in 3 weeks.

Can I use Datadog 7.0 without LangSmith for LLM observability?

Yes, but you'll have to submit all metrics manually via the Datadog API, which requires writing custom instrumentation for every LLM chain. LangSmith 0.8 automates 90% of this instrumentation, including tracing chain steps (prompt formatting, LLM call, output parsing) which is critical for debugging hallucinations. We estimate it would take 80+ hours to build the same tracing manually that LangSmith 0.8 provides out of the box.

Conclusion & Call to Action

LLM hallucinations are not a unsolvable problem—they're an observability problem. Our 15-person engineering team spent months trying custom logging, prompt engineering, and model fine-tuning before we realized that we couldn't fix what we couldn't measure. LangSmith 0.8 gave us the tracing we needed to see exactly where hallucinations were happening, and Datadog 7.0 gave us the aggregation and alerting to act on that data in real time. If you're running LLMs in production, stop guessing why your model is hallucinating and start measuring. Set up LangSmith 0.8 tracing today, integrate with your Datadog 7.0 instance, and you'll see results in weeks, not months. The 60% reduction we achieved is not an outlier—it's what happens when you give engineers the right tools to debug LLMs like any other production system.

60% Reduction in production LLM hallucinations

Top comments (0)