promptfoo tracing with OpenTelemetry

Connect your application's OpenTelemetry traces to promptfoo so evals and red teams can check tool calls, execution paths, timing and errors. Covers the OTLP receiver, Grafana Tempo and Jaeger.

On this page

How promptfoo tracing with OpenTelemetry checks what your application actually did

An eval that only compares final answers can pass while the application called the wrong tool, skipped a retrieval step or failed quietly and fell back to a guess. promptfoo reads OpenTelemetry (OTLP) traces from your application and runs trace-aware assertions on tool usage, execution paths, timing and errors. That moves the check from the answer to the steps that produced it. OpenTelemetry itself is an observability framework and toolkit for generating, exporting and collecting telemetry such as traces, metrics and logs. It is not a backend, so something must still store and display the traces. In this setup, promptfoo can act as the place where traces are received and checked, or it can read them from a store you already run.

There are three supported routes. The first is the built-in OTLP receiver, which listens on the standard OTLP HTTP port 4318 by default, so your application exports spans straight into the eval run. The second is pulling traces from Grafana Tempo with the tempo trace provider, which suits teams that already keep traces in Tempo. The third is forwarding traces to Jaeger or any other OTLP-compatible backend, so promptfoo can check traces while your existing tracing tools keep the copy operators use. Before choosing, confirm which route your application's exporter can reach from the eval host, whether the traces carry the span names and attributes your assertions will reference, and who owns the backend that holds production traces. Full setup details are in the promptfoo tracing documentation.

What you need before connecting traces to promptfoo

Tracing setups fail at the boundaries between tools, so confirm each piece before writing any configuration. The cards below cover the promptfoo runtime, the instrumented application, the network path to the trace receiver or backend, and the optional Collector. Check them in this order so a missing component is found early.

promptfoo version and Node.js

Install a promptfoo release that supports your tracing setup. The current npm release supplied for this work is 0.124.1, published on 8 October 2026, and it requires Node.js 22.22.0 or newer. Confirm the Node.js version on the host or CI runner that runs your evals, because an older runtime will fail before any traces arrive. Check the release notes if you pin an older version.

promptfoo on npm

An OpenTelemetry-instrumented application

promptfoo reads OTLP traces that your application emits while it answers a test prompt, so the application must already create spans for model calls, tool calls and downstream steps. Confirm that your SDK for the application language is in use and that spans carry the tool names and status codes your assertions will check. Without these spans, trace assertions have nothing to evaluate.

Network path to port 4318 or Tempo

The built-in OTLP receiver listens on the standard OTLP HTTP port 4318 by default. Confirm that the application can reach the promptfoo host on that port, and that any firewall, network policy or container bridge allows the connection. If you pull from Grafana Tempo instead, confirm that the promptfoo host can reach the Tempo query endpoint. Ask your platform team which path is approved for test traffic.

Jaeger or Tempo instance

Forwarding to Jaeger, or pulling from Tempo, requires a running backend that stores and serves the traces. Confirm who operates that instance, where it stores data, how long traces are kept, and which credentials the promptfoo host needs to read them. Test traffic often contains prompts and tool arguments, so agree with the owner which data may be stored there and for how long.

Optional OpenTelemetry Collector v0.163.0

The OpenTelemetry Collector is optional. It can sit between the application and promptfoo as a gateway that receives, processes and exports telemetry. The Collector v0.163.0 release was published on October 16, 2026. If you run it, confirm which distribution your organization approves, whether its artifacts are verified with the published checksums and SBOM files, and which authenticator extensions protect the receiver and exporter.

Collector releases

Access and data handling approval

Traces can include prompts, model outputs, tool arguments and user identifiers, so the owners of the application and the trace backend should approve the test data flow before it starts. Confirm who may view the traces, whether the promptfoo host is allowed to store them, and how long they are kept. Record the answers with the scope of your tracing work so they can be reviewed later.

How to configure the OTLP receiver, Tempo pull and Jaeger forwarding

This sequence takes an instrumented application from exporting OpenTelemetry spans to a promptfoo eval that asserts on tool calls and execution paths, with a check at each stage. It also shows the two alternatives: pulling traces from Grafana Tempo and forwarding spans to Jaeger.

  1. Instrument the application and export OTLP

    The application team adds OpenTelemetry instrumentation to the LLM application so that each request produces spans for model calls, tool calls and downstream steps. Configure the application's OTLP exporter to send traces over HTTP to the address where promptfoo will listen, which defaults to port 4318. Confirm the exporter settings in the OpenTelemetry SDK documentation for your language, since the exact environment variables and exporter classes vary by runtime. The check for this step is that the application starts without exporter errors and the SDK reports no dropped spans when you send a single test request.

  2. Enable the built-in OTLP receiver on port 4318

    Turn on promptfoo's built-in OTLP receiver so that it accepts traces on the standard OTLP HTTP port, 4318. Follow the receiver settings in the promptfoo tracing documentation to confirm the enable flag and any port override. If your network policy restricts local listeners, confirm with your platform team which interface the receiver binds to before you open any firewall rule. The check for this step is that the receiver reports it is listening on port 4318 and that a test request from the application reaches it.

  3. Point the promptfoo config at the trace source

    Add a tracing block to the promptfoo configuration file that tells the eval to read spans from the local OTLP receiver. Set the configuration keys exactly as the tracing documentation names them, and keep the provider and prompt settings for your application unchanged. Store any credentials in environment variables rather than in the config file. The check for this step is that promptfoo loads the config without a validation error and logs that tracing is enabled for the run.

  4. Add a trace-aware assertion to a test case

    Write one test case with an assertion that inspects the trace rather than only the response text. Trace-aware assertions can check that a named tool was called, that execution followed an expected path, or that no step reported an error. Start with a single tool-call check for a request where you know the tool should run. Confirm the assertion type names and fields in the promptfoo tracing documentation before you rely on them. The check for this step is that the config validates and the assertion appears in the eval plan.

  5. Run the first eval and confirm spans arrive

    Run the eval from the command line with the config you just wrote, and keep the run to one test case so any problem is easy to isolate. The application must be running and handling the test request while promptfoo listens. Review the output for the trace attached to the test result and for the result of the trace-aware assertion. If no spans appear, check that the application exporter targets the receiver address and that the receiver was enabled before the run started. The check for this step is that the result shows spans for the request and the assertion passes or fails for the reason you expect.

  6. Pull traces from Grafana Tempo

    If your application already sends traces to Grafana Tempo, use the tempo trace provider so promptfoo reads spans from Tempo instead of receiving them directly. Your observability team should confirm the Tempo query endpoint, the authentication method and the network path from the machine running promptfoo. Set the provider and endpoint in the config as the tracing documentation describes, and keep secrets in environment variables. The check for this step is that a test run returns spans that match a trace ID you can also find in the Tempo interface.

  7. Forward spans to Jaeger for inspection

    To view the same traces in Jaeger, configure promptfoo to forward spans to a Jaeger OTLP endpoint, or place an OpenTelemetry Collector between the application and both backends if you need one pipeline for several destinations. Confirm the Jaeger version and its OTLP ingestion port with your platform team, since Jaeger deployment options differ. Collector configuration and security options are described in the OpenTelemetry Collector documentation. The check for this step is that the trace for a test request appears in the Jaeger interface under the service name you configured, with the same tool-call spans that the assertion checked.

How traces move from the application into promptfoo

The eval runner sends test inputs to the application under test, and the application emits OpenTelemetry spans over OTLP. Those spans reach promptfoo one of three ways: directly into the built-in OTLP receiver, pulled by promptfoo from Grafana Tempo, or forwarded through an OpenTelemetry Collector to Jaeger. The dashed boundary marks where traffic crosses from the application network into the promptfoo host, which is the point to check for network paths, authentication and what telemetry leaves the application.

Three paths carry application spans into promptfoo's trace checks.

Which trace route fits your environment

Choose this route when your application can send traces straight to promptfoo and you do not yet have a trace store you want to query from the eval. promptfoo runs its own OTLP receiver, which listens on the standard OTLP HTTP port 4318 by default, so your application's exporter points at promptfoo during an eval run. This keeps the setup close to the tool itself and avoids standing up another service just to carry traces.

  • Fewest moving parts: the application exports to promptfoo and nothing else is required in the middle.
  • Good for local or CI runs: the receiver fits eval runs on a developer machine or a pipeline job where the application starts for the test.
  • Port planning: confirm that 4318 is free and reachable from the application, or change it in the promptfoo settings.
  • Limited history: traces exist for the run that received them, so plan how long you need to keep them if reviewers will look later.
  • Exporter settings: confirm the endpoint, protocol and any headers in the tracing docs for your SDK and language.

Before you choose this route, confirm that your application can export OTLP to a fixed endpoint in every environment where evals run.

How span attributes map to promptfoo assertions

This table maps each piece of trace data an assertion needs to the promptfoo concept that reads it. Use it to plan which spans your application must emit before you write trace-aware checks. Exact attribute names depend on your instrumentation library, so confirm them against the promptfoo tracing docs before you write any assertion.

Trace dataWhat it carriespromptfoo concept that reads itWhat to confirm
Tool name and argumentsThe tool or function the application called and the parameters it passedTrace-aware assertions on tool usageAttribute keys your instrumentation emits for tool names and arguments
Span hierarchyParent and child relationships showing the order of steps behind one responseExecution path assertionsThat your spans are nested correctly so the path reflects real call order
Span durationStart and end time of each spanTiming assertionsWhich span durations the assertion can read and the units used
Error statusWhether a span finished with an error and any error detailsError assertionsHow your library marks failed spans and whether the status is exported
Trace identifierThe ID linking spans from one request to a single eval caseMatching traces to test cases in the eval runHow the receiver associates incoming traces with each test
Service and resource attributesName of the emitting service and environment metadataFiltering traces when several services send to one receiverWhich resource attributes the receiver exposes for filtering
Span attribute namesKeys that hold tool, model and custom valuesAssertion field pathsExact key names for your library version, checked in the promptfoo tracing docs

Securing the trace path

Traces carry what your application did behind each response, including tool calls and their arguments, so the path from application to promptfoo needs the same care as any other sensitive data flow. The cards below cover who can reach the OTLP receiver, how exporters authenticate, what must stay out of trace data, and how to review the Collector configuration before it goes live.

Limit network exposure of port 4318

The promptfoo OTLP receiver listens on the standard OTLP HTTP port 4318 by default. Anything that can reach that port can send spans into your eval results, so bind the receiver only to the interface your application hosts can reach, and restrict it with firewall rules or network policy. Confirm which addresses can connect from CI runners, developer machines and application pods before any shared environment uses it.

Tracing docs

Know the self-hosted access gap

The self-hosted promptfoo server has no built-in authentication, RBAC or SSO, so it cannot check who is calling the trace endpoints or viewing results. Access control must come from the network or a fronting reverse proxy that handles authentication. Ask whether your team needs the Enterprise tier for SSO and teams-based access control before you rely on the self-hosted server for shared traces.

Self-hosting docs

Authenticate incoming connections on receivers

If traces reach a Collector in front of promptfoo, the Collector can require credentials on its receivers through authenticator extensions. OIDC-based authentication lets the Collector validate tokens issued by your identity provider before accepting spans. Confirm that the receiver in your chosen Collector build supports the authenticator you plan to use, because component stability varies and is documented per component.

Collector configuration docs

Add credentials to exporters

When the Collector forwards traces to Jaeger, Tempo or another backend that requires authentication, the oauth2client extension can attach OAuth2 client credentials to outgoing exporter requests. Store the client secret in your secrets manager and inject it at runtime rather than writing it into the configuration file. Verify that the credentials are rotated on your normal schedule and that the backend rejects requests without them.

Collector configuration docs

Keep prompts and tool arguments out of logs

Span attributes often hold full prompts, model responses and tool arguments, which may contain customer records, credentials or personal data. Decide which attributes the application records, and drop or redact sensitive fields in the Collector processing pipeline before export. Check the stored traces and the promptfoo results view with a sample eval to confirm that secrets from tool calls do not persist in either place.

Config best practices

Review the Collector configuration

Run a review of the Collector configuration against the OpenTelemetry security best practices before any shared deployment. Check that receivers are not bound to all interfaces without need, that unused components are removed, that TLS is enabled where traffic crosses networks, and that the pipeline matches the data you intend to keep. Repeat the review when you upgrade, because Collector releases change frequently and component stability differs.

Read the best practices

How to verify that a trace-aware eval catches a broken tool call

Before you trust a trace-aware eval in a pipeline, prove that it can fail. Seed a known-bad tool call in a small test application, such as a call to a tool the agent should never invoke or a required tool that is skipped, and run the eval against it. The trace-aware assertion should fail and name the offending span. Then fix the application, rerun the same eval against the same test case, and confirm the assertion passes. Keep both runs and their trace IDs as evidence. A second seeded case, a deliberately slow step that exceeds the timing threshold you set, checks the timing assertion the same way. Run these checks in a staging environment with the OTLP receiver configured as it will be in production, so you test the real export path and not a local shortcut.

Check that the trace is complete before you grade it. A missing trace must never be read as a passing result. In a verification run, confirm that every test case produced a trace in the receiver or in the backend you pull from, and that the spans for each tool call and each model call are present with the expected names and parent relationships. Sampling, batch exporters and dropped spans can all remove the evidence an assertion needs. Ask your platform team which sampling policy and exporter settings apply to the application, and confirm whether the eval path is sampled at the same rate as production traffic. Configure the eval to treat a test case with no trace as an error, so that a gap in telemetry shows up as a failed run.

Treat the OpenTelemetry Collector as part of the test path. If traces pass through a Collector before reaching promptfoo or Tempo, check its pipeline for processors that drop or filter spans, and review its drop and queue metrics during the run. The Collector's configuration best practices cover the settings to review before a production-like test. Finally, record which versions of the application, the instrumentation library, the Collector and promptfoo you tested, because a change in any of them can alter span names or attributes that your assertions depend on. Rerun the seeded failure cases after every such upgrade.

Why traces do not reach promptfoo and how to fix it

This table lists the failures teams most often hit when sending OpenTelemetry traces into promptfoo, with the likely cause and the fix for each. Work down the rows in order, starting with the receiver, because later symptoms such as empty Tempo results or missing Jaeger spans often trace back to the same endpoint or retention setting. The main takeaway is that a passing assertion on an empty trace is a false pass, so confirm spans arrive before trusting any trace-based check.

SymptomLikely causeFix
No spans received by the promptfoo OTLP receiverThe application exports to a different port or path than the receiver listens on, which defaults to 4318Set the exporter endpoint to the OTLP HTTP address and port 4318 that promptfoo listens on, and confirm the app and promptfoo run on the same network path
No spans received, connection refused or timeoutA host firewall, security group or network policy blocks traffic to port 4318Open the port between the application and the promptfoo host, then test reachability from the application container or pod before rerunning the eval
Empty results when pulling from Grafana TempoThe tempo trace provider is configured with the wrong URL, tenant or query settingsCheck the provider settings against your Tempo deployment, then query a known trace ID directly in Tempo to confirm the data exists
Empty results from Tempo for older runsTrace retention in Tempo is shorter than the gap between the eval run and the queryConfirm the Tempo retention window with your platform team and run the eval and the pull within that window
Spans present in the application but missing in Jaeger after forwardingThe forwarding exporter points at the wrong Jaeger OTLP endpoint, or Jaeger does not accept the protocol being sentConfirm the forwarding target and protocol against your Jaeger version's OTLP documentation, then send a test trace and search for it by service name
Assertions pass on traces that contain no spansTrace-aware assertions were written without checking that spans exist, so an empty trace satisfies a negative check such as no forbidden tool callAdd an assertion that requires a minimum span count or a specific expected span before the negative checks, so an empty trace fails
TLS handshake or certificate errors on the exporterThe exporter trusts a different certificate authority than the one that signed the receiver or backend certificateSupply the correct CA certificate to the exporter, and confirm the hostname in the certificate matches the endpoint being called
Authentication rejected by the collector or backendCredentials for the exporter are missing, expired or sent in the wrong headerRotate and reload the token, then verify the header name and value against the collector's authentication configuration, such as an OIDC or OAuth2 client extension

Questions buyers ask about promptfoo OpenTelemetry tracing

How much effort does promptfoo OpenTelemetry tracing take to set up?

The effort depends mainly on how many services emit traces, which backend holds them, and what authentication the receiving or pulling endpoints require. A single application sending OTLP traces to a local receiver is a small change. Several services, each with its own instrumentation, plus a shared Tempo or Jaeger backend behind authentication, adds configuration, network routing and testing work. Ask any partner to break the estimate into instrumentation per service, backend connection, authentication, and verification of the trace-aware assertions. No duration is supplied here, so treat any number you receive as something to confirm against your own environment.

Can an in-house team set up promptfoo tracing from the documentation alone?

A team with experience in OpenTelemetry instrumentation and a Node.js workflow can usually follow the promptfoo tracing documentation to enable the built-in OTLP receiver, which defaults to port 4318, and point an application at it. The harder parts are usually outside promptfoo: deciding how traces flow across services, handling sampling and retention in the backend, and writing trace-aware assertions that match your real execution paths. If your team has no prior OpenTelemetry work, budget time for learning the signal model before the first useful eval. Read the promptfoo tracing documentation first, then decide where you need outside help.

What does the work need from our team before it starts?

Plan for four inputs. First, access to the trace backend you will use, such as Grafana Tempo or Jaeger, with a read identity if promptfoo pulls traces and a write path if traces are forwarded. Second, a test application that produces representative tool calls, so assertions can be checked against real spans. Third, a Node.js host that meets the promptfoo requirement of Node.js 22.22.0 or newer, where the CLI runs. Fourth, a named owner who can approve network rules between the application, promptfoo and the backend. Listing these in the written scope before work starts prevents delays during testing.

Does promptfoo tracing require the Enterprise edition?

The promptfoo pricing page describes Community as free and including all LLM evaluation features, all model providers and integrations, and red teaming with 10k probes per month. It describes Enterprise as adding team sharing, SSO, custom roles, continuous monitoring and priority support. The supplied material does not state which edition unlocks tracing, so confirm directly with promptfoo or check the pricing page and the tracing documentation before you plan a licence. Ask the vendor to name the edition in writing for the exact features you intend to use, including the built-in receiver and the Tempo provider.

Is an OpenTelemetry Collector required for promptfoo tracing?

No. promptfoo has a built-in OTLP receiver and can pull traces from Grafana Tempo, so a Collector is not a prerequisite. A Collector becomes useful when you need a gateway that receives traces from many services and routes them to several backends, or when you need to enforce authentication on the path. The Collector supports authenticator extensions, such as OIDC on receivers and the oauth2client extension on exporters. Adding it means another component to version, secure and operate, so add it only when routing or auth requirements justify the extra work.

What cost drivers should we expect beyond the promptfoo licence?

The MIT-licensed promptfoo software has no licence fee of its own, so cost comes from the work and the infrastructure around it. One-time costs include instrumentation, backend connection and test design. Recurring costs include trace storage and retention in your backend, the compute to run evals, model API usage during tests, and the upkeep of Collector or Tempo versions. Costs rise with the number of services, trace volume, retention period and the frequency of scheduled runs. Ask any quote to separate one-time engineering from recurring infrastructure and to name who pays for each.

Can promptfoo tracing run securely in a regulated environment?

It can, provided the trace path is controlled. Traces can contain prompts, tool arguments and outputs, so treat them as sensitive data. Restrict who can read the backend, use authentication on the OTLP path where your design allows it, and keep traces inside infrastructure you control. Confirm with promptfoo how the receiver handles authentication and whether any trace data leaves your network. DeployOpen implements and hardens these self-hosted pieces inside your own cloud accounts, data centers or air-gapped networks, and prepares the configuration evidence your compliance team asks for.

Who should own the trace pipeline after go-live

The application team should own span quality, because only it knows which operations matter: model calls, tool invocations, retrieval steps and retries. Its job is to keep instrumentation consistent, name spans for the tools the agent actually uses, and record the attributes that trace assertions will read, such as tool name, outcome and error status. The platform team should own the path the traces travel: the OpenTelemetry Collector that receives and exports them, the Grafana Tempo or Jaeger backend that stores them, retention, access, and upgrades. The security or QA team should own the assertions and red team checks that read those traces. Agree these three owners in writing before go-live, and name a single person who can break a tie when a missing span could be either an instrumentation bug or a pipeline fault.

The split matters most when the agent changes. Adding a tool (for example, a new lookup or payment action) changes the execution path, so the trace assertions that check tool usage and call order must be updated in the same change request, or they will either miss the new tool or flag it as unexpected. The application team confirms the new tool emits a span with the expected name and attributes, the QA or security owner adds or adjusts the assertions and re-runs the suite against sample traces, and the platform team confirms that the new span attributes reach the receiver and backend without being dropped. Ask the vendor and your own environment to confirm exactly how the promptfoo tracing configuration references span names and attributes, since a renamed span can silently break an assertion that still passes on older traces.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.