Documentation for automated readers
A curated documentation index is available at: https://grafana.com/llms.txt
A complete documentation index is available at: https://grafana.com/llms-full.txt
These indexes can help with page discovery before fetching individual documents.
This page is also available in Markdown, which may be easier for automated readers and AI tools to parse than HTML. The Markdown version is available at https://grafana.com/docs/k6/latest/javascript-api/k6-x-icmp/ping-detail.md, or by sending Accept: text/markdown to https://grafana.com/docs/k6/latest/javascript-api/k6-x-icmp/ping-detail/. For broader documentation discovery, the curated index is available at https://grafana.com/llms.txt and the complete index is available at https://grafana.com/llms-full.txt.
PingDetail
Data you receive as a parameter in the ping callback.
Properties
| Property | Type | Description |
|---|---|---|
| alive | boolean | Indicates whether the target is reachable (if an echo reply was received). |
| target | string | Hostname or IP address that was pinged. |
| target_ip | string | Target IP address that was pinged. |
| target_ip_version | IP | Target IP version that was used for the ping request. Valid values are "ip4" and "ip6". |
| sent_at | number | Timestamp when the request was sent. Value is in UTC milliseconds since the Unix epoch. |
| received_at | number | Timestamp when the response was received. Value is in UTC milliseconds since the Unix epoch. |
| ttl | number | Time to live from the echo reply, if a response was received. |
| id | number | Identifier for the ICMP session from the echo reply, if a response was received. |
| seq | number | Sequence number for the ICMP echo request from the echo reply, if a response was received. |
| size | number | Size of the ICMP echo reply, if a response was received. |
| options | PingOptions | Ping options used for the request. |
PingCallback
Callback function for ping results. This function is called for every echo packet sent. If the deadline is exceeded, it is not called for the remaining packets. If the echo response has been received, the error value will be null, otherwise it contains the error.
Signature
(err, data) => voidParameters
| Parameter | Type | Description |
|---|---|---|
| err | Error | null | Error object if an error occurred, otherwise null. |
| data | PingDetail | Data about the ping attempt, including timing and echo details. |
Was this page helpful?
Related resources from Grafana Labs

