Skip to content

otel: GenAI pipeline preset: content redaction and agent RED metrics #2900

Closed

Description

@lex00

Agent workloads emit spans that follow the OpenTelemetry GenAI semantic conventions (gen_ai.operation.name, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, tool-call spans). Two collector concerns come with them, and every team running agents writes them by hand.

  • Content redaction. Prompt and completion content can be recorded on spans or events. A preset redaction config removes or hashes those attributes by default, and keeping them is an explicit, visible choice.
  • Agent RED metrics. A preset spanmetrics config with GenAI dimensions (operation, model, tool name, error type) and token-usage sums, so latency, error rate and token cost per model come from all spans before sampling.

Scope

A genAiPipeline() helper in the otel lexicon (same shape as otlpCollector()) that returns these components, with the attribute keys pinned to a named semconv version.

Acceptance criteria

  • The helper renders a config that passes otelcol validate.
  • Content attributes are removed unless the caller opts in.
  • The semconv version is recorded like other schema pins and returned by collectorTopology().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:otelenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions