Skip to content
WORKSI AI Control

OpenTelemetry, straight into Worksi.

Send OTLP/HTTP traces, JSON or protobuf, to your gateway. Spans that follow the GenAI semantic conventions become model calls, tool calls and agent steps with tokens and cost.

OTLP exporter
# the gateway's OTLP endpoint and your Worksi API keyWORKSI_OTLP="https://gateway.worksi.ai/v1/otlp/v1/traces"WORKSI_AUTH="Authorization=Bearer%20${AIW_API_KEY}" export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="$WORKSI_OTLP"export OTEL_EXPORTER_OTLP_TRACES_PROTOCOL=http/protobufexport OTEL_EXPORTER_OTLP_TRACES_HEADERS="$WORKSI_AUTH"# becomes the agent when no agent attribute is setexport OTEL_SERVICE_NAME="billing-agent"

GenAI spans in, Worksi spans out.

Span attributes override resource attributes, and explicit aiw.* attributes always win over the conventions.

OpenTelemetry attributes mapped to Worksi span fields
From OpenTelemetryWorksi field
gen_ai.operation.namekind: chat and embeddings → model call, execute_tool → tool call, invoke_agent → agent step
gen_ai.provider.namegen_ai.systemprovider
gen_ai.request.modelgen_ai.response.modelmodel
gen_ai.agent.nameservice.nameagent
gen_ai.tool.nametool
gen_ai.usage.input_tokensgen_ai.usage.output_tokensinput and output tokens
span statusstatus: ERROR → error

What you get.

OTLP spans land beside gateway and SDK spans, so traces, dashboards, detection and the AI Graph treat them the same.

  • Cost priced from your model registry whenever token usage is present.
  • The organization, workspace and environment come from your API key, never from span attributes.
  • Prompt and completion content goes through your capture mode and redaction, and is never kept as a raw attribute.
  • Loop and repeated‑tool detection when spans carry aiw.prompt_hash and aiw.args_hash.

Observation only. Model allowlists, budgets, rate limits, pause and stop apply to traffic that goes through the gateway. Send model calls through the gateway and keep OTLP for the rest when you need enforcement.

Point one exporter at the gateway.

Keep the exporter variables from the top of this page and run your app under OpenTelemetry’s instrumentation. Each OpenAI call becomes a GenAI span in Operations → Traces.

  • 3‑day trial with Pro features, no card.

Keep readingObservabilityGatewaySDKs

Terminal
# with the exporter variables set, run your app as it ispip install opentelemetry-distro \  opentelemetry-exporter-otlp-proto-http \  opentelemetry-instrumentation-openai-v2# traces only: Worksi ingests no metrics or logsexport OTEL_METRICS_EXPORTER=none OTEL_LOGS_EXPORTER=noneopentelemetry-instrument python app.py