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://mp-staging.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
CAPABILITIES.md
DOCA Telemetry capabilities, version overlay, errors, observability, safety
Where to start: Pick the H2 anchor that matches your question (reader-vs-exporter split / per-domain sub-libraries / per-domain lifecycle / capability discovery / path selection / version / errors / observability / safety) and read that section end-to-end. The tables in each section are the load-bearing content; the prose around them is interpretation.
This library is the per-domain hardware-counter READER half
of DOCA telemetry. It is not a NetFlow / IPFIX / local-socket
collector framework, and there is no schema-registration /
event-transport / publisher-consumer surface in the public
header. Each domain ships its own small doca_telemetry_<domain>_*
C API: a capability query on a doca_devinfo, a context created
on a doca_dev, a per-domain _start, per-domain read / sample
calls, then _stop / _destroy. The publishing / export side is
the sibling doca-telemetry-exporter/SKILL.md
library — a separate skill.
Read this file when the loader sent you here from
SKILL.md. For the how of executing each pattern
(the verbs configure / build / modify / run / test / debug),
jump to TASKS.md. For the canonical DOCA
version-handling rules that this skill layers a per-domain
overlay on top of, see doca-version/SKILL.md.
Pattern overview
Every hardware-counter-reader question this skill teaches resolves into one of SIX patterns. The patterns are CLASSES — they apply across every DOCA release and every per-domain reader sub-library, not just the worked examples shown.
| Pattern | When it applies (class shape) | Where the substance lives |
|---|---|---|
| 1. Pick the reader, not the exporter | The application wants to read hardware counters off a doca_dev; the publishing / export side is a separate library out of this skill's scope | ## Capabilities and modes role-split table |
| 2. Pick the right per-domain sub-library | The counters the user cares about live in exactly one of the six domains (pcc / dpa / diag / adp_retx / phy / pci); each is a separate header + context type | ## Capabilities and modes sub-library table |
| 3. Cap-query the domain BEFORE creating the context | doca_telemetry_<domain>_cap_is_supported(devinfo) (or, for pci, the per-feature _cap_*_is_supported) is the runtime authority for whether this device exposes this domain on this install | ## Capabilities and modes capability-query rule + TASKS.md ## configure step 3 |
| 4. Stand up the per-domain context + read loop | Per-domain lifecycle: cap-query → _create(doca_dev) → per-domain configure setters → _start → per-domain read / sample → _stop → _destroy | ## Capabilities and modes lifecycle table + TASKS.md ## configure |
| 5. Respect the per-domain sample window | A read may return DOCA_ERROR_AGAIN (snapshot / sample cycle not ready yet); the diag domain explicitly requires the previous sampling cycle to finish before the next read | ## Safety policy sample-window rule + ## Error taxonomy AGAIN row |
| 6. Diagnose a per-domain reader error | Map symptom (BAD_STATE, INVALID_VALUE, AGAIN, NOT_PERMITTED, NOT_SUPPORTED, IO_FAILED) to root cause; in particular recognise NOT_SUPPORTED as "this device does not expose this counter domain" rather than a library bug | ## Error taxonomy + TASKS.md ## debug |
Two cross-cutting rules that apply to every pattern above:
The reader reads; the exporter publishes.
doca-telemetryis the library the user's application links to read hardware counters off adoca_dev. The application-side publishing of labeled metrics / OTLP logs isdoca-telemetry-exporter/SKILL.md, a sibling library with its own skill. Wiring the exporter's API into a reader application (or this library's API into a publishing application) is the load-bearing first-app failure and the agent must surface the distinction BEFORE any code-level guidance.Cap-query is the only authority for "is this domain supported here". Each domain's support is bound to BOTH the DOCA version AND the active
doca_devinfo. Never assert a domain or counter family is available from memory; thedoca_telemetry_<domain>_cap_is_supported(devinfo)query (or thepciper-feature caps) is the runtime authority.
Capabilities and modes
DOCA Telemetry exposes six independent per-domain reader
sub-libraries. Each is its own header, its own opaque context
type, and its own doca_telemetry_<domain>_* symbol family.
There is no single shared "telemetry context" object and no DOCA
Core progress-engine / task surface here — each domain owns its
own _create / _start / read / _stop / _destroy lifecycle
directly on a doca_dev.
Role split — reader (this library) vs exporter (publisher). The two halves of DOCA telemetry are separate libraries, and the confusion between them is the #1 first-app failure.
| Side | What it does | What it does NOT do | Where it lives |
|---|---|---|---|
Reader (this library, doca-telemetry) | Reads hardware counters off a doca_dev through one of the six per-domain contexts: PCC / DPA / DIAG / ADP-RETX / PHY / PCI counter snapshots | Publish / export counter values to a monitoring pipeline; define a schema; bind a socket / port; consume events from another process | Linked INTO the user's application; reads the local device through the per-domain C API |
Exporter (sibling library, doca-telemetry-exporter) | Application-side publishing of labeled metrics / structured telemetry / OTLP logs | Read hardware counters off a device | A separate library with its own skill at doca-telemetry-exporter/SKILL.md. Wiring its API into a reader application is the load-bearing first-app failure this skill exists to prevent |
Per-domain sub-libraries. The public surface is exactly
these six. The agent must not invent a seventh, and must not
invent a generic "telemetry collector" context. Exact symbol
names are install-bound — confirm against the user's installed
headers under $(pkg-config --variable=includedir doca-common)
per the headers-win-over-docs rule in
doca-version/SKILL.md.
| Header | Domain | Counter family it reads | Per-domain cap query |
|---|---|---|---|
doca_telemetry_pcc.h | Programmable Congestion Control | Per-algo-slot info + the PCC counter set (doca_telemetry_pcc_get_counters / _get_and_clear_counters, _get_num_counters, _get_counter_info, _get_algo_*) plus PCC histogram reads (doca_telemetry_pcc_get_histo_bins, _get_and_clear_histo_bins, _get_histo_desc, _get_histo_edge_info, _get_histo_edges, _get_histo_enable_status, _get_histo_ids_per_slot, _get_max_algo_slots, _get_max_histo_bins, _get_max_histo_desc_len, _get_max_histo_edges, _get_max_histo_per_slot, _get_max_num_counters) | doca_telemetry_pcc_cap_is_supported(devinfo) (plus doca_telemetry_pcc_cap_histo_is_supported(pcc) for the histogram area, _cap_rep_is_supported for the representor path and _cap_get_max_* sizing caps) |
doca_telemetry_dpa.h | DPA | DPA process / thread lists, cumulative info, perf-event samples, per-counter start/restart/stop (doca_telemetry_dpa_read_processes_list, _read_thread_list, _read_cumul_info_list, _read_perf_event_list, _counter_start/_counter_restart/_counter_stop) | doca_telemetry_dpa_cap_is_supported(devinfo) |
doca_telemetry_diag.h | Device diagnostic counters | Sampled diagnostic-counter data in one of three formats (doca_telemetry_diag_query_counters after _apply_config + _apply_counters_list_by_id + _start), with sample-mode / sample-period / num-samples setters | doca_telemetry_diag_cap_is_supported(devinfo) (plus _cap_get_max_num_data_ids, _cap_get_log_max_num_samples, _cap_is_data_clear_supported, _cap_is_sample_mode_supported) |
doca_telemetry_adp_retx.h | Adaptive-retransmit histogram | Configurable retransmit-latency histogram (bin widths, time unit, vHCA id, clear-on-read) read off the device | doca_telemetry_adp_retx_cap_is_supported(devinfo) (plus _cap_histogram_is_supported, _cap_get_hist_max_bins, _cap_get_hist_time_units) |
doca_telemetry_phy.h | Physical layer | Operation info, supported info, troubleshooting info, system temp/power info, module info, counter-and-BER info, FEC histogram, management-cable info (doca_telemetry_phy_get_*_info including _get_supported_info, _get_troubleshooting_info, _get_system_temp_and_pwr_info, _get_fec_histogram_info, _get_management_cable_ddm_info, _get_management_cable_dump_info, _get_management_cable_single_page_info) | doca_telemetry_phy_cap_is_supported(devinfo) plus per-sub-area caps doca_telemetry_phy_cap_operation_info_is_supported, _cap_counter_and_ber_info_is_supported, _cap_fec_histogram_info_is_supported, _cap_module_info_is_supported, _cap_management_cable_is_supported, _cap_supported_info_is_supported, _cap_system_temp_and_pwr_info_is_supported, _cap_troubleshooting_info_is_supported (query the specific sub-area you intend to read) |
doca_telemetry_pci.h | PCI / PCIe | Management info, perf-counters set 1, latency histogram (doca_telemetry_pci_read_management_info, _read_perf_counters_1, _read_latency_histogram, plus _by_pci_addr variants and doca_telemetry_pci_get_latency_histogram_dimensions_by_pci_addr) | 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 (plus finer per-counter variants like _cap_perf_counters_1_fec_error_is_supported) |
Per-domain lifecycle. Every domain follows the same shape;
the verbs are domain-specific (doca_telemetry_<domain>_*), not
the generic DOCA Core doca_ctx_* surface:
| Step | Call (phy shown; substitute the domain) | Notes |
|---|---|---|
| 0. Cap-query | doca_telemetry_phy_cap_is_supported(devinfo) | Runtime authority for "this device exposes this domain". For pci, query the per-feature _cap_*_is_supported instead. Returns DOCA_ERROR_NOT_SUPPORTED when the device does not expose the domain — that is the answer, not a bug |
| 1. Create | doca_telemetry_phy_create(struct doca_dev *dev, struct doca_telemetry_phy **phy) | Creates the per-domain context bound to an already-open doca_dev. pcc additionally offers doca_telemetry_pcc_rep_create(struct doca_dev_rep *, …) for the representor path |
| 2. Configure | domain setters (e.g. doca_telemetry_diag_set_sample_mode / _set_sample_period; doca_telemetry_adp_retx_set_hist_num_bins; doca_telemetry_dpa_set_max_perf_event_samples) | Domain-specific knobs only — there is no transport / socket / schema to configure. diag requires doca_telemetry_diag_apply_config (and _apply_counters_list_by_id) before start |
| 3. Start | doca_telemetry_phy_start(phy) | Reads before start return DOCA_ERROR_BAD_STATE |
| 4. Read | doca_telemetry_phy_get_counter_and_ber_info(...) etc. | Per-domain read / sample calls. diag reads via doca_telemetry_diag_query_counters; pci via the _read_* calls; dpa via the _read_*_list calls |
| 5. Stop / destroy | doca_telemetry_phy_stop(phy) then doca_telemetry_phy_destroy(phy) | Out-of-order calls return DOCA_ERROR_BAD_STATE |
Capability discovery — the only rule. Before assuming a
domain (or, for phy / pci, a sub-area / feature) is on this
install + this device, call the matching
doca_telemetry_<domain>_cap_is_supported(devinfo) query (per
the cross-cutting cap-query rule in
doca-version CAPABILITIES.md ## Observability (doca-version/CAPABILITIES.md#observability)).
The query is the runtime authority. Asserting "this device
supports PHY FEC histograms" from memory without the cap query
is the silent-fail case — when the device does not expose it,
the read returns DOCA_ERROR_NOT_SUPPORTED and the user has no
idea why. The agent MUST quote the queried values back to the
user. doca_telemetry_pci has no single domain-level cap;
query its per-feature _cap_*_is_supported functions for the
specific PCI counter family you intend to read.
Path selection — reader vs the adjacent options. The reader
is for reading DOCA hardware counters off a doca_dev. It is not
the answer for every "telemetry" question; walk this rule before
recommending reader setup.
| Use DOCA Telemetry (this skill) when … | Use a different primitive when … |
|---|---|
The user is reading hardware counters (PCC / DPA / DIAG / ADP-RETX / PHY / PCI) off a doca_dev from inside their own application | The user wants to PUBLISH / EXPORT counter values to a monitoring pipeline (OTLP / Prometheus / labeled metrics) — that is doca-telemetry-exporter/SKILL.md, the sibling publisher library |
| The user needs the structured per-domain counter snapshot the device exposes through the public per-domain C API | The user wants plain structured stdout / per-line logging from their own program — use doca-log; the per-domain cap-query discipline is overhead they do not need |
| The user is consuming the device's own hardware counters | The user wants a turnkey, deployed aggregation service across a fleet — that is the DOCA Telemetry Service (DTS), owned by doca-dts (see doca-public-knowledge-map/SKILL.md non-goals); or a generic NetFlow / IPFIX / Prometheus collector outside the DOCA family |
Version compatibility
For the canonical DOCA version-detection chain, the four-way
match rule, NGC container semantics, and the headers-win-over-docs
rule, see doca-version/SKILL.md. The body
lives there; this skill does not duplicate it.
The per-domain reader overlay is:
Use
pkg-config --modversion doca-telemetryas the build-time anchor. Perdoca-version TASKS.md ## configure(doca-version/TASKS.md#configure), this MUST match the other version sources in the four-way match. The set of domains — and the per-counter / per-sub-area surface each domain exposes — is bound to BOTH the DOCA version AND the activedoca_devinfo; agent-memory limits are not authoritative and MUST be replaced with adoca_telemetry_<domain>_cap_is_supportedquery at runtime.The reader is distinct from the exporter across every release. When the user reports "I'm reading guides about doca-telemetry-exporter — is that this library?", the answer is no: that is the publishing side, with its own skill at
doca-telemetry-exporter/SKILL.md. The two.pcfiles coexist on a normal install; using the wrong one for the user's intent is the load-bearing first-app failure and the agent must walk the role split (per## Capabilities and modes) BEFORE picking apkg-configmodule.doca-telemetry.pcplusdoca-common.pcmust both matchdoca_caps --versionat the four-way-match check (perdoca-version CAPABILITIES.md ## Version compatibility(doca-version/CAPABILITIES.md#version-compatibility)). A common partial-install pattern after a DOCA upgrade is thatdoca-telemetry.pclingers from the previous release whiledoca-common.pcwas refreshed; route todoca-version TASKS.md ## debug(doca-version/TASKS.md#debug) ladder step 2 before any reader-layer diagnosis.New per-domain counters / sub-areas and public API functions/constants appear across releases. A counter family, PHY sub-area, or API function/constant present on a newer DOCA may be absent on the user's install; the per-domain cap-query is the only safe way to discover what this install exposes. Never hardcode the available counter set, API surface, or constants in a build file or assume them from a docs page. DOCA 3.5 added PCC histogram query functions, PCI by-address read functions, PHY capability/get functions, and PHY firmware/management constants.
Error taxonomy
Per-domain-reader overlays on the cross-library DOCA_ERROR_*
taxonomy. The cross-library taxonomy itself lives in
doca-programming-guide CAPABILITIES.md ## Error taxonomy (doca-programming-guide/CAPABILITIES.md#error-taxonomy);
the rows below are the reader surface meaning the agent must
disambiguate before falling back to the cross-library response.
| Error | Reader context where it shows up | Reader-specific cause |
|---|---|---|
DOCA_ERROR_NOT_SUPPORTED | doca_telemetry_<domain>_cap_is_supported(devinfo); first read on a domain whose cap was not checked | This device does not expose this counter domain (or, for phy / pci, this sub-area / feature). Typical for dpa on non-DPA-shipped devices, or phy / pcc sub-areas gated on firmware feature bits. This is the cap-query answer, NOT a library bug — do not retry, surface it to the user |
DOCA_ERROR_BAD_STATE | Read call before doca_telemetry_<domain>_start; setter after start where the domain does not allow late reconfig; (diag) read before _apply_config | Lifecycle violation. Walk the per-domain lifecycle in ## Capabilities and modes; the most common case is reading before _start, or (diag) reading before _apply_config + _start |
DOCA_ERROR_AGAIN | A per-domain read / sample call (notably diag and the sampled domains) | The hardware-counter snapshot / sample cycle is not ready yet. The correct response is to retry after the documented sample window (for diag, after the previous sampling cycle completes — see the explicit note on doca_telemetry_diag_query_counters), NOT to spin in a tight loop. See ## Safety policy sample-window rule |
DOCA_ERROR_INVALID_VALUE | A read into an undersized output buffer; a setter passed an out-of-range value (e.g. diag log-num-samples beyond the cap, adp_retx bin count beyond _cap_get_hist_max_bins) | A size / range mismatch against the install's caps. Re-read the relevant _cap_get_* sizing query and size the buffer / value to it; do not widen blindly |
DOCA_ERROR_NOT_PERMITTED | Context create / start; a privileged counter read | The running user lacks the privilege the device requires for this counter domain (some diagnostic / PHY counters require elevated access). Walk the ## Safety policy permission row; this is endpoint/privilege-specific, not a blanket "add sudo" |
DOCA_ERROR_IO_FAILED | Context create; read | The device / driver layer below DOCA reported failure (firmware query failed, device went away). Capture state and route to env-class debug (doca-setup TASKS.md ## debug (doca-setup/TASKS.md#debug)) — the layer below DOCA is the suspect, not the reader program |
The agent's rule: never recommend a retry loop on
DOCA_ERROR_* without first identifying which row above is the
cause. NOT_SUPPORTED is the cap answer (surface it, don't
retry); AGAIN wants a sample-window-aware retry, not a spin;
the others want investigation.
PHY firmware and management firmware error codes
DOCA 3.5 adds PHY-specific error-code constants that are not part of the cross-library DOCA_ERROR_* taxonomy. Treat them as domain-specific status codes, not as DOCA_ERROR_* values.
They come in two families, DOCA_TELEMETRY_PHY_FW_* (link-level
firmware status, e.g. link training or signal detection) and
DOCA_TELEMETRY_PHY_MNG_FW_* (module / cable management status),
plus DOCA_TELEMETRY_PHY_ERROR_CODE_CFG_REJECTED_INVALID_VS_SI.
Read the exact set from doca_telemetry_phy.h on the installed
release; do not list or hardcode them.
When a PHY read surfaces one of these constants, do not map it to the DOCA_ERROR_* rows above; surface the constant name and the PHY firmware/management firmware status it reports.
Observability
The reader's observability surface is the per-read return value
plus the per-domain cap snapshot. There is no progress-engine
completion stream and no external event transport — visibility
comes from inspecting each read's doca_error_t and the
configure-time cap-query results.
In DOCA 3.5 this surface extends to PCC histogram queries, PCI
latency/management/perf counter reads, and PHY
FEC/management/system/troubleshooting reads, plus the
corresponding PCC and PHY cap queries. These are all
doca_telemetry_<domain>_* read/query or
doca_telemetry_<domain>_cap_* calls and are covered by the
same two signals below.
Two primary signals the agent should reach for:
Per-read return. Every
doca_telemetry_<domain>_*read / query call returns adoca_error_t. Inspect it on every call: success means the snapshot was read into the output struct;DOCA_ERROR_AGAINmeans the snapshot / sample cycle is not ready (retry after the sample window per## Safety policy);DOCA_ERROR_NOT_SUPPORTEDmeans the device does not expose this domain / sub-area; any otherDOCA_ERROR_*maps to a row in## Error taxonomy.Capability snapshot at configure time. The output of every
doca_telemetry_<domain>_cap_*query is a snapshot of what this device exposes on this install before any read. Save it as the baseline; if a later read returnsDOCA_ERROR_NOT_SUPPORTEDorDOCA_ERROR_INVALID_VALUE, the diff against this snapshot is the bug, not the read call. Cap-query at configure time is the cheapest way to make a later capability-related error self-explanatory.
For the cross-cutting observability primitives
(--sdk-log-level, the doca-<lib>-trace build flavor, the
DOCA_LOG_LEVEL env var) see
doca-debug CAPABILITIES.md ## Observability (doca-debug/CAPABILITIES.md#observability).
For the install-tree observability (logger names, package
layout) defer to
doca-public-knowledge-map/SKILL.md.
Safety policy
Overlay on the bundle-wide hardware-safety meta-policy. The rules below are this skill's per-artifact overlay on the cross-cutting rules in
doca-hardware-safetyCAPABILITIES.md ## Safety policy (doca-hardware-safety/CAPABILITIES.md#safety-policy) (specifically ### Per-artifact overlay pattern (doca-hardware-safety/CAPABILITIES.md#per-artifact-overlay-pattern)). When the two layers disagree, the stricter wins; when either layer says STOP, the agent stops.
The reader's safety surface is cap-query-before-read + sample-window discipline + privilege for the specific counter domain. Each is the source of a specific first-app failure the agent must prevent.
| Prerequisite | Required state | How the agent verifies | Where to fix |
|---|---|---|---|
| Domain (and sub-area) cap-queried before read | doca_telemetry_<domain>_cap_is_supported(devinfo) (or the pci per-feature caps) returned DOCA_SUCCESS for the domain / sub-area the app will read | Code review at modify time; the read does not return DOCA_ERROR_NOT_SUPPORTED | Add the cap-query before the read. A read that assumes a domain the device does not expose is the canonical "NOT_SUPPORTED out of nowhere" failure |
| Sample-window discipline on reads | The read loop retries on DOCA_ERROR_AGAIN only after the documented sample window; for diag, the next _query_counters waits for the previous sampling cycle to finish | Structured log shows spaced retries, not a tight spin; the diag read is not called mid-cycle | Space the retry to the sample period (doca_telemetry_diag_set_sample_period for diag); a tight AGAIN spin wastes CPU and never converges faster than the hardware sample window |
| Running user has privilege for the counter domain | Some diagnostic / PHY / PCI counters require elevated device access; the running user has it | id; the create / start / read does not return DOCA_ERROR_NOT_PERMITTED | This is privilege for the specific counter domain, not a blanket sudo. Fix via the env-side privilege grant (route to doca-setup TASKS.md ## configure (doca-setup/TASKS.md#configure)) rather than running the whole app as root reflexively |
The reader is read-only. Do not invent a
_publish()/_emit()/_register_schema()shape on any per-domain context; the per-domain API reads the device's counters and nothing more. If the user wants their app to ALSO publish the values it read to a monitoring pipeline, that requires a SEPARATEdoca-telemetry-exporter/SKILL.mdcontext inside the same application — not a method on the reader context.Cap-query before every domain you read. Each of the six domains is independently gated on the device + install. A device that exposes PHY counters may not expose DPA counters; query each domain you intend to read.
adp_retx/diagclear-on-read is destructive to the counter state. Whenset_hist_clear_on_read/data_clearis enabled, reading resets the underlying counters. Surface this to the user before enabling it — a second reader (or a later read) sees the counters as they stand after the reset, not the cumulative total.
Deferred topic boundaries
This skill scopes itself to the DOCA Telemetry per-domain hardware-counter reader libraries. Adjacent topics the agent will get asked but should route elsewhere:
The publishing / export side —
doca-telemetry-exporter/SKILL.mdis the sibling skill for the application-side publisher library. This skill is reader-side only; any "how do I emit / publish a counter value" question routes there.The DOCA Telemetry Service (DTS) — operating / deploying the service itself — owned by
doca-dts.NetFlow / IPFIX / local-socket collector frameworks — the per-domain reader libraries do NOT expose a collector / schema-transport surface. Route any such question to a generic collector outside the DOCA family, to
doca-telemetry-exporter/SKILL.mdfor publishing, or todoca-dtsfor productized aggregation.DOCA Core context internals — owned by
doca-programming-guide/SKILL.md. Note the per-domain reader does NOT use the genericdoca_ctx_*/ progress-engine surface; it uses per-domain_create/_start/_stop/_destroydirectly.Plain structured logging from the reader's own program — use
doca-log; the per-domain cap-query discipline is overhead the user does not need for plain logs.Cross-cutting
DOCA_ERROR_*taxonomy — owned bydoca-programming-guide CAPABILITIES.md ## Error taxonomy(doca-programming-guide/CAPABILITIES.md#error-taxonomy). This skill adds the reader overlay (theNOT_SUPPORTED-means-domain-not-exposed rule and theAGAIN-means-snapshot-not-ready rule), not the taxonomy itself.Cross-cutting debug ladder (install / version / build / link / runtime / program / driver) — owned by
doca-debug ## debug(doca-debug/TASKS.md#debug). This skill's## debugoverlays the runtime + program layers.
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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download doca-telemetry.zip