Index Agentica

A recommended stack for agent evals and observability

Instrument an agent with OpenTelemetry GenAI conventions and OpenInference, inspect traces and run experiments in Langfuse, and gate quality in CI with Langfuse's experiment action plus Promptfoo config-file evals.

Type
Stack
Author
Agentica Author
Published
Last verified

Use case

Trace an agent with portable OpenTelemetry instrumentation, review live and offline quality in a self-hostable platform, and fail CI when dataset experiments or file-based evals regress.

Components

RoleComponentWhy
Trace conventionsOpenTelemetry GenAI Semantic ConventionsThe OpenTelemetry GenAI semantic conventions (status: Development) define spans, metrics and events for inference, embeddings, tool execution, retrieval and agent operations, plus MCP and Agent2Agent. Adopt them so traces stay portable as backends change.
InstrumentationOpenInferenceApache-2.0 conventions and instrumentation libraries, built on OpenTelemetry, for tracing LLM calls, agents, tools, retrieval and embeddings. Official docs say traces work with Arize Phoenix, Arize AX and any OpenTelemetry backend; span processors convert OpenLIT and OpenLLMetry traces into OpenInference form.
Observability and evals platformLangfuseOpen-source LLM observability you can use as Langfuse Cloud or self-host with Docker, Kubernetes or VMs (some add-on features require a license key). It receives OTLP at /api/public/otel, maps GenAI and OpenInference attributes, and adds datasets, LLM-as-a-judge, human annotation and experiments for online and offline evals.
Experiment CI gateLangfuse Experiment ActionMIT GitHub Action that loads your experiment script, runs it against a Langfuse dataset, comments the result on the pull request, and can fail the job when the script raises RegressionError. Official docs say to pin the action to a release; set langfuse_base_url for a self-hosted instance.
Config-file evals and red teamPromptfooOpen-source CLI and library for evaluating and red-teaming LLM apps with declarative test cases in a config file, automatic scoring, and local execution of evals (red-team generation may use hosted services). Use it alongside Langfuse when you want file-based evals that run on your machine or in CI.
Promptfoo CI actionPromptfoo GitHub ActionMIT GitHub Action that runs Promptfoo when monitored files change. On pull requests it evaluates the current checkout, can post a comment with pass/fail counts, and can fail the job when the suite pass percentage is below the optional fail-on-threshold input.

Why this stack

The catalog already has a hands-on evaluation loop and a comparison of observability platforms. This stack is the opinionated default those pages leave open: one portable instrumentation path, one self-hostable platform for traces and experiments, and two CI gates — one for Langfuse dataset experiments, one for file-based Promptfoo evals.

It is also distinct from the research agent stack, which includes Langfuse as a single tracing component. Here observability and evaluation are the whole design.

How the pieces fit

  1. Instrument the agent so every model call, tool use, retrieval step and agent turn becomes an OpenTelemetry span, following the GenAI semantic conventions and, in practice, OpenInference libraries.
  2. Export those spans over OTLP to Langfuse. Review live traces, promote interesting examples into a dataset, attach LLM-as-a-judge, code or human scores, and run offline experiments before you ship.
  3. In GitHub Actions, run the same Langfuse experiments with langfuse/experiment-action and fail the job when a score violates your threshold.
  4. Keep a second, declarative eval suite in Promptfoo (promptfooconfig.yaml) for local runs and for promptfoo-action on pull requests. Use Promptfoo's red-teaming when you also need automated vulnerability scans; compare red-team tools in Open-source red-teaming tools for LLM apps and agents.

You can swap the platform later because the traces are standard OTLP. You can also swap the CI gate if you only want one of the two eval styles.

Instrument with OpenTelemetry

The OpenTelemetry GenAI semantic conventions now live in their own repository, open-telemetry/semantic-conventions-genai. As of this writing the documents are marked Development. They cover client inference and embeddings, tool execution, retrieval, remote agent invocations, model and agent spans, plus technology-specific notes (OpenAI, Anthropic, AWS Bedrock, Azure AI Inference) and conventions for MCP and the Agent2Agent protocol.

OpenInference builds on OpenTelemetry with a span-kind taxonomy and attribute schema for LLM calls, agents, tools, retrievers and embeddings. Instrumentation packages exist for Python, JavaScript, Java and Go. The project's official site is openinf.dev; the README states that traces are natively supported by Arize Phoenix and Arize AX, and that they work with any OpenTelemetry-compatible backend because they are standard OTLP traces.

If you already emit OpenLLMetry or OpenLIT spans, OpenInference documents span processors that convert those traces into OpenInference form. OpenLLMetry itself is a set of Apache-2.0 OpenTelemetry instrumentations maintained by Traceloop; it is a reasonable alternative or complement when you already standardized on that stack.

Inspect and evaluate in Langfuse

Langfuse is open source. Official docs say you can use Langfuse Cloud or self-host it with Docker, Kubernetes or VMs, and that the instrumentation code is the same for both. Self-hosting runs the same infrastructure as Langfuse Cloud; some add-on features require a license key. The open-source portions of the repository are available under the MIT Expat license; content under documented ee/ paths uses a separate license.

Langfuse receives traces on the /api/public/otel OTLP endpoint (HTTP/JSON or HTTP/protobuf; official docs say gRPC is not supported yet). For a self-hosted instance the same path applies; docs give http://localhost:3000/api/public/otel as the local example and note that the OpenTelemetry endpoint was introduced in Langfuse v3.22.0. Authentication is HTTP Basic. When you send spans directly via OpenTelemetry, Langfuse v4 docs also ask for an x-langfuse-ingestion-version: 4 header so new data appears in real time on the v4 data model; without it, directly ingested OpenTelemetry data can be delayed by up to 10 minutes.

A minimal exporter configuration, using the official EU Cloud endpoint, looks like this (put the base64-encoded public and secret key pair in AUTH_STRING, and see the OpenTelemetry page for US, Japan, HIPAA and self-hosted URLs):

export OTEL_EXPORTER_OTLP_ENDPOINT="https://cloud.langfuse.com/api/public/otel"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=Basic ${AUTH_STRING},x-langfuse-ingestion-version=4"

Langfuse maps incoming GenAI, OpenInference and related attributes onto its data model. Official docs warn that if you want to filter or aggregate by identifiers such as userId, sessionId, metadata, version, release or tags, you should propagate those trace-level attributes to every span in the trace, not only the root.

For Python or JavaScript/TypeScript, Langfuse also documents its own SDK as the preferred way to set Langfuse-specific attributes, media and export. This stack still recommends OTLP plus OpenInference so a second backend (for example Arize Phoenix or Opik) can receive the same traces. The platform comparison covers Langfuse, LangSmith, Phoenix, Braintrust, Opik and Laminar, including license and self-host notes.

Once traces are flowing, Langfuse evaluation runs both online (scoring live production traces) and offline (running your application against a pre-defined dataset). A dataset is a collection of inputs and expected outputs; official docs highlight creating test cases from real production traces. You can combine LLM-as-a-judge, human annotation queues and custom scores via API or SDK, then compare experiments.

Gate changes in CI

Langfuse's experiments in CI/CD workflow is: create a dataset, write an experiment with the Python or JS/TS SDK, add evaluators, raise RegressionError when a score violates your threshold, and run the script with langfuse/experiment-action. Official docs say this works with Langfuse Cloud and self-hosted Langfuse.

The action loads the experiment script, runs it against a Langfuse dataset, comments the result on the pull request, and optionally fails the job when a regression is detected. should_fail_on_regression defaults to true. Pin the action to a release from the experiment-action releases (the official workflow example also recommends pinning to a release SHA). Store the Langfuse public and secret keys as GitHub secrets; set langfuse_base_url when you are not using the default https://cloud.langfuse.com.

Treat the CI gate as a release policy, not a scoreboard. Langfuse docs distinguish "every required case must pass" from "no approved passing case may regress," and they say missing cases, duplicate IDs, task failures, and missing or invalid evaluator results must fail the gate rather than count as passes.

Config-file evals and red teaming

Promptfoo is an open-source CLI and library for evaluating and red-teaming LLM apps. You describe prompts, providers and test cases in a config file (the getting-started example uses promptfooconfig.yaml), run promptfoo eval, and inspect results in a web viewer. Official intro notes that evals run on your machine and call the configured providers, while red-team generation may use hosted services.

promptfoo-action runs that config in GitHub Actions when monitored files change. The action's README states that on pull requests it evaluates the current checkout (it does not run separate base and head evaluations), can post a comment with pass/fail counts, and accepts an optional fail-on-threshold (required suite pass percentage from 0 to 100). Official docs still show promptfoo/promptfoo-action@v1; pin a release or commit as you would any GitHub Action, and pass provider credentials through GitHub secrets — never commit them.

Use Promptfoo when you want evals as files in the repo, a local red-team loop, or a CI check that does not depend on a Langfuse dataset. Use Langfuse experiments when the cases should come from production traces and the scores should live next to those traces. Most teams will want both.

Alternatives and going further

For a worked loop with official SDK snippets across more than one platform, follow Evaluate an AI agent. Re-check those commands against current vendor docs: that guide was last verified on 2026-10-14, and the pages cited here were checked again on 2026-11-22.

Caveats

Directory entries in this stack

Related

Sources

Machine-readable