Promptfoo
cetra reads the spans Promptfoo exports for an eval: the test cases, the provider calls and the graders of each assertion. Its model calls are llm spans, and its graders are evaluator spans.
Install
Section titled “Install”Install Promptfoo from npm. The fixture was captured with Promptfoo 0.125.1.
npm install promptfoo@0.125.1Set up
Section titled “Set up”Promptfoo exports its spans when it is switched on by its own variables. Set them, with the full traces URL, then run the eval.
export PROMPTFOO_OTEL_ENABLED=trueexport PROMPTFOO_OTEL_ENDPOINT=http://localhost:8080/v1/tracesexport OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer <SK_CETRA_KEY>"export PROMPTFOO_DISABLE_TELEMETRY=1export PROMPTFOO_DISABLE_UPDATE=1export PROMPTFOO_DISABLE_SHARING=1
npx promptfoo eval -c promptfooconfig.yaml --max-concurrency 1Replace <SK_CETRA_KEY> with your sk-cetra-… API key. See Send OpenTelemetry.
The config file needs tracing: { enabled: true }. Promptfoo starts its tracing only when the config enables it.
The fixture’s eval has one prompt, one provider, a contains assertion and an llm-rubric assertion. The llm-rubric assertion asks a model to grade the answer, so the eval makes a second model call. The fixture used --max-concurrency 1, which keeps the spans in a fixed order.
PROMPTFOO_OTEL_ENDPOINT is passed to the exporter as it is given, so it must be the full /v1/traces URL.
The header was checked with Promptfoo 0.125.1 and a local stand-in for cetra, not with cetra itself. With OTEL_EXPORTER_OTLP_HEADERS set, the trace POST carried Authorization: Bearer sk-test. With OTEL_EXPORTER_OTLP_TRACES_HEADERS set, it carried the same header. With neither, no Authorization header was sent. The fixture’s own capture sent no key.
What you get
Section titled “What you get”Each test case of the eval is a trace with these spans:
- a
spanfor the test case,promptfoo.test_case; - a
spanfor the provider call,openai:chat:gpt-4o-mini, and anllmspan for the model call inside it,chat gpt-4o-mini, with the token counts and the cost, which cetra computes from its price table; - an
evaluatorspan for thecontainsassertion,grader contains. It makes no model call; - an
evaluatorspan for thellm-rubricassertion,grader llm-rubric, with aspanfor the grader’s provider call and anllmspan for the grader’s model call, with its own token counts and cost.
Limits
Section titled “Limits”PROMPTFOO_DISABLE_TELEMETRY=1did not stop every request in version 0.125.1. Promptfoo still posts afeature_usedevent to its own servers.- No span has an input or an output, including the model calls. The messages and the answers of the eval are not in cetra.
- The span names are Promptfoo’s. The test case and the provider calls are plain
spans. - The fixture covers one provider and two assertions. Other assertion types and other providers were not captured.
- The fixture was captured with Promptfoo 0.125.1.
- If a field is missing, look at the span’s Attributes tab and compare it with Span attributes.
- Traces: read the trace as a tree and a timeline.
- Cost and tokens: how cost is computed from the token counts.