opik: Skill for Claude Code

.agents/skills/metrics-instrumentation/SKILL.md

metrics-instrumentation is a skill for Claude Code, Codex from comet-ml/opik. It costs 93 tokens per session (2,974 once invoked), scanned A, original, Apache-2.0.

A specification for adding operational metrics to backend workflows using OpenTelemetry, a standard for collecting application measurements. It describes counts, timings, errors, and per-workspace dimensions for each processing stage.

In plain words
What is it for?
Use it when instrumenting scoring, data ingestion, experiments, or background jobs. It covers producer, consumer, queue-operation, and entrypoint metrics, but not dashboard creation.
Why use it?
It makes it possible to see where a workflow is slow, failing, or receiving no work, instead of treating the whole workflow as one unclear result.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is comet-ml/opik's own configuration. It tells Claude Code and Codex how to work on opik itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything opik configures →

About the project

Opik is an open-source platform for tracing, evaluating, and monitoring applications that use large language models, retrieval systems, or AI agents. Teams use it to inspect agent activity, manage prompts, run evaluations, and monitor these applications in production.

comet-ml/opik · 22,998 stars · on GitHub · comet.com

Reuse

Borrowing it

Nothing to install: this file belongs to comet-ml/opik. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/comet-ml/opik/main/.agents/skills/metrics-instrumentation/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/comet-ml/opik

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for metrics-instrumentation

README.md
[![agentmods](https://agentmods.dev/badge/skills/comet-ml/opik/metrics-instrumentation/github.svg)](https://agentmods.dev/skills/comet-ml/opik/metrics-instrumentation)
Your own site
<a href="https://agentmods.dev/skills/comet-ml/opik/metrics-instrumentation"><img src="https://agentmods.dev/badge/skills/comet-ml/opik/metrics-instrumentation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for metrics-instrumentation

Your own site · 80×15
<a href="https://agentmods.dev/skills/comet-ml/opik/metrics-instrumentation"><img src="https://agentmods.dev/badge/skills/comet-ml/opik/metrics-instrumentation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,974 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Snyk pass 7 Sept 2026
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Agent Snooping · line 92
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00093 $0.02974
Opus 5.5 $0.00037 $0.01190
Sonnet 5.5 $0.00019 $0.00595
Haiku 4.5 $0.00009 $0.00297

Measured 2mo ago against content hash 937490bb1311, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

metrics-instrumentation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/metrics-instrumentation/SKILL.md · 125 lines

How it starts

The opening of the file, as written. The whole thing — 125 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Metrics Instrumentation

Normative spec for the backend half of operational observability: per-stage OpenTelemetry metrics in apps/opik-backend. The metrics are designed so a flow-ordered Grafana dashboard can read top-to-bottom — the failing stage is the one whose numbers break — with a per-workspace drill. Building that dashboard (layout, query contracts, per-customer name resolution, dependency panels, validation) is a separate concern, specified by the dashboard-authoring skill in comet monitoring tooling; this skill covers only what to emit.

Patterns applied in this implementation (online scoring is the worked example):

  • Producer metrics — every stage that emits work is counted at the source: sampler decisions (sampler_decisions_total{decision}) and enqueue-to-Redis (enqueue_total{result}). A producer that emits nothing makes downstream starvation explainable rather than mysterious.
  • Consumer metrics — throughput and per-stage timing on the side that drains the queue (processing_time, plus per-Redis-op read/claim/ack_and_remove/list_pending_time).
  • Entrypoint RED — the workflow's front door (the HTTP ingest route) is measured Rate / Errors / Duration from http_server_request_duration_seconds, with 5xx broken down by endpoint × error_type × workspace, so an ingestion problem is never mistaken for a scoring problem.
  • Errors — a dedicated error counter per stage, dimensioned by error_type (the exception class) and, for shared async plumbing, by component (listener/subscriber): processing_errors_total, unexpected_errors_total, and enqueue_total{result="error"} (a push failure = real loss).
  • Success — success is derived, never double-counted: throughput − errors, surfaced as one "success rate" headline tile.
  • Queue time & end-to-end latency — queue_delay (enqueue→pickup) is kept separate from processing_time (scorer/LLM work) so a backlog is distinguishable from a slow scorer; end-to-end = queue_delay + processing_time.
  • Backpressure — poll-tick skips are counted but are benign (consumer busy), never lost work.
  • Saturation & resource levels — gauges for in-flight work (max per pod) and JVM heap used-vs-limit per pod expose the pipeline approaching a ceiling before it starts failing (the USE method — utilization / saturation / errors — complementing RED).
  • Volume & payload size — byte/char counters (bandwidth, total bytes) and payload-size distributions, broken down by content type and workspace, for cost and impact attribution.
  • Per-workspace dimensioning — the customer drill (§1.3) is a first-class label, not an afterthought.
  • Infrastructure dependencies — the datastores the flow leans on (Redis streams, ClickHouse, locks, MySQL) are surfaced on the dashboard from their exporters and system.query_log, so a "slow pipeline" resolves to the dependency causing it.

To see these conventions already in practice, grep apps/opik-backend for the existing metric families rather than specific classes (metric names are the stable contract; class locations move): the online-scoring *_sampler_decisions_total, *_enqueue_total{result}, *_processing_time_milliseconds, *_queue_delay_milliseconds, *_processing_errors_total{error_type} / *_unexpected_errors_total, the per-Redis-op *_{read,claim,ack_and_remove,list_pending}_time_milliseconds, and the attachment upload byte/size families.

Apply alongside the opik-backend skill (general conventions, logging rule).


Read the full file on GitHub · 125 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 125 lines · 93 tokens per session scan A 937490bb1311

Subscribe to this mod's changes

metrics-instrumentation is a skill published in the GitHub repository comet-ml/opik (22,998 stars, last pushed today), licensed Apache-2.0. It adds 93 tokens to every session and 2,974 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.