Generated banner for Doca Telemetry
Generated logo for Doca Telemetry

Doca Telemetry

NVIDIAOfficialCreated by NVIDIA

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • Medium risk

From the author

Use this skill to read DOCA hardware-counter events from a `doca_dev` through the per-domain Telemetry reader libraries: `doca_telemetry_pcc`, `_dpa`, `_diag`, `_adp_retx`, `_phy`, and `_pci`. It covers capability checks, context creation, startup, and per-domain reads or samples. Trigger for implicit requests such as "read PCC counters from my BlueField app", "sample DPA counter exports", or "expose PHY, PCI, or DIAG counters from this doca_dev". This is the counter-reader surface, not a NetFlow, IPFIX, or local-socket collector. Route publishing and export to `doca-telemetry-exporter`; route the deployed DOCA Telemetry Service to `doca-dts`, and collectors and plain stdout logging elsewhere.
— the description by NVIDIA

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

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/nvidia/doca-telemetry/download
  2. Unzip 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-telemetry reads a device's hardware counters. The app links doca-telemetry-exporter to 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 with doca_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_supported on the device, create the PCC context on the open doca_dev (doca_telemetry_pcc_rep_create for a representor), start it, read once with doca_telemetry_pcc_get_counters, then stop and destroy. Reads before start return DOCA_ERROR_BAD_STATE.

  • "Sample DPA counter exports." — stay on doca_telemetry_dpa reads. 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.h for Programmable Congestion Control counters, _dpa.h for DPA counters, _diag.h for generic device diagnostic counters, _adp_retx.h for ADP retransmit counters, _phy.h for physical-layer counters, _pci.h for 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_supported and instead exposes per-feature caps like doca_telemetry_pci_cap_management_info_is_supported / _cap_perf_counters_1_is_supported.

  • Opening a per-domain doca_telemetry_<domain> context on a doca_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/_start surface, not the generic doca_ctx_* progress-engine lifecycle.

  • Reading the device + library capability surface before assuming a counter family is available: use doca_telemetry_<domain>_cap_is_supported only for pcc, dpa, diag, adp_retx, and phy; use the matching per-feature doca_telemetry_pci_cap_*_is_supported query for PCI.

  • Handling per-domain DOCA_ERROR_* returns from a counter read (lifecycle vs. device-doesn't-support-this-domain vs. per-domain AGAIN-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.md when the user actually wants to PUBLISH / EXPORT the counter values (OTLP / Prometheus / labeled metrics); doca-log when 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_dev lifecycle, 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 a doca_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-library DOCA_ERROR_* set, with the NOT_SUPPORTED-means-domain- not-exposed-on-this-device rule and the AGAIN-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 against doca-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 a Deferred task verbs block 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

  1. 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 is doca-telemetry-exporter/SKILL.md; not deploy DTS, which is doca-dts; and not stand up a NetFlow / IPFIX collector, which this library does not expose a surface for).

  2. 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 the NOT_SUPPORTED-means-domain- not-exposed-on-this-device rule and the AGAIN-means- snapshot-not-ready rule), observability, the safety policy, and the path-selection rule, see the capabilities companion.

  3. 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".

  • doca-telemetry-exporter/SKILL.md — the publishing / export side. This skill (the per-domain hardware-counter reader) and doca-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 a doca_dev links 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 is https://docs.nvidia.com/doca/sdk/DOCA-Telemetry/index.html (distinct from the publisher's guide at https://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, a doca_dev is open and doca_telemetry_<domain>_cap_is_supported(devinfo) returns DOCA_SUCCESS for 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 canonical pkg-config + meson build pattern, the universal modify-a-shipped-sample first-app workflow, the universal lifecycle, the cross-library DOCA_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

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:

  1. 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-telemetry is what the user's application links to read hardware counters off a doca_dev; the publishing / export side is doca-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 any pkg-config mention or any code sketch.

  2. 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.

  3. 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, then doca_caps --version); do not assume "latest". Then call the matching per-domain capability query against the active doca_devinfo: doca_telemetry_<domain>_cap_is_supported(devinfo) for pcc / dpa / diag / adp_retx / phy. For phy, 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. For pci there 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 in CAPABILITIES.md ## Capabilities and modes, the queried value is the runtime authority, not the agent's memory. A DOCA_ERROR_NOT_SUPPORTED here is the answer (the device does not expose this domain), not a bug. Quote the values back to the user.

  4. Create the per-domain context on the doca_dev. Call doca_telemetry_<domain>_create(dev, &ctx) against the already-open doca_dev (for the PCC representor path, use doca_telemetry_pcc_rep_create(dev_rep, &ctx)). The doca_dev must already be open — opening it is the doca-common / device-discovery concern, not this skill's.

  5. 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); then doca_telemetry_diag_apply_config and select the counter IDs with doca_telemetry_diag_apply_counters_list_by_id BEFORE 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_units caps from step 3.

    • dpa: optionally _set_max_perf_event_samples before reading perf-event lists.

    • pcc / phy / pci: typically no pre-start setters — read directly after start. Before enabling adp_retx _set_hist_clear_on_read or diag data-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.

  6. Start the per-domain context. Call doca_telemetry_<domain>_start(ctx). Reads before start return DOCA_ERROR_BAD_STATE. For diag, start is only valid after _apply_config. If start fails, route through the error taxonomy in CAPABILITIES.md ## Error taxonomy before 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:

SlotValue for the readerWhy it matters
pkg-config module namedoca-telemetryThe 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 #includeThe per-domain header for the chosen domain: doca_telemetry_pcc.h / _dpa.h / _diag.h / _adp_retx.h / _phy.h / _pci.hEach 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 flagspkg-config --cflags doca-telemetryResolves to the telemetry headers on this install
Link flagspkg-config --libs doca-telemetryPulls 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 versionQuery with pkg-config --modversion doca-telemetry; never hardcode in build filesThe 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:

SlotWhat the agent asks the userReader-specific consideration
1. Starting sampleWhich 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 + countersWhich 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 behaviorHow 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 intentDoes 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 manifestKeep 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:

  1. Open the doca_dev and cap-query the domain on it. The reader's first job is to open the target device and confirm doca_telemetry_<domain>_cap_is_supported(devinfo) (or the pci per-feature caps) returns DOCA_SUCCESS. A DOCA_ERROR_NOT_SUPPORTED here means the device does not expose this domain — fix the device selection or the domain choice, not the read call.

  2. 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. A DOCA_ERROR_NOT_PERMITTED on 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.

  3. Create → (configure) → start → read once. Walk the per-domain lifecycle from ## configure: create on the doca_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 returns DOCA_SUCCESS and 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 ## configure step 5; otherwise leave clear-on-read disabled.

  4. Capture the structured log. Set DOCA_LOG_LEVEL=trace for the first run (see doca-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.

  5. Handle DOCA_ERROR_AGAIN with sample-window-aware retries, not a spin. AGAIN on a read means the snapshot / sample cycle is not ready yet. Retry after the documented sample window (for diag, after the previous sampling cycle completes — see the note on doca_telemetry_diag_query_counters), per CAPABILITIES.md ## Safety policy. A direct run gets at most two sample-window retries, with no mutation between them. If both produce the same AGAIN read outcome, stop the run and enter ## debug with both reads; do not add a third retry.

  6. Stop and destroy on teardown. Call doca_telemetry_<domain>_stop then doca_telemetry_<domain>_destroy in 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:

  1. Lifecycle smoke. Create the per-domain context on the doca_dev, _start, and confirm both succeed before any read. A DOCA_ERROR_BAD_STATE here means a lifecycle ordering bug (read before start, or — for diag — start before _apply_config); a DOCA_ERROR_NOT_PERMITTED means a privilege gap. Validates the lifecycle BEFORE chasing counter values.

  2. Capability re-check. Re-run the per-domain doca_telemetry_<domain>_cap_is_supported(devinfo) for pcc, dpa, diag, adp_retx, or phy (plus PHY per-sub-area caps), or the matching per-feature doca_telemetry_pci_cap_*_is_supported query for PCI. If the sub-area / counter family the user wants returns NOT_SUPPORTED, that is the answer for this device + install; update the domain / sub-area selection (or the device) before continuing.

  3. Single-read smoke. Issue ONE per-domain read and confirm it returns DOCA_SUCCESS with a populated output struct. If the read returns DOCA_ERROR_AGAIN, the snapshot is not ready — retry after the sample window, not in a tight loop. If it returns NOT_SUPPORTED, the sub-area is not exposed (back to step 2).

  4. 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.

  5. 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-window AGAIN that 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 ## modify slot 5).

  6. Under-load behavior. If the user reads under device load, confirm the read cadence still converges and that AGAIN frequency tracks the sample window rather than a stuck cycle.

Eval-loop overlay — why this is a loop, not a one-shot pass:

Iteration triggerWhat it looks likeWhat changes next iteration
DOCA_ERROR_NOT_SUPPORTED on cap-query or readThe device does not expose this domain / sub-area on this installRe-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 readRead before _start, or (diag) start before _apply_configFix the per-domain lifecycle ordering per ## configure; re-run the lifecycle smoke
DOCA_ERROR_AGAIN on readSnapshot / sample cycle not ready yetRetry 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 readA sample / histogram value past the install's cap, or an undersized output bufferRe-read the _cap_get_* sizing query and size the value / buffer to it
Same code reads on device A, returns NOT_SUPPORTED on device BDifferent device family / firmware feature bits, or different DOCA versionRe-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.md via the role-split table in CAPABILITIES.md ## Capabilities and modes, not to debug the reader further.

  • Walk the cap-query rule: a DOCA_ERROR_NOT_SUPPORTED on 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 per CAPABILITIES.md ## Capabilities and modes.

  • Walk the privilege state: a DOCA_ERROR_NOT_PERMITTED on create / start / read means the running user lacks privilege for this specific counter domain — grant it on the env side, resist reflexive global sudo.

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 returns DOCA_ERROR_BAD_STATE. The most common case is reading before _start, or reading diag before _apply_config.

  • Sample-window discipline: a DOCA_ERROR_AGAIN on 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_counters must 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_VALUE on 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-config wiring — defer to doca-setup/SKILL.md and 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 a doca_dev is 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.md for 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.md for publishing, or to doca-dts for 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_FAILED or persistent NOT_SUPPORTED), the fix is via the env-side skill: doca-setup ## debug (doca-setup/TASKS.md#debug) layer 5, then upstream documentation reachable through doca-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:

  1. Probe for the matching structured helper FIRST (doca-env --json for version + devices + libraries + drivers + hugepages in one shot; doca-capability-snapshot for per-device capability flags; version-matrix.json for “available since” lookups).

  2. 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>”.

  3. If the probe fails, fall back to the manual command in the row. Report “falling back to manual chain”.

  4. 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 by doca-version/SKILL.md.

Command (worked example)Owning stepClass of question it answersWhat healthy output looks like
pkg-config --modversion doca-telemetry## configure step 3; ## build slotWhat 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## buildWhat 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 1Which 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 2What is the runtime DOCA version?A semver string matching pkg-config --modversion doca-telemetry
id## run step 2Does 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 1What 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 7What 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 4What 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