/obstudio:otel-instrumentfrom Splunk Observability Studio
Adds OpenTelemetry traces, metrics, and local application logs via auto-instrumentation and custom signals. Generates Markdown and HTML reports with verification. Supports GenAI/LLM semantic conventions.
Ships in Splunk Observability Studio. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Add OpenTelemetry observability to applications using auto-instrumentation, default local application-log export, and optional custom spans or metrics.
Prefer the application's current runtime shape. If the project already uses Docker/Compose or Kubernetes, fit instrumentation into that path. If the user does not have Docker or does not want Docker, do not introduce containers just for observability; use the host/native runtime patterns.
Before editing application code, read ../references/report-flow-contract.md
and follow the Instrumentation Contract plus Reader-First Report Order. When
.observe/otel-audit.json exists, also read
./references/json-approval-handoff.md before editing; it owns canonical
selection, instrumentation JSON, and human HTML. The technical Markdown report contract is defined inline below.
On an incremental run, read the existing bound .observe/otel-verify.json
before editing or regenerating reports. Carry each selected failed scenario
and its evidence into the repair plan; rerun its actual check after repair
before replacing that failure with a passing result. Older passing probes for
other assertions do not supersede it. validate-flow proves artifact shape
and binding, not semantic correctness or successful verification.
For selected GenAI work, compare the audited operation role with the actual
model/tool control flow before editing. A model-directed tool/result feedback
loop owns an agent invocation even when its existing creator is labeled
invoke_workflow. Preserve the covering producer/provider and span topology;
repair the operation and source-backed agent identity on that span through its
supported hook. Preserve safe legacy consumer fields or document a migration
for a semantic/name change; do not add duplicate workflow/agent nodes or retain
a wrong operation solely because an existing test expects it. If the audit
omits or contradicts that role, refresh the affected audit closure and rebind
the authorized selection before implementation; never silently change an
unselected contract. Exercise no-tool, tool-feedback and failure turns and
prove each owns one agent span with its actual model/tool children, applicable
agent duration and unchanged business results. Fixed pipelines and inference
facades keep their independently source-backed roles.
For every source-owned agent runtime, read
../references/splunk-agent-observability.md and apply its Agent Resource And
Producer Decision matrix. Project, stream and routing are default assessment
requirements even with existing native OTel or Galileo; preserve Galileo's
native resource clients and exporter. For a bare/broad request without saved scope, refresh an audit that omits
these rows or excludes them solely because no AO request/SDK exists, then
materialize its selection through the canonical flow. An explicit saved
selection or user exclusion still limits implementation; retain its bound audit
and report omitted/unselected resource gaps separately without adding IDs or
rebinding old evidence.
When any selected finding uses
finding_group: splunk-agent-observability, or the repository contains a
splunk_ao dependency/import, also read
../references/splunk-agent-observability.md before editing.
For a fresh Python runtime with no existing telemetry instrumentation, or
uncovered functions on an existing Splunk AO producer path, read that reference
and complete its per-function producer decision gate before selecting creators.
An existing OTel/Galileo trace, metric, log or export-only pipeline stays on its
current stack; fill missing GenAI operations with OTel and supported hooks.
Record each native SDK @log, justified application-owned function-decorator,
or preserved-producer decision in existing plan/report evidence; a manual
context-manager scope alone does not instrument a fresh function by this gate.
For selected AO work, apply the shared reference's AO-Compatible Trace Root
contract before choosing root metadata or hooks. Map the real entrypoint and
its transport/GenAI ancestry to a supported AO representation, enrich an
existing genuine owner through public hooks, and preserve actual operation
roles, parent IDs and kinds. Include positive root-mapping and missing-parent
regressions; keep unsupported mappings and unavailable cloud assembly explicit
in remaining gaps. Resource routing or a conversation-root marker alone cannot
complete this contract.
Read the entire shared root section. Record physical root versus outermost
GenAI operation before implementation, and exercise the actual entrypoint for
root acceptance. If selected scope omitted a root gap, expose it for the
audit/selection flow instead of silently implementing it or declaring AO complete.
Classify controller state/commit/rollback ownership using that section's
conversation-controller case; one agent child does not make it transport-only.
Always read ../references/local-otlp-receiver.md before choosing exporter
endpoints. Resolve the active local receiver once during instrumentation and
persist standard OTel receiver configuration and supported AO SDK endpoint/auth
configuration in the application/deployment environment; generated
application startup must not query Studio-specific discovery APIs. Normal AO
SDK calls to a configured cloud-compatible endpoint are allowed.
When the project uses or introduces env files:
.env: When the project's dotenv launch needs configuration for selected instrumentation, create .env if it is absent; if it exists, merge only the required new or changed settings in place. Derive required inputs and their consumed variable names from the selected initialization, resource-resolution, and exporter code. Persist the separately discovered AO API origin when that path requires it; project and Agent Stream names alone do not configure a resolver that also needs an origin. Leave optional knobs at their existing defaults unless the selected work needs an override. Preserve credentials, unrelated values, unchanged settings, and existing comments. Add .env to .gitignore before writing local values. An existing file is not a reason to skip the configuration update, and a missing file is not a reason to provide only an example..env: Add a short comment describing each new or modified variable and use the resolved non-secret value when known. Leave documentation for unchanged configuration untouched. Document an unknown credential or unresolved setting with a commented placeholder, such as # API_KEY=<set locally>, instead of an active fabricated value. Update an existing assignment rather than appending a duplicate..env.studio.example as the safe Studio template: When Studio configuration is selected, include only the selected producer's supported variables, descriptions, and safe local values. Do not copy credentials or unrelated application settings from .env. Discovered local endpoints may be active examples; leave unresolved endpoints commented and report the exact blocker. Keep direct-cloud credentials out of this template. Never add .env.studio.example or .env.example to application startup, dotenv fallback chains, shell sourcing, or launch arguments; persist supported values in the active .env instead..env.example, or introduce .env.studio as a second runtime file. Preserve any pre-existing .env.example unchanged. An explicitly requested additional profile remains user-owned scope..env: Before reporting dotenv configuration complete, verify that .env exists at the path the real launcher loads and contains the persisted selected settings, then exercise that existing runner or loader through the selected resolver/exporter configuration boundary. Clear inherited test overrides for the inputs under test so they cannot mask an incomplete file. A zero-exit local-only fallback does not prove selected AO configuration; show that the consumer receives every required input, using credential-free external-I/O stubs when live access is unavailable, and keep that proof separate from resource identity and delivery. Prove selected configuration still reaches the consumer when the example template is unavailable, using an isolated copy or a read guard; this must not depend on a second template-loading call. Record the active file path and configuration outcome in the instrumentation report; a template or a proposed launch command alone is insufficient. Explain that .env.studio.example is a template, not an automatically loaded runtime file. Keep one AO mode active and remove conflicting inherited mode variables from the launch environment. For a repository using a native configuration system instead of dotenv, preserve that system rather than adding a new dotenv loader.Before editing anything, ground the plan with repo evidence:
When .observe/otel-audit.json exists, treat it as the canonical audit.
Executable scope may come from a selected-audit copy's review_selection,
from a valid current .observe/otel-selection.json, or from exact IDs supplied
in the current request; when none are present and the user asks for bare or
broad instrumentation, use deterministic select --all. .observe/otel.html
is the audit and scope-planning surface. Never open or read an audit Markdown
report. Before any application-code,
dependency, runtime-config, or test edit, read and follow
./references/json-approval-handoff.md. Do not proceed without a validated,
nonempty executable selection. A valid answer-only handoff persists
decision_answers but authorizes no code edits.
Before the first application/configuration edit, retain the selected audit's
exact bytes and SHA-256 as evidence. After implementation and tests, compare
the canonical audit with that snapshot before writing bound results. Do not
rewrite findings, scenarios or acceptance, re-finalize the audit, or regenerate
selection after edits to make implementation pass. Implement the original
selected contract or report its remaining gap. If the agent changed the audit,
recover its own changes from the snapshot and rerun against the original
contract; never overwrite concurrent user changes or rebind old proof to a
changed audit. Report an externally changed contract as stale instead.
Selection precedence is current-request exact --ids, then an existing or
embedded repository selection, then an explicitly supplied saved-audit
candidate, then an automatically adopted saved audit only when no repository
selection exists, and finally bare/broad select --all. Unless current-request
--ids already wrote a fresh selection, run the shared adopt-selection helper
as an idempotent preflight step before reporting a missing selection. If the
helper prints PASS: or wrote, immediately run validate-flow and continue
the same $otel-instrument run; do not ask the user to move a download, save
again, or rerun instrumentation. If no valid current selection exists and the request is
bare/broad, run select --all; if it prints manual-decision options, stop
before edits and present those exact --decision OTEL-###=option-id choices.
Always drop stale selection and result artifacts from the active flow after
validating the current audit. Move their original bytes into a unique
.observe/history/<run>/ folder and continue without asking whether to keep
old scope or reuse old finding IDs. Follow the handoff reference's binding
checks: stale selection invalidates its downstream results; stale results alone
do not invalidate a valid current selection. Current exact --ids take
precedence, then a valid current selection; otherwise a bare/broad request uses
select --all against the current audit. adopt-selection --all-if-empty does
not itself recover a no-match error: run select --all and continue this same
run through validate-flow and required-input checks. Never restamp old proof
or carry old answers, destinations or approval metadata onto a changed audit.
Never choose between mutually exclusive telemetry owners or paths. Stop before
edits when the current audit is invalid, not broad enough to imply all eligible
work, the bound/created selection has empty approved_ids, or required inputs
are unresolved. Follow the generic required-input preflight in the JSON handoff
reference and ask for only missing values before continuing.
Implement exactly the dependency-closed selected IDs.
Bind .observe/otel-instrumentation.json to the entire normalized selection
with selection_sha256, not only to its audit and executable IDs. This digest
includes decision_answers and any schema-v3 ao_target; changing an answer
or AO target invalidates older
instrumentation even when approved_ids is unchanged.
After every selection creation or update, including required-input answers,
repeat the handoff's downstream binding checks against the resulting selection
before application edits; archive newly stale results and retain matching proof.
When no canonical audit exists, a direct request for the standard
auto-instrumentation and default-local-log baseline may proceed after this
preflight without fabricating audit IDs or selection artifacts. Keep that
no-audit path limited to the standard baseline: stop before custom signals,
incident-readiness or GenAI work, or any request that needs finding-level scope,
and ask the user to run $otel-audit first. Never infer scope from generated
Markdown reports.
./references/project-runtime-validation.md, inventory the repository's
configured runtime and build/test commands, and select the locally available
project runtime before editing. Do not use the shell's default runtime when
wrappers, toolchain files, manifests, CI, or existing project environments
select another one.docker-compose.yml, Kubernetes manifests, package.json scripts, Makefile, Procfile, PM2 configs, Supervisor configs, systemd units, launchd plists, PowerShell scripts, or a plain shell commandnone foundtelemetry_changes[].consumer_compatibility.../otel-audit/scripts/scan_python_otel_topology.py <service-root> when that
bundled scanner is available and reconcile its candidates with source.
Existing ownership of any one signal makes this an incremental integration;
it does not prove that the other signals are configured.otlp and the logs
endpoint is absent or exactly the detected local Splunk Observability Studio receiver. Treat
OTEL_LOGS_EXPORTER=none as an explicit opt-out, and preserve every other
explicit exporter as operator-owned without validating or supplementing its
endpoint. An explicit non-local logs endpoint with an absent or otlp
exporter is an operator-owned boundary conflict: do not construct or enable
a Splunk Observability Studio log provider, exporter, or bridge; fail closed and report the
configuration for operator resolution. Plan one log provider, one exporter
path, and one bridge; preserve existing stdout/file sinks and identify any
duplicate bridge before editing.OTEL_LOGS_EXPORTER=otlp with the resolved local Studio logs endpoint and
matching protocol, alongside trace and metric export. Do not generate none
as the default or use an unrequested log-disable override to make startup or
verification pass. Honor a real explicit user/operator opt-out separately;
SDK @log GenAI spans and stdout correlation do not replace OTLP LogRecords.
Verify application log receipt in Studio as well as traces and metrics..observe/otel-audit.json exists, use only the validated selected
findings and their referenced verification.scenarios and environments as
the implementation and validation plan. Preserve every stable finding,
scenario, and environment ID. Keep each proof_level; do not downgrade a
full runtime scenario to focused call-site proof.../references/splunk-agent-observability.md. Preserve explicit active
destinations and prove mode isolation, resource-before-export ordering,
and resource-resolution failure without live cloud credentials.
Request project and Agent Stream names for new destination inputs. Consume
names, legacy IDs, and any saved creation prohibition from the validated
selection's ao_target; follow the shared input compatibility contract.
Project and Agent Stream are
required whenever any AO work is selected. If either is missing, ask for the
missing values and wait; do not silently use application settings or proposed
service-derived names. Values already supplied in the current request or
validated selection satisfy the requirement without asking again. Follow the
shared AO reference's Idempotent Resource Provisioning contract: reuse exact
existing resources, create missing selected named resources, and recover
duplicate races through bounded exact relookup. A resource input changes
the selection digest but never adds unselected findings.
Follow the shared reference's Native trace binding and recovery contract:
selected names must resolve/reuse automatically when the API becomes
available in the same running app PID. Include UUID routing headers and
splunk_ao.project.id / splunk_ao.logstream.id on native trace Resources
from one resolved pair. Preserve valid known bindings through a temporary
disconnected Studio; neither a manual setup command nor restart is normal
recovery. Keep SDK-owned routing and unrelated signal Resources intact.
Use the application's real launch profile and native vendor aliases when
applying the accepted target. Galileo uses its supported GALILEO_* settings
and constructor arguments. The AO SDK uses SPLUNK_AO_PROJECT or
SPLUNK_AO_PROJECT_ID and SPLUNK_AO_AGENT_STREAM or
SPLUNK_AO_AGENT_STREAM_ID. Supplied selection values take precedence.
Preserve unrelated OTel settings, credentials and destination settings;
create the active .env if absent, or merge the selected configuration into
the existing file in place, with documented safe values. Keep
.env.studio.example as the safe Studio template. Materialize the accepted
complete target in the selection before provisioning. A destination pair
does not authorize unselected resource creation or routing changes.
The bundled Python helper reads omitted
selectors from the process environment; load the env profile through the
project's runner, such as uv run --env-file .env, or pass existing
application-native alias values as explicit helper arguments. Do not add a
new dotenv parser or gateway-specific config loader to application code.
Validate that the actual launch reads the persisted target, and record its
source as the accepted supplied input. No selected
AO work means no AO env additions or resource creation.../references/incident-readiness.md.../references/incident-readiness.md: map
each failure mechanism to the owning code or platform surface and classify
the proposed signal as MTTD-improving, localization-only, or still uncovered
before editing.../references/genai-readiness.md.
Follow its GenAI Semconv Source Contract before editing: reconcile detected
AI surfaces with official semconv docs when available, record
live-or-snapshot provenance, and build a semconv closure matrix.
Apply GenAI Instrumentation Selection and the Required GenAI Coverage
Profile. Only a target runtime with no existing telemetry instrumentation is
fresh; generic OTel, metrics-only, logs-only and active export-only pipelines
stay incremental. Read ../references/splunk-agent-observability.md for a fresh
agent even without an existing SDK import: use supported Splunk AO
span creators/framework integration when a compatible SDK exists for its
language; otherwise select native OTel with the full applicable field profile.
For a selected supported AO SDK, use the shared per-operation public
OTel exception only for source-proven incompatible SDK boundaries. An
export-only processor is not a creator. Preserve all existing producers,
providers and exporters and fill only proven gaps. Record before/after
operation and field inventories and prove no lost coverage or duplicate
operation/export. Applicable safe content/vendor fields are required
acceptance; a published Opt-In label or metadata-only span is not closure.../references/genai-readiness.md: map each AI pathway failure mechanism to
the owning provider/model gateway, workflow, tool/function execution or
AI-owned session/stream including MCP when present, retrieval/RAG, streaming,
token/context, prompt/response parser, safety/policy, AI-derived data,
model/config rollout, or AI-owned state surface before editing../references/languages/java.md (Preflight section) and classify as auto-only, custom-with-provider, custom-provider-external, or missing before editing.service.name, service.version, and environment source.
Also record available low-cardinality region, platform, image/artifact,
config, and rollout sources. Prefer existing OTel semantic-convention or
platform resource attribute names, including deployment.environment.name,
cloud.region, cloud.platform, container.image.name, and
container.image.tags. Treat deployment.environment,
deployment.region, deployment.platform, and container.image.tag as
legacy or custom input aliases only, not names to newly emit or reasons to
duplicate the standard attributes.Do not proceed until you can state all of these clearly:
service.nameapproved_ids) in audit order, and the validated selection path when
.observe/otel-audit.json exists./references/languages/java.md Preflight section)State these preflight values together in one explicit progress note before the
first file edit. Do not defer service.name or environment ownership to the
final report.
If the user is asking for a specific signal ("add a metric for queue depth", "track error rate on payments", "add a span for the indexing job") AND the preflight scan finds OTel SDK already initialized:
When a canonical selection exists, this fast path still covers every selected
ID, including executable dependencies added by select; never reduce it to one
requested signal.
If the preflight scan finds no OTel SDK, tell the user auto-instrumentation needs to be set up first and continue with the full workflow (Steps 2-3).
When the canonical audit contains partial or missing
current_instrumentation.incident_readiness rows, reconcile each row through
its selected finding with the same area. Treat the matched pair as one
implementation contract. The
readiness row names the surface and detection/localization impact; the gap row
names the complete required fix and instrument mode; its acceptance scenarios
name the code path, expected telemetry, proof level, and acceptance criteria.
Do not create a second gap ledger or silently synthesize missing fields. If an
older audit lacks the current prioritized gaps or verification plan, regenerate
the audit before claiming one-to-one closure.
If the user broadly asks to improve incident readiness or MTTD, resolve every
safe app-owned incident gap to exact IDs and create the selection before
editing. Do not choose one representative gap unless the user explicitly
narrows scope. manual decision and external follow-up rows cannot enter
the executable selection. A recorded decision_answers choice may unlock only
the matching executable rows, which still require explicit selection. Track
the named external owner outside instrumentation; never guess either boundary.
Use ../references/incident-readiness.md to turn each owned gap into concrete,
low-cardinality signals. In particular, add or prove the applicable surfaces:
Do not treat a bare time-since-last-update or time-since-last-success gauge as
detector-ready staleness when healthy idle periods are possible. Require a
source-backed expected cadence, pending/backlogged work, or accepted input that
should have produced the update. Without that evidence, classify the age gauge
as context or localization-only and use backlog, queue delay, or missed
schedule as the MTTD-improving detector input.
For repositories with both web/API and background-worker processes, apply the
Multi-Process Web And Worker Services contract in
../references/incident-readiness.md. Each process needs a distinct,
operator-overridable service.name default. Initialize its provider and
framework instrumentations only from that process's actual entrypoint or
startup hook; importing a worker/task module from the API must not configure
worker telemetry. Instrument enqueue and task success/failure at their owning
call sites, and explicitly record worker exception status before rethrowing.
Framework hooks or assumed auto-instrumentation are not a substitute for an
app-owned failure path when the readiness gap requires one.
Focused incident-readiness tests must execute the success and failure call
sites and assert emitted telemetry through an in-memory exporter or equivalent
app-code seam. AST, grep, source-string, or compile-only checks are not telemetry
proof. If dependencies cannot be restored or imported, keep the executable
tests, report the exact blocker, and mark dynamic verification Blocked or
Not proven; do not replace the tests with static assertions.
For Go changes involving goroutines, channels, queues, asynchronous persistence
or indexing, eviction, or observable callbacks, run go test -race for every
changed package. If that cannot run, record the exact toolchain/platform blocker;
a normal go test pass does not satisfy this concurrency gate.
For incident evidence, target the failure mechanism rather than its endpoint
symptom. Mark a signal MTTD-improving only when it can support a detector
before or at first customer impact; mark it localization-only when it mainly
narrows an already-detected fault. Endpoint RED metrics alone do not close an
auth handshake, secret expiry, stale output, rollout skew, dependency target
loss, stream lifecycle, or pool-saturation gap.
Extend the internal Audit-Driven Gap Closure matrix with the readiness surface,
required signals, MTTD/localization classification, implemented or proven
signals, tests, remaining signals, and owner. A row cannot be Working while
any required signal is absent, merely listed as a follow-up, or supported only
by an unexecuted test. If no app-owned candidate can be patched accurately and
safely, add no placeholder instrument; owner-map the exact prerequisite and
keep the row Deferred, Not configured, or Not proven as appropriate.
If the canonical audit contains top-level genai_readiness, use those rows as
the source of truth. The audit output is a contract, not background context.
Parse each row by human-readable surface plus required_signals,
owner/source_files, and acceptance_criteria. Use the surface name as the
human-facing identifier throughout implementation and reporting.
Reconcile the selected finding's complete required_fix, acceptance,
expected_telemetry, and readiness required_signals with the Required GenAI
Coverage Profile before implementing or planning. A historical subset cannot
erase requested workflow/agent operations or applicable content/vendor fields.
If those authored contracts disagree, report the exact stale fields and
refresh/rebind the audit selection through the normal flow before code changes;
do not silently narrow the work or mutate a bound audit to make it pass.
Apply the per-tool vendor content contract in
../references/genai-readiness.md before closing a selected tool finding.
Inspect the actual SDK/preserved producer's tool output: arguments/results
without input/output message mappings remain a gap. Populate both GenAI pairs
on the same existing tool span, or its supported OpenInference equivalent,
using the same pre-SDK sanitized arguments and produced result. Name the
supported enrichment hook and prove the span ID stays unchanged; preserve the
producer, provider/exporter and business calls. Do not add a wrapper span or
assume add_tool_span/a callback supplies fields that were never observed.
Test arguments/results-only and parent-only-message cases as failures, a
schema-valid matching tool as success, and error/no-result as truthful output
applicability without fabricated completion.
For every GenAI plan/report, populate all three Required GenAI Report
Evidence tables in ../references/genai-readiness.md. Each operation row
must join its actual boundary to its exact creator, kind/parent, version/example
revision and safe-content hook. Include separate field rows with official
Opt-In provenance, both vendors' expectations and concrete numeric capture
settings. A global SDK API list plus a separate boundary list is insufficient.
For a plan-only GenAI request, produce the same concrete producer and field decisions without claiming implementation or runtime proof. Name the existing or proposed creation API, matching SDK/library version and official example path/revision for each runtime scenario. Map every selected workflow, agent, model and tool to its actual source boundary. Include one field row per applicable input/output, instruction/tool definition, argument/result/message mapping, provider/model, known parameter/response/usage/stream field and opaque correlation ID: source value/hook, current value or gap, intended supported API, schema/redaction policy and test. State exact lifecycle/parent/duplicate and auxiliary timeout/cancel proof. Copying an old Required Signals subset or writing only 'SDK logger/schema helpers' does not satisfy a reviewable plan.
For a GenAI plan or report with supplied cases or captures, build a case ledger before drafting the assessment. Give each distinct source boundary, case and probe-only operation an addressable entry with these joined facts:
| Case and actual operation | Available source/probe values or exact absence | Chosen public producer/API and applicable span_type | Concrete acceptance assertions | Source/capture/proposed/executed proof and remaining gap |
|---|
Equivalent prose or grouped sections are fine when each child operation has its own decision and assertions. Reconcile every ledger entry against the completed report; a category, parent row or promise to check later does not close an unassessed child. Keep unavailable facts explicit rather than inventing arguments, metadata, native node IDs/counts or execution:
@log function and applicable span_type, or the exact
unsupported contract and application-owned function-decorator SDK creator
fallback for each. Assert actual known arguments/results, receiver capture,
distinct-operation counts/parentage, yielded values or re-raised errors at
their own boundary. Separate a planned assertion from captured proof when
the probe lacks receiver/arguments, native nodes or terminal OTel fields.
Preserve nesting and business/protocol behavior without duplicate wrappers;
dispatch support alone does not prove fields, privacy, lifecycle or sink.OTEL_LOGS_EXPORTER=otlp, resolved same-namespace logs endpoint and
matching protocol. Name the planned or captured bounded/redacted body,
severity, shared service resource and trace/span IDs matching the owning
span, alongside separate span and metric-datapoint receipts. Assert one
native LogRecord per application log call, retention of the actual original
stdout/file sinks, owned log-provider/bridge drain and close, and local-only
routing with no cloud log forwarding. SDK @log spans, stdout correlation
and exporter settings alone do not supply this application LogRecord proof.When supplied dependency compatibility facts are sufficient to decide, select the newest compatible candidate in the plan and explain each rejected newer candidate using the actual runtime, peer, API and lock constraints. Do not defer that supplied-case decision to implementation. Keep fictional policy selections and dated captured versions distinct from a new live package lookup, actual installation and future shipped defaults. When actual SDK/exporter/bridge metadata or a project solver result is absent, record those components as unresolved with the missing evidence; do not invent an actual compatible graph from historical probe versions. Before authorized dependency application, resolve the coherent graph and bind installation to its exact checked specs or lockfile, preserving constraints and checking the installed graph/APIs. Never apply unresolved placeholders or re-resolve a floating latest tag after checking a different candidate.
Reconcile every GenAI audit gap to a required instrumentation result:
| Audit Gap | Required Instrumentation Result |
|---|---|
| App-owned + patchable | Code added + tests |
| App-owned but unsafe/too large | Explicitly split into named follow-up batch |
| Provider/platform-owned | Owner mapped with exact missing source |
| Already covered | Proven with source path and signal name |
For each surface row, produce and maintain a closure matrix:
surface -> required_signals -> implemented_signals -> tests -> remaining_signals -> status. The final gate is strict: the instrumentation
pass cannot say covered, fixed, closed, or complete unless every
required GenAI signal is either implemented with tests, proven existing with
source path and signal name, or explicitly owner-mapped with the exact missing
source. Optimize for honesty over broad progress. Partial closure is acceptable;
silent partial closure is the bug.
For every GenAI instrumentation run, include a concise closure summary in the
final response. It must name remaining GenAI signals, or say Remaining signals: none
only when the closure matrix has no partial rows. Do not use unqualified
phrases such as expected coverage, covered, or complete for a GenAI surface
unless the related row is fully closed by the matrix.
When the canonical audit declares GenAI ownership, project
## GenAI Readiness Closure in .observe/otel-instrumentation.md after
## Audit Gap Closure only for selected GenAI finding surfaces. Copy the
selected surface and its complete Required Signals cell from the audit
readiness table, then record Implemented / proven, Tests, Remaining signals, and Result. Use one row per selected GenAI finding area in selected
finding order; do not include unselected readiness surfaces. Use Working,
Not working, Not proven, Not configured, or Deferred to match the bound
instrumentation or verification JSON status. Working requires Remaining signals to be exactly None; all other results must name the remaining
signal, blocker, or external owner. Omit the section when the source audit
explicitly declares No or when no selected finding maps to a GenAI readiness
surface. If the ownership declaration and readiness table disagree, regenerate
the source audit before instrumentation.
When no canonical source audit exists, do not create ## GenAI Readiness Closure, invent closure rows from the implementation pass, or continue
audit-driven instrumentation.
If the canonical audit contains genai_readiness rows with partial or
missing status and the user asked to instrument, treat those rows as an
approved request for custom GenAI readiness instrumentation. Do not stop after
auto-instrumentation and do not ask the Step 4 custom-instrumentation question
for GenAI gaps that the repo clearly owns.
Treat the validated dependency-closed selected finding set as the implementation queue, not report background:
select; never add unselected work. Priority orders the audit only and never
authorizes instrumentation scope. When a selected GenAI finding lists
content attributes in expected_telemetry or required_signals, implement
those exact attributes without a second content-capture approval or runtime
enablement flag. Do not add content attributes absent from selected findings.
Before editing a selected model, retrieval, or tool finding, reconcile its
listed content attributes with the current source boundaries and all eight
attributes in the shared Content Capture Governance Contract. If a stale
audit omits an applicable source-backed attribute, do not silently expand
selected scope or call the finding complete: refresh the audit and selection
first. For every listed content attribute, record a redacted, truncated,
schema-conforming value from its actual owning boundary on the canonical
model, retrieval, or tool span before that span ends. This includes provider
input/output messages, observable system instructions and tool definitions,
retrieval query and documents, and tool-call arguments and result. A
metadata-only span, an HTTP-body substitute, or a test that checks only span
existence does not close any listed field. Keep the selected finding partial
or blocked until focused completed-span tests prove each listed attribute,
its structured shape, and the absence of raw content.expected_telemetry or required
signals before creating it. A selected token-usage histogram does not also
select input-token and output-token counters merely because those counters
are current semantic-convention alternatives or can be derived from the
same provider response. Do not implement, test as selected, or claim those
additional counters unless a selected finding explicitly requires them..observe/otel-selection.json before editing.manual decision or external follow-up IDs,
an unanswered manual dependency, an unknown answer, executable work outside
the recorded option's unlocks, or work blocked by an external follow-up.
decision_answers is separate from requested_ids and approved_ids; it
remains decision state and never auto-selects work. Manual and external
findings remain visible audit state; they are not implementation queue
entries.telemetry_changes. Leave existing logging intact unless a
selected finding explicitly requires log export.finding_group; do not invent a group for ordinary OTel findings.## GenAI Readiness; the readiness row remains
the detailed required-signal contract and the prioritized gap remains the
user-facing work item.finding_group: splunk-agent-observability rows, implement the
source-backed product or routing configuration described by the finding and
its executable dependencies. Use configuration telemetry changes for
Agent Observability resource settings rather than inventing spans or metrics. Leave durable
app/deployment configuration for the selected API and ingest endpoints. In
gateway mode Studio owns cloud realm/credentials; the application uses only
supported resource/export configuration and local credentials when required.
Existing non-AO paths use the discovered standard resource HTTP API and
existing trace exporter; add no AO SDK configuration or dependency.
For a selected Python SDK-owned Studio gateway path, follow the shared AO reference's populated
profile contract: persist SPLUNK_AO_API_URL, SPLUNK_AO_CONSOLE_URL, and
SPLUNK_AO_API_KEY=local-gateway in the actual loaded env profile before
running provisioning. Use the discovered API base, preserve non-default
ports, and prove the generator and provisioning process receive all three
values. Adding keys to a pass-through list or unused sample is insufficient.
Preserve project/stream headers on each export, never a global Studio route
registration. Keep unselected AO findings untouched.
Include and execute a supported provisioning step instead of implementing
only Projects().get() and AgentStreams().get() with placeholders. For
Python, use scripts/resolve_ao_resources.py through the project runner, or
implement an application-native equivalent with the same tested contract.
Persist the resolved project/stream bindings in the actual launch profile
before initializing the selected trace export path. Verify both-existing
(zero creates), both-missing, mixed, repeated-run, duplicate-race, and
failure-isolation paths with real loopback HTTP API fakes for SDK-free
paths, or compatible SDK clients for an SDK-owned path. A live API failure blocks resource delivery
proof, not implementation and testing of creation. Record creation as
attempted/blocked/recovered accurately and rerun when the prerequisite is
available; do not replace the selected creation work with an operator task.uv sync, create or update uv.lock,
run uv sync --locked for the default launch (or the same locked extra/group
profile used by the actual launch), then import and
exercise the actual selected exporter without live credentials. Existing
SDK-free exporters do not require installing the AO SDK. A preflight
environment containing an optional exporter does not prove that a later normal sync kept
it installed. Treat missing credentials for remote project, Agent Stream,
or delivery proof separately from dependency resolution: credentials do not
block local lockfile, import, or configuration checks. If package resolution
itself is unavailable, record that exact blocker and keep export
Not proven or Not configured as appropriate; a manifest entry plus
placeholder environment variables is not durable deployed routing.Build an internal closure matrix before editing:
finding ID -> area -> priority -> required fix -> instrument mode -> planned action -> verification scenarios. Update it after validation and verification. Do not
mark a row Working merely because code changed or a shared helper test
passed. Closure requires the source change or proven existing implementation,
the applicable project-runtime validation gate, and $otel-verify proof at the
audit scenario's proof level. In particular, execute every named route, span
call site, metric path, log pipeline, and duplicate-prevention scenario the row
references.
Check the three GenAI evidence tables before finalizing, including explicit INTERNAL-agent provider, tool input/output message mappings and lifecycle rows. Keep proposals separate from executed proof; correct omissions in the plan without claiming that implementation or verification ran.
Always write .observe/otel-instrumentation.md. In canonical flow,
./references/json-approval-handoff.md remains the machine-schema and
instrumentation-HTML authority: write and validate
.observe/otel-instrumentation.json, render
.observe/otel-instrumentation.html, keep every selected finding exactly once,
and leave .observe/otel.html as the audit surface. On the permitted direct
baseline path where canonical JSON is absent, write the technical Markdown
report only, identify the source audit and selected scope as not applicable (direct baseline), and do not create instrumentation JSON/HTML or fabricate
audit IDs. Do not infer scope from generated Markdown reports.
Users open .observe/otel-instrumentation.html after instrumentation to review
the selected findings, what code/config changed, how observability improves,
telemetry proof, product-delivery status, and remaining prerequisites. Do not
use it to change selected scope; direct scope changes back to .observe/otel.html
and rerun instrumentation from the newly saved or copied command.
Use this shape:
# OTel Instrumentation Report: <service>
**Result:** Pass | Partial | Fail | Blocked
**Source audit:** `.observe/otel-audit.json` | not applicable (direct baseline)
**Selected scope:** `.observe/otel-selection.json` | not applicable (direct baseline)
**Verification report:** `.observe/otel-verify.md` | not run | blocked
**Detector report:** `.observe/detectors.md` | not requested | blocked
## Executive Summary
## Flow
## Files Changed
## Signals Changed
## Audit Gap Closure
<!-- Include the next section only for a GenAI source audit. -->
## GenAI Readiness Closure
## Validation Gates
## Verification Handoff / Results
## Detector Handoff / Results
## Remaining Gaps
## Next Steps
Signals Changed is the implementation-change inventory. Include:
| Signal type | Added | Modified | Removed | Product result / next product action | Evidence | Verification status |
|---|---|---|---|---|---|---|
| Traces/spans | exact span names or None | exact changes or None | exact removals or None | waterfall/map/filter result and follow-up | source paths + tests/harnesses | verified/partial/not run/blocked |
| Metrics | exact metric names or None | exact changes or None | exact removals or None | chart/dashboard/detector action | source paths + tests/harnesses | verified/partial/not run/blocked |
| Logs/events | bridge/event names or None | exact changes or None | exact removals or None | query/correlation result and follow-up | source paths + tests/harnesses | verified/partial/not run/blocked |
| Runtime/config | service/exporter/env/startup settings or None | exact changes or None | exact removals or None | service/environment/export diagnostics | startup/config paths | verified/partial/not run/blocked |
| Dependencies | OTel packages or None | version/package changes or None | removed packages or None | enabled runtime behavior | manifest/lockfile paths | verified/partial/not run/blocked |
Do not claim a removal unless the previous report or Git diff proves the signal
or configuration existed and current source proves it was removed. Use None
for empty cells. The final response must summarize added, modified, removed, and
unchanged signals by signal type and point to this report.
If any item changes an existing telemetry consumer contract, include a concise
Consumer compatibility subsection that lists the existing contract, whether
the change is compatible, breaking, or requires review, and the migration for
breaking changes.
For canonical scope, treat every instrumentation
findings[].telemetry_changes[] row as the durable code-to-product mapping.
Preserve its stable item ID, concrete code/config change, exact source or call
site, signal kind, newly added attributes/dimensions, product view, audit
scenarios, and item-specific follow-up actions. A free-text finding changes
list is not item coverage. Preserve audit-authored keys and bounded values
exactly. Never auto-publish without the downstream review workflow.
For selected incident-readiness work, include this nested table:
| Surface | Exact signal | Role | Detector use / reason | Proof | Remaining owner / prerequisite |
|---|
Use exactly MTTD-improving, localization-only,
provider/platform-owned, or uncovered in Role. Write one row per exact
added or proven signal; do not group metric names. Use None for Exact signal
only when owner-mapping an unavailable prerequisite, and name that owner or
prerequisite in the final column. This is a signal-role inventory, not another
gap ledger; reconcile audited surfaces through Audit Gap Closure.
This is the reader-facing technical reconciliation. Stable IDs and exact selected scope live in canonical JSON.
| Finding | What changed | Tested | Result | Evidence / reason |
|---|---|---|---|---|
| stable finding ID — exact audit title | concrete code/config change or No code change | scenario IDs and test mode | Working / Not working / Not proven / Not configured | direct evidence or exact blocker |
Use one row per selected audit finding and keep unselected findings out of this
implementation report. Canonical instrumentation JSON contains selected rows
only. Not working requires an executed failed check.
Not proven means the required scenario did not run or lacked a prerequisite.
Use Not configured when requested implementation is absent.
For every selected canonical row, project What changed, Tested, and
Evidence / reason exactly from instrumentation JSON changes, tests, and
evidence arrays in source order. After verification, only Result comes from
the bound verify row. Do not paraphrase projection cells independently.
For a GenAI audit, GenAI Readiness Closure is the detailed signal-level
reconciliation and Audit Gap Closure remains the prioritized user work queue.
Neither substitutes for the other. Follow the loaded GenAI reference for its
machine closure and rollup.
Derive **Result:** from all applicable closure tables. Do not use Pass while
an audit row is Not working, Not proven, or Not configured, or a GenAI row
is Not working, Not proven, or Not configured. Use Partial when
meaningful proof passed but any such row remains. Deferred may coexist with
Pass only when the exact external owner or explicit scope decision is
recorded.
For canonical flow, validate the audit, selection, instrumentation overlay, and
available verification overlay and render the human instrumentation HTML using
json-approval-handoff.md. Do not continue audit-driven instrumentation without
canonical JSON.
Maintain ## Verification Handoff / Results using
./references/project-runtime-validation.md. Record the selected runtime, exact local-safe
commands and outcomes, changed source-to-scenario mappings, the $otel-verify
result/report path, and blocked prerequisites. This is not proof of emitted
telemetry unless a test, harness, or collector actually observed it.
Use the canonical audit, validated selection, and selected findings' referenced verification scenarios as the handoff contract. Do not copy unrelated report sections into audit or instrumentation reports.
When the user asks broadly to apply GenAI readiness skills, improve GenAI MTTD, or fix found GenAI gaps, treat the scope as all discovered app-owned GenAI gaps. Do not select one representative or highest-value gap unless the user explicitly narrows the scope to that gap.
Close code-evidenced AI pathway surfaces from ../references/genai-readiness.md:
provider/model gateway, agent/workflow orchestration, tool/function execution
or AI-owned session/stream lifecycle including MCP when present, retrieval/RAG,
streaming response lifecycle, token/context pressure, safety/policy outcome,
prompt/response assembly, AI-derived data freshness, memory/context operations,
evaluation quality, content governance, framework bridge configuration,
app-computed cost, model/config rollout, and AI-owned cache/session state.
For evaluation quality surfaces, code evidence such as evaluator classes,
scoring functions, LLM-as-judge calls, feedback processors, EvalScore models,
faithfulness/similarity/expectation metrics, pass/fail labels, or quality
report exporters is enough to require eval instrumentation.
Metrics-only coverage does not satisfy selected-trace eval visibility. Add or prove
gen_ai.evaluation.result on the relevant workflow/evaluation span with
gen_ai.evaluation.name, gen_ai.evaluation.score.value when numeric scores
exist, gen_ai.evaluation.score.label when labels/verdicts exist, and safe
parent linkage. Also add or prove detector-ready score distribution, pass/fail
or violation count, sample count/rate, evaluator duration/error/no-data, and
freshness by low-cardinality workflow/model/evaluation name. If the service
only emits eval counters, histograms, logs, or report files, keep the evaluation quality surface partial
and name the missing span-level eval event and remaining detector metrics.
For MCP, JSON-RPC, and tool dispatch, normalize request metadata before adding
attributes or metric dimensions. Never record JSON-RPC request IDs, raw request
IDs, session IDs, trace IDs, user/account/tenant IDs, raw tool arguments, raw
payloads, prompts, completions, or retrieved content as metric dimensions.
Use stable method names only from an allowlist or from known route/tool registration; otherwise record a low-cardinality method family such as
known_tool, unknown_method, invalid_request, or unsupported_method.
Prefer detector-ready metrics and span attributes for outcome, duration,
timeout, retry, rate-limit, fallback, active AI-owned sessions/streams, close
reason family, send/write failure, freshness, empty/low-confidence retrieval,
token budget, prompt build failure, response parse failure, AI-derived data
freshness, prompt/tool schema version, model/config readiness,
model/config compatibility, expected-vs-running model/config state, truncation,
rejection, LLM-call fanout, tool-call fanout, evaluation score/outcome,
memory hit/miss or staleness, content capture mode/redaction, app-owned cost
source, and version dimensions when the service can observe them accurately.
Use OTel GenAI semconv names when possible: gen_ai.evaluation.result,
gen_ai.evaluation.name, gen_ai.evaluation.score.value,
gen_ai.evaluation.score.label, safe gen_ai.evaluation.explanation, memory
operation names such as search_memory, create_memory, update_memory,
upsert_memory, and delete_memory, and content attributes required by the
GenAI coverage profile (published by OTel as Opt-In) such as
gen_ai.input.messages, gen_ai.output.messages,
gen_ai.system_instructions, gen_ai.retrieval.documents,
gen_ai.retrieval.query.text, gen_ai.tool.definitions, and
gen_ai.tool.call.arguments, and gen_ai.tool.call.result. Treat framework
bridges as covered only when OTel-compatible GenAI semconv output and privacy
settings are proven. Treat cost
as custom app-owned instrumentation only when the app owns an accurate pricing map; otherwise owner-map the billing or provider source. Generic non-AI runtime,
platform, or job surfaces are out of scope for this GenAI section unless source
evidence shows they carry or block the AI pathway.
If GenAI incident evidence depends on missed, flapping, auto-resolved, or no-data alerts, record detector reliability evidence as a $splunk-configure
handoff instead of adding app metrics for alert lifecycle behavior.
For AI-owned streaming generators, WebSocket/SSE handlers, callback bridges, or protocol send loops, do not call stream lifecycle coverage complete without a send/write failure signal. Add a counter, span event, or low-cardinality outcome attribute for send/write failure when app code can observe it; otherwise owner-map the missing source explicitly to the framework/server/platform.
For token/context pressure gaps, current inference usage metrics plus a
context-window usage gauge does not close a broader token-pressure gap unless
the audit contract only requires those two signals. If required_signals
include context budget percent, truncation rate, token-limit errors,
prompt/tool schema size, LLM call count per turn, or tool call count per turn,
mark the row partial until each signal is implemented, proven, or owner-mapped.
When the user broadly asks for GenAI readiness without a preexisting audit
contract, treat token/context pressure as requiring the same concrete signal
check: token usage, context budget percent, truncation, token-limit errors,
prompt/tool schema size or safe proxy, LLM-call count, and tool-call count when
the app can observe them.
Use this exact style when only token and context-window usage were added:
Partial: token usage and context window added; truncation, token-limit error, prompt/tool schema size, and LLM-call fanout remain missing.
If prompt/tool schema size cannot be measured safely, add a low-cardinality
detector-ready proxy metric such as schema JSON length bucket, schema field count,
prompt template length bucket, or tool count when the app can observe it.
Span attributes like prompt template version, schema version, or one-off schema
metadata help traces but do not close prompt/tool schema size pressure by themselves. If no safe metric or detector-ready existing signal exists, the
closure matrix and final response must keep prompt/tool schema size in
remaining_signals with the owner and missing source. Do the same for LLM-call
and tool-call fanout: implement per-workflow counts when observable, prove an
existing signal, or keep them explicitly partial.
Final summaries, PR descriptions, and audit updates must not omit residual truncation, token-limit, prompt/tool schema size, LLM-call fanout, or tool-call fanout gaps when they were in the audit contract or when broad GenAI readiness instrumentation discovered the token/context surface.
For tool/function execution, GenAI spans alone do not satisfy detector-ready
tool coverage. When app code observes tool execution, add or prove a
tool-specific duration histogram and tool error/timeout counter using a stable
tool name and low-cardinality failure class. If only spans are safe, keep tool
latency/error metrics in remaining_signals and do not claim detector-ready
tool coverage.
Do not call GenAI instrumentation complete when an app-owned provider/model, workflow, tool/function execution or AI-owned session/stream including MCP when present, retrieval, streaming, token/context, safety/policy, prompt/response, AI-derived data, memory/context, evaluation quality, content governance, framework bridge, app-computed cost, model/config rollout, or AI-owned cache/session surface remains only listed as a follow-up, unless the user explicitly narrowed scope.
Add the OpenTelemetry SDK and auto-instrumentation packages for the detected language. Load the appropriate reference file:
| Language | Reference | Key packages |
|---|---|---|
| Python | ./references/languages/python.md | opentelemetry-api, opentelemetry-sdk, opentelemetry-exporter-otlp, the stdlib logging bridge, framework instrumentation packages |
| Node.js | ./references/languages/node.md | @opentelemetry/sdk-node, trace/metric/log OTLP exporters, @opentelemetry/sdk-logs, the detected logging bridge, framework instrumentation packages |
| Java | ./references/languages/java.md | OTel Java agent (javaagent JAR) |
| Go | ./references/languages/go.md | go.opentelemetry.io/otel, the log SDK and OTLP log exporter, and the detected go.opentelemetry.io/contrib/bridges package |
Apply auto-instrumentation first, then add manual spans for key business operations. Read the language-specific reference for exact patterns.
Persist configuration required by the selected work through the actual launch
mechanism. When that mechanism uses dotenv, apply the Credential Safety section:
create .env if it does not exist, or merge the new settings into the existing
file. A Studio template alone does not configure the application. Report the
active file path and added or changed variable names without exposing secrets.
Critical for APM error tracking:
otel.status_code to ERROR on failures -- this is how APM backends identify errorshttp://127.0.0.1:4318 only as the conventional
fallback when no endpoint is configured or discoverable; never replace a
detected non-default port.http://127.0.0.1:4318/v1/logs only as the final fallback. Do not let a generic direct-cloud OTLP
endpoint become the implicit log destination.otel_setup.py and wire the app entry point to call it before framework instrumentation is activated.OTEL_SERVICE_NAME or otel.service.name), OTLP endpoint setting (OTEL_EXPORTER_OTLP_ENDPOINT or otel.exporter.otlp.endpoint), and that the agent provides HTTP server spans plus request duration metrics.Use official OpenTelemetry packages (go.opentelemetry.io/otel, go.opentelemetry.io/contrib, @opentelemetry/*, opentelemetry-*) for baseline non-GenAI instrumentation and app-owned OTel gap closure. Supported existing GenAI libraries, including Galileo, are preserved, and fresh agents use supported splunk-ao span creation by default under GenAI Instrumentation Selection. That fresh default does not require an AO finding-group label or a separate explicit SDK-choice request. Other exceptions remain library-maintained integrations where no official package exists (for example go-redis/redisotel and XSAM/otelsql). Treat splunk-ao as a supported span-creation and export integration, not as an official OTel instrumentation package.
Do not initialize the SDK more than once per process.
Find any existing OTel setup before adding new code. Extend it. Treat lazy provider helpers and providers initialized on first instrument creation as existing setup even when the startup wrapper itself contains no OTel call.
Keep one global provider per signal. Preserve the actual source-owned
provider and its resource/exporter ownership. Add providers only for absent
signals; adapt new hooks to existing instances and never let new bootstrap
code race the existing set_meter_provider path.
Preserve operator resource values. Merge app defaults only for absent keys;
do not overwrite OTEL_SERVICE_NAME, deployment.environment,
deployment.environment.name, or service.version from
OTEL_RESOURCE_ATTRIBUTES. Add a focused resource-merge test and assert the
effective resource in live OTLP evidence.
Preserve consumer-visible resource aliases when they are safe and already
emitted, such as a legacy realm or namespace attribute used by dashboards or
entity mappings. Add the OTel semantic resource attribute beside the alias
unless the audit/user explicitly approves a breaking migration; if an alias
is removed, mark the telemetry item consumer_compatibility.status=breaking
and name the migration.
Resolve the exporter per signal as an endpoint/protocol/path tuple. Pair gRPC
with the gRPC receiver (commonly 4317) and http/protobuf with an HTTP
signal path such as 4318/v1/metrics. Do not assume one generic endpoint
configures every exporter. A successful trace export does not prove metrics
or logs; exercise each configured signal and repair protocol errors before
reporting it as working.
Treat all literal 4317 and 4318 values in language examples as
conventional fallbacks, not equality gates. Use the receiver endpoint
resolved during preflight in generated code, launch configuration, and
tests. Generated application startup must not call observer_status, MCP,
Studio-specific discovery, or a route-registration API. Normal AO SDK
resource calls use their configured standard API endpoint.
Keep local application-log export separate from cloud export. When a generic
OTEL_EXPORTER_OTLP_ENDPOINT is a direct-cloud endpoint, configure traces and
metrics with their signal-specific endpoints and give logs a local Splunk Observability Studio
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT. Never copy a Splunk realm, ingest URL,
access token, auth header, or cloud exporter into log configuration. Optional
Splunk Observability Studio cloud forwarding remains traces and metrics only; never add a log
forwarding flag or cloud logs pipeline. Remove a generic
OTEL_EXPORTER_OTLP_HEADERS value from the shared startup surface after
moving it to trace- and metric-specific headers; reject it from an
Splunk Observability Studio-owned local log path even when
OTEL_EXPORTER_OTLP_LOGS_HEADERS is also set, because SDKs may merge generic
and signal-specific headers.
For Java trace wiring, DI binding, and provider rules, follow ./references/languages/java.md (Implementation Rules section).
Place OTel initialization code in a separate file.
Minimize changes to existing code. Do not move functions between files.
Do not create spans for trivial helpers. Only span real diagnostic boundaries.
Set span status to ERROR and call recordException on failed operations.
When a framework-specific auto-instrumentation package only provides spans (not HTTP server metrics), wrap the outermost handler with otelhttp.NewHandler (Go) or equivalent to ensure http.server.request.duration and http.server.active_requests are emitted. Consult the Framework Selection Guide in the language reference for the correct wrapping pattern.
HTTP server instrumentation must produce request-duration metrics as well as
spans. Prefer the current stable metric http.server.request.duration. When
the installed SDK requires a semantic-convention stability opt-in, set it in
the launch environment before importing or constructing the instrumentor.
Accept http.server.duration only when the installed SDK truly emits the
alternate name and record that exact runtime evidence; never claim both names.
For local, Docker, and eval-style runtime checks, configure metric export to flush quickly. When constructing a metric reader manually, use the language equivalent of OTEL_METRIC_EXPORT_INTERVAL with a safe local default of 1000 ms and OTEL_METRIC_EXPORT_TIMEOUT with a safe local default of 500 ms instead of relying on SDK defaults.
Strictly adhere to OTel semantic conventions for span and metric naming and attributes for domains where such semantic conventions are defined.
For domains where OTel semantic conventions exist, use semantic-convention names and attributes. Start with required spans, metrics, and attributes; add recommended optional signals only when an approved readiness or verification requirement depends on them, the service can observe the value accurately, and privacy/cardinality rules permit it. Do not invent custom spans, metrics, or attributes where a semantic-convention signal satisfies the requirement.
When changing an existing metric's dimensions or a span/resource/log attribute contract, default to additive compatibility: keep safe existing fields and add semantic-convention fields. A same-name metric with removed or renamed dimensions is a breaking consumer change unless the removed dimension is unsafe high-cardinality data; even then, report it as an intentional breaking migration and provide the replacement query dimension.
Before adding any custom counter or histogram for an outcome that occurs
inside a call already covered by an auto-instrumented RED metric, check
whether that outcome can instead be recorded as an attribute on the existing
metric via the language's per-call metric-attribute hook (see
#### Language-Specific Musts below), rather than as a new standalone
metric. Each convention below defines its own error/status attributes for
exactly this purpose:
http.server.request.duration / http.client.request.duration carry
error.type and http.response.status_code.rpc.server.call.duration / rpc.client.call.duration carry error.type
and rpc.response.status_code. Only fall back to the legacy
rpc.server.duration / rpc.client.duration names when runtime evidence
shows the installed SDK still emits those instead.db.client.operation.duration carries error.type and
db.response.status_code.messaging.client.operation.duration and messaging.process.duration
carry error.type when the operation fails.Prefer the attribute over a dedicated custom metric whenever the outcome
can be faithfully represented on the RED metric for that call and the
language has a way to set it there: either auto-instrumentation already
emits a relevant error.type/*.response.status_code attribute that
actually distinguishes this outcome, or the language has a supported
per-call metric-attribute hook that can set a standard or custom
attribute on the metric (see #### Language-Specific Musts below -- for
example Go's otelhttp.Labeler, which can attach a custom attribute like
outcome.reason even when the outcome is not expressible via the standard
status/error attributes alone). A dedicated custom metric is correct
whenever that's not the case: a queue-depth gauge or a background job
outcome with no inbound request has no call to attach to; or the outcome
is not expressible via the standard status/error attributes alone (for
example a business outcome that occurs once per request but is not
distinguishable from the standard attributes -- a logical failure returned
as HTTP 200, or two distinct failure causes sharing one HTTP status) and
the language's auto-instrumentation also has no per-call metric-attribute
hook to carry a custom attribute instead (Python's ASGI/WSGI hooks and
Node's @opentelemetry/instrumentation-http only add span attributes, not
metric attributes). In each of those cases, add the dedicated metric
instead of suppressing the only detector-ready signal for the outcome.
For incident-readiness work, follow
../references/incident-readiness.md. Instrument only source-evidenced
workflow, dependency, input-complexity, freshness, backpressure,
synthetic/canary, auth/edge, capacity, health/readiness, and release/config
surfaces. Prefer semantic-convention HTTP, RPC, database, messaging, process,
and runtime signals; add custom outcome, lag, freshness, queue, retry,
timeout, rate-limit, endpoint/target-health, drop/reject, circuit-breaker,
saturation, desired-vs-healthy, startup/readiness/healthcheck, compatibility,
and rollout signals only when the service owns and can observe them
accurately.
For GenAI/LLM code, follow ../references/genai-readiness.md: create
baseline distributed tracing plus OTel GenAI spans for inference,
invoke_agent, invoke_workflow, plan, execute_tool, retrieval, and
memory operations where code evidence exists; emit
the current inference duration and usage metrics from the shared reference
when their source data is available and selected by the
audit or requested signal scope; use stable tool names;
add low-cardinality error.type; and avoid raw prompt, completion, retrieved
content, memory record, tool argument, evaluation explanation, user, tenant,
session, task, request, trace, or raw URL values in metric dimensions.
Use the current inference metric names, instrument types, units and required
measurement attributes; include applicable gen_ai.token.modality and known
stable gen_ai.operation.name, gen_ai.provider.name, and
gen_ai.request.model on the metric measurement itself, not only on the
owning chat span. Preserve existing legacy metric producers as consumer
contracts; do not silently rename them. Assert exact current and preserved
contracts separately on collected metric points.
When an audit selects only selected tool operations by exact stable name,
branch at the tool dispatch or execution boundary: emit execute_tool
spans and attributes for those names only. Let unselected tool names follow
the existing execution path with the same result or error and without a new
GenAI tool span. Test a selected success, a selected failure, and an
unselected or unknown tool name to prove both telemetry scope and unchanged
application behavior.
For Retrieval inside a tool, preserve exactly one execute_tool {tool} span
and add exactly one nested retrieval {source} child span for the distinct
code-owned retrieval operation. Set gen_ai.operation.name=retrieval and a
stable low-cardinality gen_ai.data_source.id; do not replace the outer tool
span or count one operation as the other. The required GenAI profile includes
actual redacted gen_ai.retrieval.query.text and
gen_ai.retrieval.documents when available. Preserve an explicitly selected
content restriction and mark required content partial rather than silently
overriding it. Add focused telemetry proof that executes the path,
asserts exactly one span of each kind, and proves the retrieval parent span ID equals the tool span ID using completed spans from an in-memory SDK exporter.
Inspect the recorded retrieval parent.span_id and recorded tool
context.span_id; object-parent equality in a custom recording tracer is
insufficient ID proof. The test asserts gen_ai.operation.name and gen_ai.data_source.id
on the retrieval child, proves safe query/document content matches the actual
operation in the required profile, and proves sensitive sentinels are absent
from all exported attributes/events. For restricted capture, assert content
absence and retain the missing full-content acceptance honestly.
Prove every custom metric's exact name, unit, instrument type, and complete emitted dimension sets. Lifecycle-specific counters must retain their specific error class; generic terminal errors must not overwrite earlier token-limit, truncation, timeout, provider, or tool classifications. Do not attach transient terminal outcome/error dimensions to intermediate gauges or size measurements unless the metric contract explicitly requires them.
Keep production instrumentation independent of audit, report and eval input
files. If runtime schema validation needs a data asset, make it an
application-owned asset included by the normal packaging/deployment path;
validation-only schemas remain in tests. Prove actual startup and local
export from a clean application copy without .observe, eval/inputs,
harness workspaces or absolute paths to the development directory. Include the
declared application assets and normal operator configuration in that test.
For GenAI/LLM code, apply the Single-Source GenAI Span Contract before
adding manual spans. Inventory framework/vendor bridges, provider SDK hooks,
callbacks, middleware, auto-instrumentors, and existing app spans that can
emit GenAI telemetry. Choose one canonical GenAI span source per logical
operation: workflow, agent, model call, tool call, retrieval, memory operation, or
evaluation result. If a framework/vendor bridge already emits correct GenAI
semconv spans with lifecycle, privacy, model/tool attributes, and parent
context, keep that bridge and add only missing workflow/agent context,
aggregates, metrics, or owner mappings; do not create duplicate app-owned
chat or execute_tool spans for those same operations. Preserve existing
app-owned spans in the same way. A new uncovered operation must not duplicate
another active creator; enrich that creator through supported hooks first.
Do not disable existing bridges or replace their operations merely because
a new wrapper is easier to author. If ownership conflicts already exist or
supported enrichment cannot make a producer safe, record the exact affected
operations and prerequisite/manual decision. Preserve unrelated coverage.
Inspect the actual preload/agent/auto-instrumentation bootstrap and exercise
changes through the real launch profile. Module-local environment edits
after bootstrap do not prove the active producer/configuration state.
Verification or static proof must show one GenAI node per logical operation,
no wrapper-only spans counted as tools, expected LLM/tool counts, stable
model/tool names, and workflow/agent parent shape such as
invoke_workflow -> invoke_agent -> chat/execute_tool. Required proof should
name stable model/tool names explicitly.
For Python splunk_ao, apply the Splunk AO Python compatibility guidance
from the shared Agent Observability reference before changing providers or
GenAI spans. Identify @log, SplunkAOLogger, and supported wrappers or
handlers as span creation; identify add_splunk_ao_span_processor as
export-only; distinguish configure_distributed_tracing combined setup from
instrument_distributed_tracing transport-only behavior.
@log or
framework-created operations as the existing span source. Add the minimum
supported integration only for selected uncovered operations, and do not
add an app-owned OTel span around the same logical operation. Treat HTTP,
metrics, logs, streaming, sessions, and uncovered GenAI operations as
independent closure work.
Only a live runtime without any existing telemetry instrumentation uses
supported Splunk AO creators by default. Apply the mandatory per-function producer decision gate in
Decorator Selection before choosing helpers: use SDK @log for every
supported uncovered function scenario, or an application-owned function
decorator invoking the documented chosen creator for an exact SDK decorator
contract limitation. If both SDK choices cannot meet required semantics,
assess the shared per-operation public OTel compatibility exception before
accepting a known-invalid helper. Preserve supported framework/provider ownership without a
duplicate decorator span. Inspect current examples and chosen compatible
APIs; evaluation-only imports do not cover a live runtime, while an active
HTTP provider still selects incremental OTel gap filling.add_splunk_ao_span_processor registration is valid only when all AO
spans share one resolved destination. If the application chooses project
or Agent Stream per request, do not register a startup-wide singleton AO
processor: use route-keyed exporters/processors with exclusive dispatch
for each completed span. Do not create or install a second provider. Pass
the same provider to supported transport instrumentation only when
selected and not already owned.splunk-ao version and its supported Python API. Prefer a compatible
pinned released package already available to the application; do not copy
a VCS pin from an unrelated optional/evaluation runtime merely because
its import name matches. Persist the selected SDK in both the manifest
and lockfile and run its import/configuration check. If dependency
resolution is unavailable, retain the already installed SDK environment
for credential-free compatibility tests, record the lock as a distinct
blocker, and leave AO status partial; do not misreport this as missing
cloud credentials or a durable installed route.SplunkAOOTLPExporter captures project and Agent
Stream routing. If it captures them at construction, a processor created
by add_splunk_ao_span_processor(provider) inherits that fixed route.
Calling it without routing arguments and later adding project/stream span
attributes does not route those spans. The SDK's splunk_ao_context is
imported from splunk_ao, not splunk_ao.otel, and a context entered
after processor creation cannot retarget its exporter. Resolve real
resource IDs before constructing an AO exporter. For two application
streams, use separate supported SDK exporters/processors keyed by the
resolved IDs and dispatch each completed span to exactly one destination
selected at span start; registering both processors unfiltered on one
provider broadcasts every span to both streams. An absent request selector
may use a configured default route, but an explicit unknown route key or a
project/stream lookup failure must fail closed for AO; never normalize it
to the default or reuse another stream. Keep AO export disabled for an
unresolved route while ordinary OTel still works. Prove the two
effective SDK export destinations and their project/stream IDs from
completed batches or captured requests; two mocked lookups or span-name
attributes alone are insufficient. Keep the discovered Studio API origin
in the selected configuration profile and actual launch selection, not as
a fallback port constant in app code. For a credential-free proof,
configure the real SDK against two resolved route pairs, substitute only
its network exporter with a capture sink, exercise two request-selected
operations and a third request-selected route whose project or Agent
Stream lookup fails, then assert one export with the matching
project/stream headers for each resolved route. Inspect the selected SDK's
actual test-only delegate seam, such as _exporter_factory when supported,
to capture its endpoint and projectid/logstreamid headers; construct
the real SDK exporter for each route and replace only its network delegate.
Replacing SplunkAOOTLPExporter itself with a fake proves only app
dispatch, not the installed SDK contract. Explicitly assert that
the unresolved third route creates no AO exporter and produces zero AO
exports; test an explicit unknown key as well as a configured key whose
lookup fails. Merely leaving an operation unrouted does not prove failure
isolation. An in-memory ordinary OTel exporter should still receive all
operations. Do not call selected AO routing working when this test is
absent or blocked..env.studio.example and populate
the actual dotenv launch configuration in .env, documenting each
introduced variable there. Do not create or update .env.example
or add a second runtime .env.studio; prove that the existing launcher
consumes .env. When a reachable Studio gateway was discovered, write its real
API and console origins with their actual port into the dedicated profile
and run an installed-SDK configuration/import check using that profile.
Blank URL values, angle-bracket port placeholders, and an unselected
example do not constitute a working AO route. If discovery is unavailable,
do not put active fabricated endpoint values in the Studio profile or
launch configuration: leave the route blocked with the exact discovery
failure. A credential-free installed-SDK configuration check may instead
use a temporary loopback test origin and captured transport, but must not
be reported as live Studio delivery. For that isolated Studio-mode check,
clear inherited SPLUNK_AO_REALM and O11y token variables; set the
temporary origin as both SPLUNK_AO_API_URL and
SPLUNK_AO_CONSOLE_URL with SPLUNK_AO_API_KEY=local-gateway.
Intercept only the SDK's health, login, and current-user network calls,
then construct the real SplunkAOOTLPExporter with its test-only captured
network delegate. Assert the effective /otel/v1/traces endpoint and
Splunk-AO-API-Key, projectid, and logstreamid headers. A test using
SPLUNK_AO_REALM plus an O11y token proves direct mode, not the Studio
profile, even if both tests produce project/stream headers.@log, account for its documented capture of function
arguments and return values. Use a boundary whose arguments and result
are already safely transformed metadata or a
source-verified integration control that prevents raw capture; otherwise
report the SDK privacy blocker and keep required coverage partial. A
selected restricted-content closure for an existing producer may stay
metadata-only, but does not pass the required GenAI content profile.
Companion redacted_input or redacted_output values alone are not proof
that the original raw values were removed. Never expose raw
prompts, completions, retrieved documents, tool arguments/results,
identifiers, or secrets merely to gain an AO node.@log application, finish each SDK-created operation and
prove the logger's supported teardown path. Where the installed SDK exposes
splunk_ao_context.get_logger_instance(), terminate that logger once after
work concludes (or prove the SDK's registered process-teardown callback).
splunk_ao_context.flush() can drain completed spans, but flush alone does not terminate
the logger or close an unfinished operation. Keep provider.shutdown() for
any separate app-owned provider. In tests, capture both SDK-created and app-owned spans
from both independent entrypoints, assert the expected logical operation
count in each path, and inspect the combined output when both paths are
active. A fake sink can prove lifecycle calls and duplicate prevention;
it cannot prove live Splunk delivery.Preserve existing application stable business workflow identity when setting
gen_ai.workflow.name and workflow span names. Prefer constants, function or
handler names, workflow registrations, telemetry event names, docs, or prior
trace names. Do not derive GenAI workflow names from HTTP routes, request
resources, session/storage tables, or transport labels. If source evidence
shows a workflow is named assistant_v3_turn, keep assistant_v3_turn;
never rename it to assistant_v3_session_turn, POST /v2/assistant/sessions,
or another route/session-derived value. If the app has no stable workflow
identity, keep the HTTP route as the HTTP span and mark GenAI workflow
coverage partial instead of inventing a low-cardinality workflow name.
Do not invent names from HTTP routes or session-derived labels.
Preserve existing application stable agent identity when setting
gen_ai.agent.name and agent span names. Prefer framework agent names, agent
factory names, class names, registration names, callback owner names, docs, or
prior trace names. If source evidence shows a DeepAgents-backed agent, use the
discovered stable agent identity such as deepagents; never rename it to
assistant_v3_agent, assistant, agent, or another generic service-derived
wrapper name. If the app has no stable agent identity, keep agent coverage
partial instead of inventing one.
For app-owned LLM/model calls, apply the LLM Inference Lifecycle Contract.
Do not satisfy inference coverage with workflow-level token accounting,
final usage events, token usage, or model names only on the workflow span.
Add or prove a real model-call lifecycle span at the provider request
boundary: start before the call or stream starts, end after the
response/terminal stream event, and end with error status for exceptions,
cancellations, provider timeouts, or stream-close failures. In LangChain,
LangGraph, DeepAgents, callback, or event-stream based systems, hook
on_chat_model_start, on_chat_model_end, and on_chat_model_error or the
equivalent lifecycle callbacks. In direct SDK/model-gateway code, wrap the
provider call or streaming generator. The span must carry
gen_ai.operation.name such as chat, generate_content, or
text_completion, gen_ai.provider.name, gen_ai.request.model when known,
gen_ai.response.model when known, and token usage on that inference span
when provider usage is available. For current inference usage counters,
put the required gen_ai.token.modality and known stable gen_ai.operation.name,
gen_ai.provider.name, and gen_ai.request.model on the token metric as
attributes too; span attributes alone do not make token metrics filterable
by operation, provider, or model. Include gen_ai.response.model on the
token metric when known. Never use prompt, response, session, or user content
as metric attributes.
Preserve the owning workflow/agent context for event-derived GenAI spans. In
callback, stream, LangChain, LangGraph, or DeepAgents integrations, capture
the workflow/agent context and use it when starting chat/model and tool
spans. Do not let callback-created chat or execute_tool spans attach to a
generic HTTP root span as siblings of the workflow. A representative trace
should prove a shape such as workflow -> chat, workflow -> execute_tool,
and follow-up workflow -> chat or agent -> chat edges.
Capture that workflow/agent context before opening long-lived helper/setup
spans such as memory store, checkpointer, database session, stream-writer,
resource setup, or lifecycle wrappers. These helper spans must not become the
parent for model/tool lifecycle spans. Event-derived chat and execute_tool
spans must use the captured workflow/agent context, not whichever helper span
happens to be current when a callback is translated. Store the workflow/agent
span object or context explicitly so stream cleanup writes aggregates to that
owner even if the current span has changed.
Use this rule for memory store, checkpointer, database session, stream-writer,
or resource setup paths: helper spans must not become the parent; capture the
workflow/agent context before opening helper spans, start event-derived chat
and execute_tool spans with that captured context, and write aggregate
counters to the workflow span, not to whichever current span is active.
In async generator, SSE, WebSocket, ping-loop, timeout-wrapper, or task handoff
paths that advance a stream with create_task, wait, anext, or equivalent
scheduling, do not keep an OpenTelemetry current-span context manager open
across yield/task boundaries. Start the workflow/agent span with an explicit
parent context, store a workflow span/context handle, pass that handle into the
callback/event translator, and end the workflow span manually after stream
cleanup.
When the captured workflow/agent context must travel through a request, turn
input, event payload, callback state, or config object that may be
immutable/frozen or owned by a framework, do not mutate that carrier in place.
Treat a carrier as immutable/frozen when source evidence shows frozen or
readonly declarations, record/value types, no mutation API, framework request
immutability patterns, or existing code constructs new copies instead of
mutating.
Use the app's idiomatic copy/replacement API: Python dataclasses.replace,
attrs.evolve, pydantic model_copy(update=...) or copy(update=...) as
supported by the installed carrier API;
Java records, builders, or copy constructors; TypeScript object spread,
explicit Readonly<T> replacements, or structuredClone only for plain-data
carriers and never for live OTel Context or Span handles; Go value copies
with explicit field replacement; or the framework's request clone/with-context
API. If no safe copy path exists, use a separate invocation-scoped sidecar
context: a local object, context variable, request-scoped map, or callback
state keyed to the invocation lifecycle and cleared after cleanup. Do not key
sidecar context by raw user, tenant, session, request, or trace IDs. Add a
focused test, or explicit static proof when the repo has no test harness, that
proves the parent context is passed downstream and the original immutable
input remains unchanged; for Python, guard against FrozenInstanceError
regressions when a frozen dataclass or model is present.
Put aggregate selected-trace GenAI attributes on the workflow span or
most specific owning GenAI span, not on a generic HTTP root span or generic server span.
This includes gen_ai.usage.input_tokens,
gen_ai.usage.output_tokens, an application/vendor-owned derived total,
assistant.llm.calls, and assistant.tool.calls. The HTTP root can remain
the server entrypoint, but it should not become the evidence for a GenAI flow
card unless it is explicitly instrumented as the workflow span.
If runtime telemetry verification is unavailable, perform a static
instrumentation proof before claiming GenAI trace coverage: identify the
model-call source file, the lifecycle hook or client wrapper, the created
inference span name, required gen_ai.* attributes, parent-context handoff,
aggregate-attribute placement, end/error path, and a focused test or compile
check. If the proof shows only workflow-level usage attributes and no
inference span, or chat/tool spans that are siblings of the workflow under a
generic HTTP root span, keep the surface partial in remaining_signals.
For local span-first trace explorers such as Splunk Observability Studio, metrics alone are not enough
for a selected-trace summary. When provider usage, model, tool,
memory, evaluation, or fanout data is available, also set safe span attributes
on the most specific GenAI span and aggregate to the workflow span when
useful: gen_ai.usage.input_tokens, gen_ai.usage.output_tokens,
an application/vendor-owned derived total, gen_ai.request.model,
gen_ai.response.model, service-owned LLM/tool call counts, stable
gen_ai.tool.name, memory operation names, evaluation names/labels, and
low-cardinality error.type.
Reconcile newly added gen_ai.* attributes with the current official
registry. Do not introduce gen_ai.usage.total_tokens when it is not
published there; a useful derived total belongs in an application/vendor
namespace with actual/estimated count provenance. Preserve a proven existing
consumer alias as legacy rather than requiring it on fresh spans.
For assistant, agent, or streaming workflows, instrument first non-ping event
or first chunk latency, timeout, cancellation, disconnect, close reason
family, and send/write failure. Normalize timeout classes such as
first_event_timeout instead of relying only on framework exception class
names, while still recording the exception on the span.
For custom attribute names use {domain}.{noun}.{adjective} format.
Span names must be low-cardinality (no IDs, no variable path segments).
Metric attributes must avoid high cardinality.
Preserve existing env-var patterns for operator-owned telemetry config. The only endpoint literal the default log path may introduce is the signal-specific local Splunk Observability Studio fallback; it must not inherit a generic direct-cloud endpoint.
If the app is a library, provide an opt-in setup path rather than forcing SDK initialization on import.
Keep the codebase idiomatic. Match the repo's dependency manager, config style, and lifecycle patterns.
Obtain OTel Tracer, Meter once during startup and reuse it. Do not call getTracer or getMeter in hot paths.
Create metric instruments once during startup and reuse them. Do not create instruments in hot paths.
Metric instruments must be created with appropriate unit and description parameters.
local-otlp-default,
explicitly-disabled, operator-owned, correlation-only, or
unsupported-stack. Trace/MDC fields in stdout are correlation-only, not an
OTLP log pipeline.LoggerProvider and exactly one bridge/export path per record.OTEL_LOGS_EXPORTER or OTEL_EXPORTER_OTLP_LOGS_ENDPOINT.
OTEL_LOGS_EXPORTER=none disables the added provider/exporter and bridge.
Another explicit exporter is operator-owned and must not be supplemented
with a second local pipeline, but its provider/exporter/bridge must be proven;
an environment value by itself is not evidence of export. When the exporter
is absent or explicitly otlp, an explicit signal endpoint may be used by
the Splunk Observability Studio-owned pipeline only when it exactly matches the detected local
Splunk Observability Studio receiver for the selected runtime and protocol. The detected
receiver may use any valid port. Resolve it during instrumentation from the
shared local-receiver contract and adapt it to the checked-in Docker/Compose
service address when applicable.
Default an absent exporter to otlp and an absent endpoint to that detected
local receiver. If the explicit endpoint is non-local or direct-cloud, do not
construct or enable the Splunk Observability Studio provider/exporter/bridge; fail closed for
the local log branch and report the operator-owned boundary conflict. Never
turn that log-only conflict into an application startup exception or disable
the operator-owned trace/metric route. Keep the original logging sink active.
Do not validate the logs
endpoint on the none or other non-OTLP exporter branches, because those
branches remain wholly operator-owned.unsupported-stack and report the exact missing bridge
instead of silently removing the existing sink.http/protobuf with /v1/logs; when an explicit signal-specific protocol is
different, select its matching official exporter and endpoint shape or
report it unsupported. Never silently send HTTP to a gRPC endpoint. A generic
header must not be inherited or merged into logs: move
OTEL_EXPORTER_OTLP_HEADERS to trace/metric signal variables and remove the
generic value before enabling the local log path, even when an explicit
signal-specific log header is present. Preserve the operator-owned
OTEL_EXPORTER_OTLP_LOGS_HEADERS value after the generic value is removed.
Until that migration is complete, skip only the local log exporter/bridge and
report the conflict; do not reject startup or discard the existing
trace/metric provider configuration.logger.* call is insufficient when a
formatter or access logger adds them back. Keep raw request/user/tenant/
session IDs, raw dynamic URLs, exception text, and tracebacks out of the
approved application-log surface unless the policy explicitly permits them.none opt-out, and exactly one
OTLP record per application log call. When cloud trace/metric forwarding is
configured, also prove the log is visible in local Splunk Observability Studio and no cloud log
exporter or forwarding path was configured.OTEL_LOGS_EXPORTER=none, disable or bypass any previously discovered
application-log provider/bridge as needed to prove zero OTLP application log
records; leaving an already-active bridge in place is not a valid opt-out.Not configured, not Not proven. Use Not proven only after configuration
exists but its required runtime scenario did not run.Python:
opentelemetry-api, opentelemetry-sdk, opentelemetry-exporter-otlp, and each detected framework/client instrumentation package.otel_setup.py, telemetry.py, or instrumentation.py.Resource.create({"service.name": ...}), trace provider,
meter provider, and default local log provider/exporter in that setup file only
for signals the process does not already own. If a source-owned provider
exists, move or adapt its construction into the shared setup while preserving
existing wrappers, views, file-export modes, and tests; do not create a
second provider.FlaskInstrumentor().instrument_app(app).FastAPIInstrumentor.instrument_app(app) immediately
after app construction and before lifespan/startup begins. Do not first call
it inside lifespan: Starlette/FastAPI middleware installation is too late
after the application has started serving.CeleryInstrumentor().instrument() in the worker path.logging (including Flask/Django logging), use the current
opentelemetry-instrumentation-logging bridge backed by LoggerProvider,
BatchLogRecordProcessor, and the selected OTLP log exporter. Its guarded
setup must preserve logging configuration performed before or after OTel;
do not call basicConfig(force=True) or replace stdout/file handlers. For a
project whose installed instrumentor lacks that supported bridge, inspect
and retain its documented SDK LoggingHandler compatibility path instead
of forcing an upgrade. Shut the
log provider down with the other providers.http.response.status_code on http.server.request.duration for every
request, and error.type for a 5xx (or otherwise invalid) status, with no
extra code -- a plain 4xx client-error response does not set error.type
on a server span. server_request_hook/response_hook only set span
attributes, not metric attributes; they are not a route to a new dimension
on the duration metric itself. Do not add a standalone counter for a
request outcome the duration metric already attributes correctly.Node.js:
@opentelemetry/instrumentation-http explicitly for HTTP server spans.@opentelemetry/instrumentation-express for Express.@opentelemetry/exporter-metrics-otlp-http and @opentelemetry/sdk-metrics when wiring SDK-based metrics.@opentelemetry/exporter-logs-otlp-proto for the default
http/protobuf path and
@opentelemetry/sdk-logs, pass one BatchLogRecordProcessor through
NodeSDK.logRecordProcessors, and add only the detected official bridge.
For detected console.* calls, use
@opentelemetry/instrumentation-console only after checking its current
package engines, peers and API against the selected runtime and project.
Choose the latest compatible release; it must emit LogRecords while
preserving console output. If no compatible bridge exists under the project
constraints, report the exact unsupported contract instead of forcing an
upgrade. Otherwise select the detected Winston or Pino
instrumentation/transport bridge. Keep existing console/file transports.
Do not enable an instrumentation sender and an OTel transport for the same
logger; sdk.shutdown() must flush logs as well as traces and metrics.PeriodicExportingMetricReader with exportIntervalMillis: Number(process.env.OTEL_METRIC_EXPORT_INTERVAL || 1000) and exportTimeoutMillis: Number(process.env.OTEL_METRIC_EXPORT_TIMEOUT || 500) so HTTP duration metrics export during short runtime checks.NodeSDK metric reader option exactly as shown in the Node reference. Do not substitute metricReaders for metricReader unless the installed SDK version documents that option.@opentelemetry/auto-instrumentations-node alone when specific framework packages are expected.--require or --import), the packages added, and that HTTP server spans plus request-duration metrics are expected.@opentelemetry/instrumentation-http already sets http.response.status_code
on http.server.request.duration from the response for every request with no
extra code. It does not set error.type from a failing status code:
error.type there is reserved for a lower-level request/response transport
error (for example a socket error before a status was ever sent), not an
ordinary 4xx/5xx completion. Its hooks (requestHook, responseHook,
startIncomingSpanHook) only add span attributes, not metric attributes.
Do not add a standalone counter for a request outcome that http.response.status_code
already distinguishes; @opentelemetry/instrumentation-http has no per-call
metric-attribute hook, so a finer-grained reason dimension that the status
code alone cannot express does need its own custom metric here.Go:
otelhttp.NewHandler as the outermost server handler so request-duration metrics are emitted, even when router-specific middleware is also used for route-aware spans.otelhttp.NewHandler, then prove at least one parameterized route uses
its low-cardinality route pattern rather than a constant server span name.
Also prove the combined wrappers do not emit duplicate server spans.sdkmetric.NewPeriodicReader with an interval derived from OTEL_METRIC_EXPORT_INTERVAL, defaulting to 1000 ms, and a timeout derived from OTEL_METRIC_EXPORT_TIMEOUT, defaulting to 500 ms, for local runtime checks.go.opentelemetry.io/otel/sdk/log,
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp, and exactly
one official go.opentelemetry.io/contrib/bridges package matching the
detected logger. Register one global log provider, preserve the existing
stdout/file handler through fan-out, pass context.Context to logging calls
for trace correlation, and shut the log provider down.otelhttp.NewHandler already sets http.response.status_code on
http.server.request.duration from the response status with no extra code.
It does not set error.type from that status: otelhttp's metric
attributes never include error.type for an ordinary 4xx/5xx completion.
When a handler needs a dimension otelhttp cannot derive from the
status code alone (a specific failure reason such as a downstream timeout
vs. a validation error, both returning the same HTTP status), pull the
Labeler that otelhttp.NewHandler already injects into the request
context and add the attribute from inside the handler instead of creating
a new counter:
labeler, _ := otelhttp.LabelerFromContext(r.Context())
labeler.Add(attribute.String("outcome.reason", "gateway_timeout"))
No extra otelhttp.NewHandler option is needed; the labeler is present in
context for every request the handler already wraps. The older
otelhttp.WithMetricAttributesFn middleware option is deprecated in favor
of this per-request Labeler. A custom attribute like outcome.reason is
detector-ready without a standalone counter: see
splunk-configure/references/detector-classification.md's "Evidenced
Non-Standard Outcome Attribute" rule, which generates an attribute-filtered
outcome detector directly from an evidenced non-standard histogram
attribute.Java:
pom.xml for basic Spring Boot coverage../references/languages/java.md Implementation Rules for DI binding, provider reuse, and dependency checks.JAVA_TOOL_OPTIONS, or a documented run command.otlp only when
OTEL_LOGS_EXPORTER is absent and the logs endpoint is absent or matches the
detected local Splunk Observability Studio receiver. Set that local
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT, and rely on the agent's detected
Logback/Log4j bridge plus JVM shutdown hook. A non-local explicit endpoint on
the absent/otlp branch is a fail-closed boundary conflict and must not start
the agent-owned log path. Preserve explicit none, other exporter choices,
existing appenders, and any single existing OTel appender; never install a
second bridge.OTEL_SERVICE_NAME, OTEL_EXPORTER_OTLP_ENDPOINT, HTTP server spans, and
http.server.request.duration.After auto-instrumentation is wired up, prompt the user:
Auto-instrumentation is configured. Would you like me to add custom spans or metrics for your business logic?
Then wait for the user's answer.
Skip this prompt when the user already asked for incident-readiness or GenAI/LLM
workflow instrumentation, a specific custom signal, when an Audit-Driven
Readiness path applies, or when a validated canonical selection exists. In
canonical flow, the selection is the approval context and only selected work is
implemented. When no canonical audit exists, stop before custom
instrumentation and ask the user to run $otel-audit first.
#### Implementation Rules); if so, prefer adding
an attribute to that existing metric via the language's per-call
metric-attribute hook over defining a new counter/histogram. Analyze the
codebase for high-value custom instrumentation points:
Read and follow ./references/project-runtime-validation.md. Local,
deterministic validation is the default completion gate; do not ask for
permission to run a project-configured syntax, compile, typecheck, import, or
focused test command. Do not require full app startup, Docker, credentials,
live providers, or an OTLP collector for this gate.
At minimum:
git diff --check when Git is available.OTEL_SDK_DISABLED=true; inside the test, temporarily set it to false
only for construction of the in-memory SDK provider and import of the
instrumented app, then restore the inherited value when the test ends.
A permanent process-wide assignment to false, or a test run only without
the inherited disabled setting, is not this proof. Do not override the
operator's setting in production application code. Assert exactly one
completed canonical owning span per selected model or tool operation before
inspecting its content; choosing the first or latest matching span can
conceal duplicate capture. Parse gen_ai.output.messages and assert
exactly one candidate whose safe content matches the redacted/truncated
actual provider return, not merely its role or finish reason. Likewise
assert the recorded input-message content matches the safe model-bound
input and that tool arguments/results match their safe call boundaries.
For each tool, also parse its own input/output message mappings (or the
supported OpenInference values) and compare them to those same sanitized
arguments/result; fields on the parent/model are insufficient. Remove each
mapping in a negative test so arguments/results-only content cannot pass.
Check current schema, redaction and unchanged trace/span identity with no
duplicate node; test successful null separately from no result on failure.
Exercise the selected content policy with source-shaped sensitive fields
both as structured values and embedded in JSON or labelled freeform text,
including nested inputs and produced outputs. Dictionary-key filtering does
not sanitize a string containing identity or protected reasoning fields.
Check completed owning spans and actual exported content for their absence
under the redacted policy, while retaining useful approved question/result
content. A redacted label, sanitizer-only assertion, or blanking all content
is insufficient. If a value cannot be safely transformed before any writer
captures it, omit that value and report the remaining content gap.
Apply the representation-sensitive cases in the shared GenAI capture
contract: decoded JSON scalars, protected labelled values, reasoning-part
discriminators and final serialized aggregate bounds. Keep the original
failing receipt and prove the repaired case on the real owning spans and
exports; a different passing prompt does not close the counterexample.
Build an exact signal closure matrix and execute every changed span name and
metric call site that should still emit, plus explicit absence proof for
every removed signal. Do not infer coverage for create, batch, update,
delete, route, tool, or workflow names solely from a shared helper's test.
Parameterize tests when those call sites share setup. For
detector-critical counters, histograms, and observable gauges, drive each
incident state to a non-default value and assert its emitted datapoint and
bounded dimensions; metric registration, name presence, or a zero-value
observation alone is not incident-readiness proof.
Map these executions back to every in-scope Audit Gap Closure row and its
declared verification scenarios.Skip command execution only when the user explicitly forbids verification or
states that an external eval owns all checks. In that case, still perform
source-level review, record Not run in the handoff, and do not describe the
instrumentation as verified or complete. If the configured runtime or declared
dependencies are unavailable, record Blocked with the exact prerequisite;
do not fall back to an incompatible global runtime.
After the implementation gate, invoke or apply the $otel-verify workflow
unless the user explicitly opts out or a concrete prerequisite blocks it. The
instrumentation goal is not done until code viability is known and verification
has run, been explicitly skipped by the user, or is documented as blocked.
When verification observes a semantic failure introduced by this implementation,
repair the selected source mapping/creator and rerun the affected scenarios
before handoff. Apply the shared per-operation public OTel compatibility
exception when checked SDK creators cannot satisfy the contract; do not keep a
known-invalid helper solely to retain its SDK label. Preserve all other valid
producers and regenerate the normal bound reports after repair. If the user
requires verification Pass, unresolved failures or selected cloud/resource
proof remain an incomplete gate: do not drop selected findings, relabel local
receipts as cloud proof, or publish the proposed PR update before that gate.
An exact external permission/runtime blocker remains visible while independent
implementation and credential-free checks continue.
If $otel-verify is not exposed as a separate skill invocation in the current
session, read the adjacent ../otel-verify/SKILL.md and apply that bundled
workflow directly. If an isolated skill environment does not expose that
adjacent file either, apply the local verification contract here: execute the
selected app-code scenarios with the project's runner, inspect completed
spans and metric points, and write the bound .observe/otel-verify.json and
reader-first .observe/otel-verify.md using the selected audit scenario IDs.
Use ./references/json-approval-handoff.md and the bundled
./scripts/observe_report.py to validate the audit, selection,
instrumentation, and verify overlays and refresh the instrumentation HTML.
Only an individual scenario needing an unavailable listener, credential,
package, or fixture is blocked; a missing skill invocation or adjacent file
is not itself a verification blocker. Do not report verification as Not run
when local app-code scenarios executed.
Run local $otel-verify for every scenario that can execute without remote
export credentials, even when Agent Observability project creation, Agent
Stream setup, or live delivery is blocked. Keep remote export credentials and
missing local packages as separate prerequisites: if dependency resolution
blocks application import or the project runner, still invoke the read-only
verification workflow to validate the bound handoff, attempt available local
checks, and record exact blocked scenarios. Its .observe/otel-verify.md
reader-first result uses ## What Changed, ## Tested And Working,
## Not Working Or Not Proven, and ## Proof before diagnostic detail;
the instrumentation Markdown keeps its own report order above.
Record the verification result and .observe/otel-verify.md path in
.observe/otel-instrumentation.md. If verification cannot run, record the exact
blocking prerequisite and do not describe the instrumentation as verified.
For canonical flow, write and validate .observe/otel-instrumentation.json
with json-approval-handoff.md, invoke $otel-verify with the same bound
selection unless explicitly skipped or concretely blocked, and refresh
.observe/otel-instrumentation.html with the available verification overlay.
Do not tell the user to rerun $otel-verify; name the concrete remaining repair,
runtime prerequisite, or product-evidence step instead.
When verified metric evidence exists and the user requested detectors,
alerting, monitors, Splunk configuration, or $splunk-configure, invoke or
apply that workflow and include the detector/configure verification result in
the instrumentation report.
When any claim depends on auto-instrumentation startup, framework route
resolution, automatic metrics, duplicate automatic-span prevention,
startup/exporter wiring, or runtime-installed OTLP logs, read
../references/full-runtime-acceptance.md and require its conditional full
runtime gate in the verification handoff. Attempt the gate without asking when
the repository provides a safe local profile or fixtures. Otherwise record the
exact prerequisite and keep those rows Partial, Blocked, or Not proven.
Not run or no collector was run alone is not an acceptable blocker. For
each required full-runtime row, record either the executed command and direct
result or the concrete unavailable runtime, listener, dependency, credential,
or fixture that prevented the attempt. Do not finalize while a safe local
profile exists and the required gate has not been attempted.
This step is REQUIRED whenever .vscode/launch.json exists.
.vscode/launch.json exists.OTEL_EXPORTER_OTLP_ENDPOINT=<resolved-local-otlp-http-endpoint>; use
http://127.0.0.1:4318 only when resolution reaches the conventional fallbackOTEL_LOGS_EXPORTER=otlp when no explicit exporter exists and the logs
endpoint is absent or is the detected local Splunk Observability Studio endpointOTEL_EXPORTER_OTLP_LOGS_ENDPOINT=<resolved-local-otlp-http-endpoint>/v1/logs
when the exporter is absent/otlp and no explicit logs endpoint exists;
preserve an existing signal path and never double-append /v1/logsOTEL_METRIC_EXPORT_INTERVAL=1000OTEL_BSP_SCHEDULE_DELAY=100
If an absent/otlp exporter is paired with an explicit non-local logs
endpoint, do not add either logs setting; stop and report the operator-owned
boundary conflict instead of enabling a Splunk Observability Studio log path..vscode/launch.json exists and you do not update it, stop and explain why..vscode/launch.json does not exist, explicitly report: No .vscode/launch.json found; Step 6 skipped..observe/otel-instrumentation.md and include a Signals Changed
summary with added, modified, and removed traces/spans, metrics, logs/events,
runtime/config, and dependencies. If no prior audit existed, state that the
report establishes the implementation baseline..env, in Files Changed and the runtime/config change summary.
Build this list from performed edits as well as Git status; an ignored file
can change without appearing in a Git diff. State whether .env was created
or updated and name the added or changed variables without printing values
or copying secrets into the report. Do not claim an edit that did not occur..observe/otel-instrumentation.json,
render .observe/otel-instrumentation.html using
./references/json-approval-handoff.md, and keep every selected finding
exactly once. Leave .observe/otel.html as the audit and scope surface;
never call unselected findings implemented.Audit Gap Closure counts by Working, Not working, Not proven, and Not configured. Do not report unselected findings as
implemented work.GenAI Readiness Closure matrix and list every non-Working
remaining signal in the final response.$otel-audit; do not collapse absent GenAI readiness into a
generic implementation claim.$otel-verify results and .observe/otel-verify.md path when run.
If detectors/configuration were requested, include $splunk-configure
outputs and .observe/splunk-configure-verify.md status when run.render-instrumentation-html command's returned
loopback links for both otel-instrumentation.html and otel.html in the
final response. Do not emit absolute local-file links for generated HTML and
do not open either report automatically. On the permitted direct baseline
path, link only the absolute .observe/otel-instrumentation.md report; do not
claim or link audit, selection, JSON, or HTML artifacts that were not created.
Keep Markdown and JSON report links as absolute local paths.complete, working, or verified when the mandatory
compile/type/import gate failed, was blocked, or was not run. Use
implemented; verification blocked/not run and name the prerequisite.OTEL_LOGS_EXPORTER and signal-specific local
logs endpoint, explicit opt-out behavior, duplicate-prevention proof, and
that cloud forwarding/configuration remains traces and metrics only.references/json-approval-handoff.md (opens in a new tab)references/languages/go.md (opens in a new tab)references/languages/java.md (opens in a new tab)references/languages/node.md (opens in a new tab)references/languages/python.md (opens in a new tab)references/project-runtime-validation.md (opens in a new tab)references/signal-mapping-guide.md (opens in a new tab)scripts/observe_report.py (opens in a new tab)scripts/resolve_ao_resources.py (opens in a new tab)scripts/validate_gap_closure.py (opens in a new tab)tests/test_json_approval_flow.py (opens in a new tab)tests/test_resolve_ao_resources.py (opens in a new tab)tests/test_validate_gap_closure.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Generated from the plugin's indexed repository (signalfx/obstudio) — no native marketplace selected
npx claudepluginhub p/signalfx-obstudio-plugins-obstudio13 skills in this plugin
/connect-splunk-observability-cloudOpen the already-running local Splunk Observability Studio Cloud tab so a user can connect an existing or newly ready Splunk Observability Cloud organization by entering its URL and access token outside agent context. Use when a user asks to connect, configure, or provide credentials for Splunk Observability Cloud, Splunk O11y, or SignalFx outside the Splunk Observability Studio IDE extension. Do not use this skill to create a Free Edition account./create-splunk-free-accountSubmit a consent-gated Splunk Observability Cloud Free Edition signup intake in a detected or user-selected supported signup region through Splunk Observability Studio's browserless MCP backend. Use when a user asks to create, provision, register, start, or sign up for a free Splunk Observability Cloud, Splunk O11y, or SignalFx account or organization, or explicitly asks to submit another intake with the same details or email, including requests to avoid the Splunk web form./observer-openOpen the local Splunk Observability Studio at http://127.0.0.1:17900/ using a host-provided browser when available, with a safe clickable-URL fallback./observer-restartExplain how to refresh or restart the local Splunk Observability Studio when the UI is stale, the MCP endpoint is unavailable, or the bootstrap state needs to be refreshed./observer-statusReport whether the local Splunk Observability Studio is installed, bootstrapped, and reachable, including the MCP endpoint and browser URL./observer-stopExplain how to stop or disconnect from a local Splunk Observability Studio when the user intentionally wants to shut down the managed runtime or leave a shared Splunk Observability Studio alone.Other plugins' skills for the same job