Splunk observability codex instrumentation setup

From chambear2809/splunk-cisco-skills · View interactive version

Splunk observability codex instrumentation setup is an AI agent skill from the GitHub repository chambear2809/splunk-cisco-skills. Use when instrumenting Codex itself for Splunk Observability or AI Agent Monitoring. Render, validate, diagnose, and safely apply Splunk Observability instrumentation for Codex CLI profiles, OTel destinations, JSONL runtime helpers, and optional hooks.

How to use this skill

Skill file

Splunk Observability Codex Instrumentation Setup

Prerequisites

| Tool or access | Purpose | Verify |

|---|---|---|

| Bash and Python 3 | Run bundled setup and validation helpers | bash --version && python3 --version |

| Required product/platform access | Inspect or configure the selected target | Complete the documented preflight |

| Credential files for live modes | Keep secrets out of chat | Verify paths only |

Workflow Overview

┌───────────┐   ┌───────────────┐   ┌───────────────┐   ┌─────────────────┐
│ Preflight │ → │ Render/review │ → │ Apply/handoff │ → │ Validate evidence │
└───────────┘   └───────────────┘   └───────────────┘   └─────────────────┘

When to Activate

Scope

Follow the documented read-only or render-first path whenever it is available.

This skill does not imply permission to mutate live systems. Require explicit

apply flags, protected credentials, and operator review for state changes.

Examples

Inspect the supported setup modes before selecting one:

bash skills/splunk-observability-codex-instrumentation-setup/scripts/setup.sh --help

Expected output: usage, supported modes, and required arguments are displayed

without changing the target environment.

Inspect validation modes before running completion checks:

bash skills/splunk-observability-codex-instrumentation-setup/scripts/validate.sh --help

Expected output: offline, live, and completion options are displayed when the

skill supports them; help exits without mutation.

Troubleshooting

| Issue | Cause | Resolution |

|---|---|---|

| Preflight fails | A required tool or access path is missing | Resolve it before rendering or applying |

| Rendered assets are incomplete | Required non-secret inputs are absent | Complete intake and render again |

| Apply is blocked | Review, credentials, or explicit acceptance is missing | Use the documented handoff |

| Validation is incomplete | Live evidence is unavailable | Record the gap and keep completion open |

Overview

Use this skill to render Codex OTel profiles and optional runtime helpers for

Splunk Observability. Codex telemetry belongs in user-level CODEX_HOME

profile files such as ~/.codex/codex-o11y-local.config.toml; do not put OTel

settings in project .codex/config.toml.

The skill recognizes three destination modes; two render profiles and one is a

fail-closed compatibility diagnostic:

http://127.0.0.1:14318 by default. Override the base endpoint with

--local-collector-endpoint http://localhost:14318. Native logs are enabled

with --enable-native-logs. The collector receiver bind is independent and

defaults to Docker-safe 0.0.0.0:4318; override it with

--local-collector-receiver-endpoint HOST:PORT.

unauthenticated external OTLP collector endpoints. Safe literal routing

headers and literal TLS paths are supported; credential placeholders are

refused because Codex sends them literally.

Splunk ingest requires X-SF-TOKEN, but Codex does not expand environment

placeholders in OTel exporter headers and this skill never renders raw

tokens.

Use local-collector for Splunk Observability. The collector expands

${env:SPLUNK_ACCESS_TOKEN} in its own process and keeps the credential out of

Codex configuration and process arguments.

For Galileo Observe, do not assume a configured Galileo MCP server means Codex

turns are being logged. MCP enables tool access only. Interactive Codex turn

logging needs a separate notify-based bridge that runs after turn-ended,

parses the local Codex session JSONL, and writes a Galileo codex.turn trace

through the Galileo trace ingest API.

Those traces can ground Galileo AI Assistant beta investigations, but this

skill does not enable or query the Assistant. Use galileo-platform-setup for

enterprise enablement, LLM-integration readiness, evidence-link verification,

and reviewed-remediation handoffs for the July 7, 2026 Galileo release.

Safety Rules

--access-token, --sf-token, --o11y-token, --api-key, and

--password.

sends those values literally; credentialed exporters must terminate at a

collector that owns secret expansion.

it does not validate Splunk endpoint semantics.

cannot be rendered safely into a Codex OTel profile.

--accept-content-capture.

--accept-ai-defense-content-inspection.

should read the Galileo key from a file, redact obvious secrets/high-entropy

values, write local non-secret failure evidence, and exit 0 if Galileo is

unavailable.

Primary Workflow

Render local collector assets:

bash skills/splunk-observability-codex-instrumentation-setup/scripts/setup.sh \
  --render \
  --destination local-collector \
  --local-collector-endpoint http://localhost:14318 \
  --local-collector-receiver-endpoint 0.0.0.0:4318 \
  --enable-native-logs \
  --realm us0 \
  --output-dir splunk-observability-codex-instrumentation-rendered

Direct Splunk Observability export fails closed and directs the operator to the

local collector path:

bash skills/splunk-observability-codex-instrumentation-setup/scripts/setup.sh \
  --render \
  --destination direct \
  --realm us0

Render an external OTLP collector profile:

bash skills/splunk-observability-codex-instrumentation-setup/scripts/setup.sh \
  --render \
  --destination external-collector \
  --external-collector-protocol otlp-http \
  --external-trace-endpoint https://otel-gateway.example.com/v1/traces \
  --external-metric-endpoint https://otel-gateway.example.com/v1/metrics

Validate rendered output:

bash skills/splunk-observability-codex-instrumentation-setup/scripts/validate.sh \
  --output-dir splunk-observability-codex-instrumentation-rendered

Apply only after review:

bash skills/splunk-observability-codex-instrumentation-setup/scripts/setup.sh \
  --apply profiles \
  --codex-home "$HOME/.codex"

Install the durable interactive turn notifier once, outside the per-turn path:

bash skills/splunk-observability-codex-instrumentation-setup/scripts/install_notify_runtime.sh \
  --codex-home "$HOME/.codex" \
  --service-name codex-cli \
  --environment prod \
  --realm us0 \
  --trace-endpoint http://127.0.0.1:14318/v1/traces \
  --metrics-endpoint http://127.0.0.1:14318/v1/metrics

The installer builds a hash-locked virtual environment once, installs static

notify and health scripts transactionally, and writes a non-secret runtime

manifest. A failed install restores the complete prior managed runtime. Preserve

any existing notifier chain when adding

$CODEX_HOME/bin/codex-splunk-o11y-notify.zsh to user-level Codex notify.

Per-turn execution never invokes uv, pip, or another package manager.

Preview apply operations without writing to CODEX_HOME:

bash skills/splunk-observability-codex-instrumentation-setup/scripts/setup.sh \
  --apply all \
  --dry-run \
  --json

Rendered Artifacts

OTLP trace export, SignalFx metric export, /v3/event log export, optional logs pipeline,

normalized service.name/deployment.environment and

sf_service/sf_environment, and send_otlp_histograms: true.

digest to Splunk Distribution 0.158.0; upstream contrib is rejected for

this native-histogram path.

codex exec --profile <rendered-profile> --json.

wrapper.

interactive Stop hook.

completed Codex turns into Galileo Observe. It documents the notify

strategy, trace shape, secret handling, duplicate suppression, and read-back

validation using traces/count plus export_records.

runtime/codex-splunk-o11y-notify-span.py: metadata-only, fail-soft

interactive turn export with exact thread/turn routing and a persistent

retry outbox. GenAI token and duration metrics use the OpenTelemetry bucket

advisories, {token}/s units, and explicit delta temporality.

optional live OTLP export smoke test.

without waiting for another Codex turn; invoke it from the collector

supervisor after health recovery.

installer. It does not rewrite the user-level Codex notifier chain.

doctor-report.md, and handoff.md.

Apply Sections

CODEX_HOME/bin.

into CODEX_HOME/hooks.json without removing unrelated hooks.

--apply consumes the already-rendered and reviewed apply-plan.json when it

exists in --output-dir. If no apply plan exists, the skill renders from the

current options first.

Read reference.md for the full option contract and source

basis.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.