Doca Telemetry
NVIDIAOfficialCreated by NVIDIA
- Skill
- Tool integration
- Software development
- Apache-2.0
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The doca-telemetry skill provides guidance for developers using the NVIDIA DOCA SDK to read hardware-counter events directly from a doca_dev. It covers the six per-domain reader libraries: PCC, DPA, DIAG, ADP_RETX, PHY, and PCI. This skill focuses on the reader-side lifecycle, including capability checks, context creation, and snapshot retrieval. It explicitly distinguishes between reading hardware counters and the separate task of publishing or exporting telemetry data, which is handled by the doca-telemetry-exporter library.
What it does
- Provides access to per-domain hardware-counter reader libraries (PCC, DPA, DIAG, ADP_RETX, PHY, PCI).
- Guides developers through the per-domain DOCA Core lifecycle for reading device snapshots.
- Implements capability-first checks to ensure a device supports specific counter domains.
- Explains the error taxonomy for reader-specific issues like snapshot readiness (AGAIN) or unsupported domains.
- Routes users to the appropriate library for publishing or exporting telemetry data.
- Supports C/C++ development with guidance for FFI/bindings in other languages.
When to use it
- When you need to read raw hardware-counter snapshots from a BlueField DPU or ConnectX NIC.
- When you are developing an application that requires low-level access to device-specific telemetry.
- When you need to verify if a specific hardware-counter domain is supported on your current device.
- When you are debugging why a counter read is returning a specific DOCA error code.
- When you need to distinguish between reading local device counters and exporting metrics to external systems.
Advantages
- Direct access to hardware-level performance and diagnostic counters.
- Standardized lifecycle and capability-query patterns across different counter domains.
- Clear separation of concerns between reading hardware counters and exporting telemetry data.
- Robust error handling guidance for hardware-specific states.
Usage examples
- “Read PCC counters from my BlueField app.”
- The agent guides you to use doca_telemetry_pcc_cap_is_supported, create the PCC context, start it, and use doca_telemetry_pcc_get_counters.
- “How do I check if my device supports PHY counters?”
- The agent instructs you to use the doca_telemetry_phy_cap_is_supported query on your device info before attempting to open a context.
- “My PHY counter read returns DOCA_ERROR_AGAIN, what should I do?”
- The agent explains that the snapshot is not ready and advises retrying after the documented sample-window delay.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/nvidia/doca-telemetry/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip doca-telemetry.zip -d .agents/skills
Documentation by NVIDIA
DOCA Telemetry
Examples
"Build a second program that RECEIVES the events my exporter app publishes." No DOCA library consumes exporter events, and this skill is not that library:
doca-telemetryreads a device's hardware counters. The app linksdoca-telemetry-exporterto publish; the receiver is the DOCA Telemetry Service over IPC (doca-dts), or the exporter's file output for a local smoke. Do not invent a consume or collector API. Then: the publishing app owns the schema; check the IPC path withdoca_telemetry_exporter_check_ipc_status; smoke one event with field values intact (file output) before bulk; when reporting cannot keep up, drop or aggregate on the hot path, never block."Read PCC counters from my BlueField app." — this is in scope. Use the per-domain Telemetry reader; do not stand up DTS or an exporter here. Sequence:
doca_telemetry_pcc_cap_is_supportedon the device, create the PCC context on the opendoca_dev(doca_telemetry_pcc_rep_createfor a representor), start it, read once withdoca_telemetry_pcc_get_counters, then stop and destroy. Reads before start returnDOCA_ERROR_BAD_STATE."Sample DPA counter exports." — stay on
doca_telemetry_dpareads. Publishing those samples belongs to the exporter skill.
Instructions
Follow Loading order below. Open the tasks companion for configure / read / debug. Open the capabilities companion for the per-domain readers. Do not open every companion file.
Where to start: This skill assumes DOCA is already installed
and the user is doing hands-on hardware-counter-reader work —
opening a per-domain doca_telemetry_<domain> context against a
doca_dev and reading the latest hardware-counter snapshot for
that domain. The library is the counter-READER half of DOCA
telemetry; it is NOT a NetFlow / IPFIX collector and NOT a
generic schema-event consumer (there is no NetFlow / IPFIX /
local-socket transport surface in the public header).
Open the tasks companion if the user wants to do something
(configure / build / modify / run / test / debug); open
the capabilities companion when the question is which
hardware-counter domains can this device read on this install
(PCC, DPA, DIAG, ADP_RETX, PHY, PCI). If the user has not
installed DOCA yet, route to
doca-setup/SKILL.md first. If the user is
confused about whether they want this library (HW-counter
reader on a doca_dev) or
doca-telemetry-exporter/SKILL.md
(the publisher / export side, which is a separate library and
publishes structured telemetry / labeled metrics / OTLP logs),
read the reader-vs-exporter role split in
the capabilities companion
BEFORE configuring anything; mixing the two is the load-bearing
first-app failure for this skill. If the user is asking about
DOCA Telemetry Service (DTS) as deployed, route to doca-dts.
Audience
This skill serves external developers building applications
that READ DOCA hardware counters from a doca_dev through one
or more of the six per-domain DOCA Telemetry reader libraries
(doca_telemetry_pcc / _dpa / _diag / _adp_retx / _phy /
_pci) — i.e., users whose application code calls
doca_telemetry_<domain>_* (directly in C/C++, or through FFI /
bindings from another language) to open a per-domain context on
a doca_dev, configure the per-domain sample window, and read
the hardware-counter snapshot for that domain. It is not for
NVIDIA developers contributing to DOCA Telemetry itself, and it
is not for users writing the publishing / export side —
that is
doca-telemetry-exporter/SKILL.md,
a separate library and a separate skill.
Language scope. DOCA Telemetry's per-domain reader libraries
ship as a C surface with pkg-config module name
doca-telemetry. The shipped samples are written in C. C and
C++ readers are the canonical case; the worked examples in
the tasks companion assume that path. Other-language readers (Rust, Go,
Python, …) consume the same *.so through FFI or
language-specific bindings; the skill's contribution in that
case is to keep the reader-vs-exporter distinction, the per-
domain cap-query-first discipline, the per-domain DOCA Core
lifecycle on the doca_dev, the sample-window discipline, and
the error-taxonomy guidance language-neutral, and to route the
agent to the public per-domain C ABI as the authoritative
surface that any wrapper will eventually call.
When to load this skill
Load this skill when the user is doing hands-on DOCA Telemetry hardware-counter-reader work, in any language. Concretely:
Picking the right per-domain header for the counters the user wants (
doca_telemetry_pcc.hfor Programmable Congestion Control counters,_dpa.hfor DPA counters,_diag.hfor generic device diagnostic counters,_adp_retx.hfor ADP retransmit counters,_phy.hfor physical-layer counters,_pci.hfor PCI / PCIe counters) and confirming the device supports it via the per-domain_cap_is_supported(devinfo)query — except_pci, which has no single_cap_is_supportedand instead exposes per-feature caps likedoca_telemetry_pci_cap_management_info_is_supported/_cap_perf_counters_1_is_supported.Opening a per-domain
doca_telemetry_<domain>context on adoca_dev, walking the per-domain lifecycle (doca_telemetry_<domain>_create(dev)→ per-domain setters →doca_telemetry_<domain>_start), configuring the per-domain sample window, and reading the hardware-counter snapshot for that domain. Note this is a per-domain_create/_startsurface, not the genericdoca_ctx_*progress-engine lifecycle.Reading the device + library capability surface before assuming a counter family is available: use
doca_telemetry_<domain>_cap_is_supportedonly forpcc,dpa,diag,adp_retx, andphy; use the matching per-featuredoca_telemetry_pci_cap_*_is_supportedquery for PCI.Handling per-domain
DOCA_ERROR_*returns from a counter read (lifecycle vs. device-doesn't-support-this-domain vs. per-domainAGAIN-means-snapshot-not-ready vs. permission / driver) and the per-read status reported back to the application.Choosing between DOCA Telemetry (hardware-counter READER) and an adjacent option:
doca-telemetry-exporter/SKILL.mdwhen the user actually wants to PUBLISH / EXPORT the counter values (OTLP / Prometheus / labeled metrics);doca-logwhen plain structured stdout logging is enough; a generic Prometheus / OpenTelemetry client library when the counter source is a non-DOCA program; the DOCA Telemetry Service (doca-dts) when the user wants a turnkey aggregator.Designing or extending non-C bindings (Rust, Go, Python, …) that wrap the per-domain reader C ABI — for the reader-vs- exporter distinction, the per-domain cap-query-first rule, the per-domain
doca_devlifecycle, the sample-window discipline, and the error rules the wrapper must honor.
Do not load this skill for general DOCA orientation, install
of DOCA itself, the publishing / export side
(doca-telemetry-exporter/SKILL.md
has its own skill), the DOCA Telemetry Service (doca-dts), or
non-reader library questions.
For those, use
doca-public-knowledge-map/SKILL.md.
What this skill provides
This is a thin loader. The body keeps only the orientation needed to pick the right next file. The substantive hardware-counter-reader material lives in two companion files:
the capabilities companion — what the per-domain readers can express on this install: the reader-vs-exporter role-split rule, the six shipped sub-libraries (
doca_telemetry_pcc/_dpa/_diag/_adp_retx/_phy/_pci) and which counter family each one exposes, the per-domain DOCA Core lifecycle on adoca_dev, the domain-level capability query for PCC / DPA / DIAG / ADP_RETX / PHY and the per-feature capability queries for PCI, the reader error taxonomy (mapped onto the cross-libraryDOCA_ERROR_*set, with theNOT_SUPPORTED-means-domain- not-exposed-on-this-device rule and theAGAIN-means- snapshot-not-ready rule called out explicitly), the observability surface (per-read status + per-domain cap- query snapshot at configure time), the safety policy that gates per-domain reads behind the cap-query result, and the path-selection rule againstdoca-telemetry-exporter/SKILL.md,doca-log, and standalone Prometheus / OpenTelemetry / DTS.the tasks companion — step-by-step workflows for the six in-scope reader verbs:
configure,build,modify,run,test,debug. Plus aDeferred task verbsblock that points out-of-scope questions at the right next skill.
The skill assumes a host where DOCA is already installed at
the standard location and a target BlueField DPU or ConnectX NIC
is available. The ## run workflow
opens the corresponding doca_dev and requires the per-domain
cap-query to return DOCA_SUCCESS. It does not cover installing
DOCA — that path goes through
doca-setup/SKILL.md — and it does not
cover writing the publishing / export side, which is
doca-telemetry-exporter/SKILL.md.
Loading order
Read this skill first to confirm the user's question is in scope (specifically, that the user wants to READ a per-domain hardware counter via the per-domain reader API on a
doca_dev— not PUBLISH counters, which isdoca-telemetry-exporter/SKILL.md; not deploy DTS, which isdoca-dts; and not stand up a NetFlow / IPFIX collector, which this library does not expose a surface for).For the reader-vs-exporter rule, the six per-domain sub-libraries, the per-domain DOCA Core lifecycle on a
doca_dev, the per-domain capability query, the error taxonomy (including theNOT_SUPPORTED-means-domain- not-exposed-on-this-device rule and theAGAIN-means- snapshot-not-ready rule), observability, the safety policy, and the path-selection rule, see the capabilities companion.For step-by-step workflows — configure, build, modify, run, test, debug — see the tasks companion.
Both companion files cross-link to each other,
doca-version/SKILL.md for the canonical
version-handling rules, and
doca-public-knowledge-map/SKILL.md
whenever the right answer is "look it up in the public docs or
the installed package layout" rather than "reader-specific
guidance".
Related skills
doca-telemetry-exporter/SKILL.md— the publishing / export side. This skill (the per-domain hardware-counter reader) anddoca-telemetry-exporter(the application-side labeled-metrics / OTLP-logs publisher) are two separate libraries that solve two different problems — they do NOT form a publisher/collector pair (there is no collector transport surface here). An application that wants to EMIT counters to its monitoring pipeline links the exporter; an application that wants to READ hardware counters off adoca_devlinks this skill. Wiring the wrong library into the user's app is the #1 first-app failure for both skills, and the load-bearing rule the agent must surface before any code-level guidance.doca-public-knowledge-map/SKILL.md— the routing table for every public DOCA documentation source and the on-disk layout of an installed DOCA package. The per-domain reader's public guide URL ishttps://docs.nvidia.com/doca/sdk/DOCA-Telemetry/index.html(distinct from the publisher's guide athttps://docs.nvidia.com/doca/sdk/DOCA-Telemetry-Exporter/index.html); the on-disk samples live under/opt/mellanox/doca/samples/doca_telemetry/. The DOCA Telemetry Service (DTS) has its own skill,doca-dts.doca-setup/SKILL.md— env preparation, install verification, and the I have no install yet path with the public NGC DOCA container. This skill assumes its preconditions are satisfied (in particular, adoca_devis open anddoca_telemetry_<domain>_cap_is_supported(devinfo)returnsDOCA_SUCCESSfor the per-domain library the user wants to read).doca-version/SKILL.md— canonical DOCA version-handling rules. This skill's Version compatibility overlay cross-links the four-way match rule plus detection chain and adds the per-domain reader overlay (each per-domain library's counter set can grow across DOCA releases; cap-query first, then read).doca-structured-tools-contract/SKILL.md— the bundle's structured-tools precedence rule (detect / prefer / fall back / report). The Command appendix in the tasks companion honors this contract.doca-programming-guide/SKILL.md— general DOCA programming patterns shared by every library: the canonicalpkg-config+ meson build pattern, the universal modify-a-shipped-sample first-app workflow, the universal lifecycle, the cross-libraryDOCA_ERROR_*taxonomy, and the program-side debug order. This skill layers per-domain reader specifics on top.doca-log— the right primitive when the user actually wanted plain structured stdout logging from their own program rather than a structured hardware-counter snapshot. The reader's per-domain cap- query discipline is overhead the user does not need for plain logs; this skill's path-selection rule routes there when log shipping is the actual requirement.doca-debug/SKILL.md— the cross- cutting debug ladder (install / version / build / link / runtime / program / driver). Per-domain reader-specific debug (domain not supported on this device, snapshot not yet ready, sample window too short, cap-query forgotten before read) overlays on top of that ladder.
Files
- ATTRIBUTION.mdAdded by AutoGineer900 B
- BENCHMARK.md9.9 KiB
- CAPABILITIES.md26.6 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md14.7 KiB
- SKILLCARD.yaml2.8 KiB
- TASKS.md29.7 KiB
- evals/evals.json2.5 KiB
- references/details.md6.6 KiB
- skill-card.md5.3 KiB
- skill.oms.sig5.3 KiB
TASKS.md
DOCA Telemetry per-domain hardware-counter-reader workflows
This library is the per-domain hardware-counter READER half
of DOCA telemetry. It exposes six independent per-domain reader
sub-libraries — doca_telemetry_pcc / _dpa / _diag /
_adp_retx / _phy / _pci — each with its own header, its own
opaque context type, and its own doca_telemetry_<domain>_* C
API. There is no NetFlow / IPFIX / local-socket collector
surface, no schema-registration, and no socket / port /
publisher to configure. Each domain is read directly off an
already-open doca_dev via cap-query → _create → per-domain
setters → _start → per-domain read → _stop → _destroy. The
publishing / export side is the sibling
doca-telemetry-exporter/SKILL.md
library — a separate skill.
Where to start: The verbs run configure → build → modify → run → test → debug. Skip ahead only when the user is already
past a verb. The ## test verb is an iterative loop (cap-query
sanity → single per-domain read smoke → multi-read cadence →
under-load sample-window behavior → loop back if the device or
domain set changes), not a one-shot pass — see the eval-loop
overlay in ## test below.
Read this file when the loader sent you here from
SKILL.md. For the per-domain sub-libraries, the
reader-vs-exporter role split, the per-domain lifecycle on a
doca_dev, the per-domain capability-query rule, the error
taxonomy (including the NOT_SUPPORTED-means-domain-not-exposed
rule and the AGAIN-means-snapshot-not-ready rule),
observability, and safety policy, see
CAPABILITIES.md. For where to find docs, the
installed DOCA layout, or release notes, route through
doca-public-knowledge-map/SKILL.md.
Each verb below describes the shape of the workflow, not a copy-paste recipe. The agent's job is to walk the user through the steps in order, verifying preconditions before recommending the next call.
configure
Goal: pick the right per-domain reader sub-library, confirm the
device exposes it, and stand up the per-domain context on an
already-open doca_dev — before any counter read.
Steps the agent should walk the user through:
Confirm the role: this is the READER (consume-from-device) side. Before any code change, surface the reader-vs-exporter distinction per the role-split table in
CAPABILITIES.md ## Capabilities and modes.doca-telemetryis what the user's application links to read hardware counters off adoca_dev; the publishing / export side isdoca-telemetry-exporter/SKILL.md, a separate sibling library. An agent that walks the user toward the exporter skill when they wanted to read counters is wrong; an agent that recommends linking this reader when the user actually wanted to publish is wrong. State the role first, before anypkg-configmention or any code sketch.Pick the per-domain sub-library. Per the sub-library table in
CAPABILITIES.md ## Capabilities and modes, map the counters the user cares about to exactly one domain: PCC (doca_telemetry_pcc.h), DPA (_dpa.h), device diagnostics (_diag.h), adaptive-retransmit histogram (_adp_retx.h), physical layer (_phy.h), or PCI / PCIe (_pci.h). Each is a separate header and a separate context type — there is no single "telemetry" context that reads all of them. If the user needs counters from more than one domain, that is more than one per-domain context in the same application.Confirm the installed DOCA version and cap-query the domain. Use the procedure in
doca-version TASKS.md ## configure(doca-version/TASKS.md#configure). Quote the version observed (pkg-config --modversion doca-telemetry, thendoca_caps --version); do not assume "latest". Then call the matching per-domain capability query against the activedoca_devinfo:doca_telemetry_<domain>_cap_is_supported(devinfo)forpcc/dpa/diag/adp_retx/phy. Forphy, also query the per-sub-area caps (e.g.doca_telemetry_phy_cap_counter_and_ber_info_is_supported) for the specific sub-area you intend to read. Forpcithere is NO single domain-level cap — query the per-feature caps (doca_telemetry_pci_cap_management_info_is_supported,_cap_perf_counters_1_is_supported,_cap_latency_histogram_is_supported) for the PCI counter family you intend to read. Per the capability-query rule inCAPABILITIES.md ## Capabilities and modes, the queried value is the runtime authority, not the agent's memory. ADOCA_ERROR_NOT_SUPPORTEDhere is the answer (the device does not expose this domain), not a bug. Quote the values back to the user.Create the per-domain context on the
doca_dev. Calldoca_telemetry_<domain>_create(dev, &ctx)against the already-opendoca_dev(for the PCC representor path, usedoca_telemetry_pcc_rep_create(dev_rep, &ctx)). Thedoca_devmust already be open — opening it is thedoca-common/ device-discovery concern, not this skill's.Apply the per-domain configuration knobs (domain-specific, optional for some domains). Set only what the domain exposes — there is no transport / socket / schema to configure:
diag: set the sample mode (doca_telemetry_diag_set_sample_mode), sample period (_set_sample_period), and max num samples (_set_log_max_num_samples); thendoca_telemetry_diag_apply_configand select the counter IDs withdoca_telemetry_diag_apply_counters_list_by_idBEFORE start.adp_retx: set the histogram shape (_set_hist_num_bins,_set_hist_bin0_width,_set_hist_time_unit,_set_hist_clear_on_read, optionally_set_hist_vhca_id), bounded by the_cap_get_hist_max_bins/_cap_get_hist_time_unitscaps from step 3.dpa: optionally_set_max_perf_event_samplesbefore reading perf-event lists.pcc/phy/pci: typically no pre-start setters — read directly after start. Before enablingadp_retx_set_hist_clear_on_readordiagdata-clear, explicitly confirm destructive-read intent: each read resets the underlying counters, so a second reader or later read sees only values accumulated after that reset. Leave destructive reads disabled unless the user explicitly requests them.
Start the per-domain context. Call
doca_telemetry_<domain>_start(ctx). Reads before start returnDOCA_ERROR_BAD_STATE. Fordiag, start is only valid after_apply_config. If start fails, route through the error taxonomy inCAPABILITIES.md ## Error taxonomybefore retrying.
If any step fails with a DOCA_ERROR_*, route through the error
taxonomy in
CAPABILITIES.md ## Error taxonomy
before retrying. In particular, DOCA_ERROR_NOT_SUPPORTED on
the cap-query or first read is not a configure-time bug — it is
the canonical “this device does not expose this counter
domain” signal, and the correct response is to surface it, not
to retry.
build
Goal: produce a reader binary that links DOCA Telemetry against the user's installed DOCA, using the canonical cross-library build pattern.
The build pattern for any DOCA C/C++ consumer is identical
across libraries — pkg-config for include + link flags, meson
or CMake as the build system — and is fully documented in
doca-programming-guide TASKS.md ## build (doca-programming-guide/TASKS.md#build).
This skill carries only the reader-specific overlay:
| Slot | Value for the reader | Why it matters |
|---|---|---|
pkg-config module name | doca-telemetry | The reader's .pc file installed by the DOCA host packages. Wrong module name = wrong direction — doca-telemetry-exporter is the SIBLING publisher library, with its own .pc and its own skill at doca-telemetry-exporter/SKILL.md. Picking doca-telemetry-exporter when the user wanted to read counters (or doca-telemetry when the user wanted to publish) is the load-bearing first-app failure, NOT a typo — re-check the role per CAPABILITIES.md ## Capabilities and modes |
Header to #include | The per-domain header for the chosen domain: doca_telemetry_pcc.h / _dpa.h / _diag.h / _adp_retx.h / _phy.h / _pci.h | Each domain is a separate header. Including the wrong domain's header gets the wrong symbol family. Resolve under $(pkg-config --variable=includedir doca-common) |
| Include flags | pkg-config --cflags doca-telemetry | Resolves to the telemetry headers on this install |
| Link flags | pkg-config --libs doca-telemetry | Pulls in whatever pkg-config --libs resolves on this install (do not predict the -l<name> form by hand — .so basenames use underscores, .pc names use hyphens, and pkg-config is the only correct translator) plus the transitive set the resolver computes |
| Minimum required DOCA version | Query with pkg-config --modversion doca-telemetry; never hardcode in build files | The per-domain counter set grows across releases; cross-version build / runtime mixing breaks per CAPABILITIES.md ## Version compatibility |
For non-C consumers (Rust, Go, Python), the link surface is the
same *.so files; the FFI wrapper layer is the language-specific
binding and is out of scope for this skill — but the slots above
are still the load-bearing inputs the wrapper needs.
modify
Goal: take a shipped DOCA Telemetry reader sample as the verified starting point and apply a minimum-diff modification to express the user's intent.
The universal modify-a-shipped-sample workflow lives in
doca-programming-guide TASKS.md ## modify (doca-programming-guide/TASKS.md#modify).
Use it as-is. The reader-specific overlay is the modify-from-
sample contract fill — the slots the agent must elicit from the
user before recommending any code-level edit:
| Slot | What the agent asks the user | Reader-specific consideration |
|---|---|---|
| 1. Starting sample | Which sample under /opt/mellanox/doca/samples/doca_telemetry/? | Pick the sample for the SAME domain the user picked in ## configure step 2 (e.g. the PHY sample for PHY counters). A smaller diff is always safer than a re-architecture across domains |
| 2. Domain + counters | Which per-domain sub-library, and which specific counters / sub-areas within it? | Re-validate against the per-domain cap-query per ## configure step 3; a counter family present on one install / device may return NOT_SUPPORTED on another |
| 3. Sample shape (sampled domains) | For diag / adp_retx: what sample mode, sample period, and num-samples / histogram-bin shape? | Bound every setter by the _cap_* sizing caps from ## configure step 3; a value past the cap returns DOCA_ERROR_INVALID_VALUE. For diag, the _apply_config + _apply_counters_list_by_id calls MUST stay before _start |
4. Read cadence + AGAIN behavior | How often does the modified reader read, and what does it do when a read returns DOCA_ERROR_AGAIN? | Per CAPABILITIES.md ## Safety policy sample-window rule, the retry must respect the sample window (for diag, wait for the previous sampling cycle); a tight AGAIN spin is a sample gap that needs editing out before the modify lands |
| 5. Clear-on-read intent | Does the modified reader enable clear-on-read (adp_retx _set_hist_clear_on_read, diag data-clear)? | Per CAPABILITIES.md ## Safety policy, clear-on-read resets the underlying counters — a second reader sees the counters as they stand after the reset. Decide explicitly; default to NOT clearing unless the user wants destructive reads |
| 6. Build manifest | Keep the sample's existing meson.build (which already wires pkg-config doca-telemetry)? | Yes. Do not switch to a hand-rolled Makefile for “simplicity” — it removes the version-check rail. And do not silently swap the pkg-config module to doca-telemetry-exporter — that flips the role and is the load-bearing first-app failure |
The agent emits an intent description + the filled slots, then
walks the unified diff line-by-line against the sample source
read on disk and has the user paste back the result for
validation. This bundle has no diff renderer (per
doca-programming-guide TASKS.md ## modify (doca-programming-guide/TASKS.md#modify)).
run
Goal: actually execute the built reader against the user's
installed DOCA, against an open doca_dev, reading the chosen
domain's counters.
Steps the agent should walk the user through:
Open the
doca_devand cap-query the domain on it. The reader's first job is to open the target device and confirmdoca_telemetry_<domain>_cap_is_supported(devinfo)(or thepciper-feature caps) returnsDOCA_SUCCESS. ADOCA_ERROR_NOT_SUPPORTEDhere means the device does not expose this domain — fix the device selection or the domain choice, not the read call.Run as a user with privilege for the counter domain (typically NOT blanket sudo). Per
CAPABILITIES.md ## Safety policy, some diagnostic / PHY / PCI counters require elevated device access. ADOCA_ERROR_NOT_PERMITTEDon create / start / read means the running user lacks the specific privilege — grant it on the env side rather than reflexively running the whole app as root.Create → (configure) → start → read once. Walk the per-domain lifecycle from
## configure: create on thedoca_dev, apply any domain setters, start, then issue ONE read (e.g.doca_telemetry_phy_get_counter_and_ber_info,doca_telemetry_pcc_get_counters,doca_telemetry_diag_query_counters,doca_telemetry_pci_read_perf_counters_1,doca_telemetry_dpa_read_cumul_info_list). Confirm the read returnsDOCA_SUCCESSand the output struct is populated before any loop. If clear-on-read is configured, do not issue the read until the user has explicitly confirmed the destructive reset described in## configurestep 5; otherwise leave clear-on-read disabled.Capture the structured log. Set
DOCA_LOG_LEVEL=tracefor the first run (seedoca-debug CAPABILITIES.md ## Observability(doca-debug/CAPABILITIES.md#observability)). This is the cheapest way to make the per-domain lifecycle transitions and the first failing read visible.Handle
DOCA_ERROR_AGAINwith sample-window-aware retries, not a spin.AGAINon a read means the snapshot / sample cycle is not ready yet. Retry after the documented sample window (fordiag, after the previous sampling cycle completes — see the note ondoca_telemetry_diag_query_counters), perCAPABILITIES.md ## Safety policy. A direct run gets at most two sample-window retries, with no mutation between them. If both produce the sameAGAINread outcome, stop the run and enter## debugwith both reads; do not add a third retry.Stop and destroy on teardown. Call
doca_telemetry_<domain>_stopthendoca_telemetry_<domain>_destroyin reverse-create order.
test
Goal: prove the per-domain reader can actually read the chosen counters off the device, end-to-end, before claiming the “build a first counter-reading app” journey is done.
This is a loop, not a one-shot pass. Each iteration narrows
either the domain / sub-area selection, the cap-query result,
the sample-window behavior, or the per-read return. The loop
terminates when either (a) the reader reads the intended
counters off the device with the expected values and the
sample-window behavior matches the policy decided in
## modify slot 4, or (b) the agent has narrowed the
failure to a layer outside the reader itself (device / driver /
privilege) and escalated to the matching skill.
Iteration identity is exact evidence, not prose similarity. One iteration is identified by the tuple trigger-table row + capability result (or capability-query error) + read result / error / populated outcome. Compare that complete tuple between iterations. Two consecutive unchanged tuples are an escalation condition and are never evidence of success.
Iteration shape:
Lifecycle smoke. Create the per-domain context on the
doca_dev,_start, and confirm both succeed before any read. ADOCA_ERROR_BAD_STATEhere means a lifecycle ordering bug (read before start, or — for diag — start before_apply_config); aDOCA_ERROR_NOT_PERMITTEDmeans a privilege gap. Validates the lifecycle BEFORE chasing counter values.Capability re-check. Re-run the per-domain
doca_telemetry_<domain>_cap_is_supported(devinfo)forpcc,dpa,diag,adp_retx, orphy(plus PHY per-sub-area caps), or the matching per-featuredoca_telemetry_pci_cap_*_is_supportedquery for PCI. If the sub-area / counter family the user wants returnsNOT_SUPPORTED, that is the answer for this device + install; update the domain / sub-area selection (or the device) before continuing.Single-read smoke. Issue ONE per-domain read and confirm it returns
DOCA_SUCCESSwith a populated output struct. If the read returnsDOCA_ERROR_AGAIN, the snapshot is not ready — retry after the sample window, not in a tight loop. If it returnsNOT_SUPPORTED, the sub-area is not exposed (back to step 2).Value-sanity pass. Confirm the values read are plausible for the device's state (e.g. PHY BER non-negative, PCC per-algo counters consistent with the active algo slots, diag samples within the configured num-samples). Implausible values point at the wrong sub-area / wrong output-format interpretation, not a library bug.
Multi-read cadence. Loop a small N reads at the intended cadence with the sample-window discipline; confirm each read returns
DOCA_SUCCESS(or a sample-windowAGAINthat resolves on the next windowed retry) and the values evolve as expected. For clear-on-read configs, confirm the post-clear semantics match intent (per## modifyslot 5).Under-load behavior. If the user reads under device load, confirm the read cadence still converges and that
AGAINfrequency tracks the sample window rather than a stuck cycle.
Eval-loop overlay — why this is a loop, not a one-shot pass:
| Iteration trigger | What it looks like | What changes next iteration |
|---|---|---|
DOCA_ERROR_NOT_SUPPORTED on cap-query or read | The device does not expose this domain / sub-area on this install | Re-pick the domain / sub-area per CAPABILITIES.md ## Capabilities and modes, or confirm the right device is selected; this is the cap answer, not a retry case |
DOCA_ERROR_BAD_STATE on read | Read before _start, or (diag) start before _apply_config | Fix the per-domain lifecycle ordering per ## configure; re-run the lifecycle smoke |
DOCA_ERROR_AGAIN on read | Snapshot / sample cycle not ready yet | Retry after the sample window (diag: after the previous cycle), with no mutation between retries; after two unchanged sample-window retries, stop and escalate to ## debug |
DOCA_ERROR_INVALID_VALUE on a setter or read | A sample / histogram value past the install's cap, or an undersized output buffer | Re-read the _cap_get_* sizing query and size the value / buffer to it |
| Same code reads on device A, returns NOT_SUPPORTED on device B | Different device family / firmware feature bits, or different DOCA version | Re-narrow to per-device cap-query; the reader behavior is the same, the variance is at the device / version layer |
Loop termination: stop iterating when two consecutive iterations
have the same trigger row, capability result / error, and read
result / error / populated outcome. Matching evidence across both
iterations requires escalation, never success; it means the cause
is below the reader (device / driver / firmware feature gating).
Escalate to
doca-debug TASKS.md ## debug (doca-debug/TASKS.md#debug)
with the captured cap-query + per-read evidence and the device /
version state.
debug
Goal: when a DOCA Telemetry per-domain read returns a
DOCA_ERROR_* (or returns implausible values), narrow the cause
to a specific layer and act on it.
The cross-library debug ladder lives in
doca-debug TASKS.md ## debug (doca-debug/TASKS.md#debug).
Walk through it in order — install → version → build → link →
runtime → program → driver — before recommending reader-
specific fixes. This skill's overlay names the reader-specific
manifestation at layers 5 (runtime) and 6 (program):
Layer 5 (runtime) — reader overlay.
Walk the role rule: did the user actually want the reader and not the exporter? If the user is reading guides about emitting / publishing values, route them to
doca-telemetry-exporter/SKILL.mdvia the role-split table inCAPABILITIES.md ## Capabilities and modes, not to debug the reader further.Walk the cap-query rule: a
DOCA_ERROR_NOT_SUPPORTEDon cap-query or read means the device does not expose this domain / sub-area on this install. This is the answer, not a bug — confirm the device + domain selection perCAPABILITIES.md ## Capabilities and modes.Walk the privilege state: a
DOCA_ERROR_NOT_PERMITTEDon create / start / read means the running user lacks privilege for this specific counter domain — grant it on the env side, resist reflexive globalsudo.
Layer 6 (program) — reader overlay.
Lifecycle order: cap-query → create → (configure / for diag
apply_config+apply_counters_list_by_id) → start → read → stop → destroy. Out-of-order returnsDOCA_ERROR_BAD_STATE. The most common case is reading before_start, or reading diag before_apply_config.Sample-window discipline: a
DOCA_ERROR_AGAINon read is the snapshot / sample cycle not being ready — the fix is a sample-window-aware retry, NOT a tight spin. For diag, the next_query_countersmust wait for the previous sampling cycle to finish.Output-format interpretation: implausible counter values are usually the wrong sub-area read or the wrong output-format struct interpreted (e.g. diag format_0 vs format_1 vs format_2). Re-read the per-domain header's output-struct definition; the values are the device's, the interpretation is the program's.
Buffer / range sizing: a
DOCA_ERROR_INVALID_VALUEon a setter or read is a value past the install's cap or an undersized output buffer. Re-read the matching_cap_get_*sizing query; the fix is at the call site, not by widening a cap (it is device-bound).
Once the layer is identified, route to the matching debug verb
on the matching skill: install / build / link / driver to
doca-setup ## debug (doca-setup/TASKS.md#debug);
version to doca-version ## debug (doca-version/TASKS.md#debug);
cross-cutting runtime to
doca-debug ## debug (doca-debug/TASKS.md#debug);
program-layer Core patterns to
doca-programming-guide TASKS.md ## debug (doca-programming-guide/TASKS.md#debug);
publishing-side concerns to
doca-telemetry-exporter ## debug (doca-telemetry-exporter/TASKS.md#debug).
Deferred task verbs
The following verbs are out of scope for this skill but are commonly asked in the same conversations. Route them as follows so the agent does not invent guidance:
install. Installing DOCA, choosing packages, post-install verification,
pkg-configwiring — defer todoca-setup/SKILL.mdand to the install-tree layout in doca-public-knowledge-map ## Layout of an installed DOCA package (doca-public-knowledge-map/SKILL.md#layout-of-an-installed-doca-package). This skill assumes DOCA is already installed and adoca_devis open.publish / export telemetry. Wiring up the application-side publishing of labeled metrics / OTLP logs — out of scope for this skill. Route to
doca-telemetry-exporter/SKILL.mdfor the sibling publisher library. This skill is reader-side only.operate the DOCA Telemetry Service (DTS) itself. That is
doca-dts.stand up a NetFlow / IPFIX / socket collector. The per-domain reader libraries do not expose a collector / schema-transport surface. Route to a generic collector outside the DOCA family, to
doca-telemetry-exporter/SKILL.mdfor publishing, or todoca-dtsfor productized aggregation.deploy. Deploying counter-reading applications at scale across many hosts, Kubernetes operator workflows — out of scope for this skill.
firmware burn / reset. The reader does not depend on a firmware-burn step directly; if the debug ladder lands on a driver / firmware-feature-gating issue (
DOCA_ERROR_IO_FAILEDor persistentNOT_SUPPORTED), the fix is via the env-side skill:doca-setup ## debug(doca-setup/TASKS.md#debug) layer 5, then upstream documentation reachable throughdoca-public-knowledge-map/SKILL.md.
Command appendix
Every command below is cross-cutting on DOCA Telemetry
(per-domain reader) — it answers a recurring class of question
that comes up in the verbs above. The agent should treat the
class as load-bearing; the worked example is a single
instance. Run-as user is the reader application's normal user
unless noted. Rows that need elevated privileges call that out explicitly. (and is needed only for
counter domains that require elevated device access, per
CAPABILITIES.md ## Safety policy).
Infra-aware preamble (every row below). Per the bundle's
detect → prefer → fall back → report contract documented in
doca-structured-tools-contract ## The agent behavior contract (doca-structured-tools-contract/SKILL.md#the-agent-behavior-contract),
the agent should:
Probe for the matching structured helper FIRST (
doca-env --jsonfor version + devices + libraries + drivers + hugepages in one shot;doca-capability-snapshotfor per-device capability flags;version-matrix.jsonfor “available since” lookups).If the probe succeeds, the structured tool's output is the authoritative answer and the agent SHOULD NOT also run the manual command in the row below. Report “using structured
<tool>”.If the probe fails, fall back to the manual command in the row. Report “falling back to manual chain”.
The schemas the structured tools emit are defined in
doca-structured-tools-contract ## Schemas(doca-structured-tools-contract/SKILL.md#schemas); the version-handling semantics (four-way match, NGC, headers-win) are owned bydoca-version/SKILL.md.
| Command (worked example) | Owning step | Class of question it answers | What healthy output looks like |
|---|---|---|---|
pkg-config --modversion doca-telemetry | ## configure step 3; ## build slot | What is the build-time DOCA Telemetry (reader) version? | A semver string matching doca_caps --version. Disagreement = partial install (route to doca-version TASKS.md ## debug (doca-version/TASKS.md#debug) layer 2). If the command returns “Package 'doca-telemetry' was not found” and the user actually wanted the publisher, route to doca-telemetry-exporter/SKILL.md — wrong direction is the load-bearing first-app failure, not a typo |
pkg-config --cflags --libs doca-telemetry | ## build | What include + link flags does the linker need? | Trust whatever pkg-config --cflags --libs produces on this install. Do not hardcode either the -I include path or the -l<name> flag form — both can drift between DOCA install profiles and DOCA majors; the on-disk .so basenames use underscores while the .pc package names use hyphens, and pkg-config is the only thing that resolves both correctly |
ls /opt/mellanox/doca/samples/doca_telemetry/ | ## modify slot 1 | Which reader samples ship in this install, and which is the closest starting point? | A list of sample directories named after the per-domain reader they demonstrate |
doca_caps --version | ## configure step 3; ## test step 2 | What is the runtime DOCA version? | A semver string matching pkg-config --modversion doca-telemetry |
id | ## run step 2 | Does the running user have the privilege the counter domain requires? | The user's id has the device-access privilege the domain needs. Mismatch = DOCA_ERROR_NOT_PERMITTED on create / start / read — grant the specific privilege on the env side, not blanket sudo |
cat /opt/mellanox/doca/applications/VERSION | ## configure step 3; ## debug layer 1 | What does the install tree itself claim its version is? | A semver string matching the other two version sources |
dmesg | tail -n 40 (requires sudo) | ## debug layer 7 | What did the kernel / driver log around the last reader call? | Empty or recent benign messages. Repeated mlx5 / firmware / device errors → driver / env-layer bug; route to doca-setup ## debug (doca-setup/TASKS.md#debug) |
DOCA_LOG_LEVEL=trace ./<binary> | ## run step 4 | What did the structured DOCA logger emit for the first failing read? | A trace-level line on every per-domain lifecycle transition and every read. Per-read AGAIN traces = snapshot not ready — apply a sample-window-aware retry, not a blind spin |
For commands shared across libraries (pkg-config --modversion, doca_caps, cat /opt/mellanox/doca/applications/VERSION,
DOCA_LOG_LEVEL) the cross-library overlay is in
doca-debug TASKS.md ## Command appendix (doca-debug/TASKS.md#command-appendix);
this table adds the per-domain reader rows on top.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
The author says: Requires DOCA SDK installed at /opt/mellanox/doca on Linux (Ubuntu 22.04/24.04 or RHEL/SLES) with a BlueField DPU or ConnectX NIC attached. Reads the user's local install via `pkg-config doca-telemetry` and inspects /opt/mellanox/doca/{lib,include,samples,applications}. The validation steps require a live DOCA install.
Security
What our scanner noticed· Medium risk
- Large base64-encoded blobs
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- NVIDIA
- Publisher
- NVIDIA (Official)
- Source
- NVIDIA/skills · skills/doca-telemetry · commit fce3cca
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE-APACHE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by NVIDIA or NVIDIA.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download doca-telemetry.zip