Kubernetes endpoints
Query Kubernetes node metrics
POST
/
api
/
v2
/
kubernetes
/
nodes
Query Kubernetes node metrics
curl --request POST \
--url https://appsignal.com/api/v2/kubernetes/nodes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"site_id": "abc123",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-01T01:00:00Z",
"node_name": "node-1"
}
'import requests
url = "https://appsignal.com/api/v2/kubernetes/nodes"
payload = {
"site_id": "abc123",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-01T01:00:00Z",
"node_name": "node-1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
site_id: 'abc123',
from: '2024-01-01T00:00:00Z',
to: '2024-01-01T01:00:00Z',
node_name: 'node-1'
})
};
fetch('https://appsignal.com/api/v2/kubernetes/nodes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://appsignal.com/api/v2/kubernetes/nodes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'site_id' => 'abc123',
'from' => '2024-01-01T00:00:00Z',
'to' => '2024-01-01T01:00:00Z',
'node_name' => 'node-1'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://appsignal.com/api/v2/kubernetes/nodes"
payload := strings.NewReader("{\n \"site_id\": \"abc123\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-01T01:00:00Z\",\n \"node_name\": \"node-1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://appsignal.com/api/v2/kubernetes/nodes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"site_id\": \"abc123\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-01T01:00:00Z\",\n \"node_name\": \"node-1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/kubernetes/nodes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"site_id\": \"abc123\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-01T01:00:00Z\",\n \"node_name\": \"node-1\"\n}"
response = http.request(request)
puts response.read_body[
{
"timestamp": "2023-11-07T05:31:56Z",
"node_name": "<string>",
"cpu_usage_nano_cores": 123,
"memory_rss_bytes": 123,
"memory_usage_bytes": 123,
"memory_working_set_bytes": 123,
"memory_page_faults": 123,
"memory_major_page_faults": 123,
"fs_used_bytes": 123,
"fs_available_bytes": 123,
"fs_capacity_bytes": 123,
"fs_inodes_free": 123,
"fs_inodes_used": 123,
"fs_inodes": 123,
"network_rx_bytes": 123,
"network_tx_bytes": 123,
"phase": 1
}
]{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}For authentication and the other Kubernetes endpoints, see the Public API (V2) overview.
Authorizations
bearer_authtoken_query
Authorization: Bearer <token>
Body
application/json
Query for fetching Kubernetes node metrics.
Response
One row per node, ordered by node name.
Timestamp of the metrics snapshot.
Name of the Kubernetes node.
CPU usage in nanocores.
Resident set size (RSS) memory in bytes.
Total memory usage in bytes.
Working set memory in bytes.
Number of page faults.
Number of major page faults.
Filesystem space used in bytes.
Filesystem space available in bytes.
Total filesystem capacity in bytes.
Number of free filesystem inodes.
Number of used filesystem inodes.
Total number of filesystem inodes.
Network bytes received.
Network bytes transmitted.
Node phase as a numeric value.
Required range:
x >= 0Was this page helpful?
⌘I
Query Kubernetes node metrics
curl --request POST \
--url https://appsignal.com/api/v2/kubernetes/nodes \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"site_id": "abc123",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-01T01:00:00Z",
"node_name": "node-1"
}
'import requests
url = "https://appsignal.com/api/v2/kubernetes/nodes"
payload = {
"site_id": "abc123",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-01T01:00:00Z",
"node_name": "node-1"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
site_id: 'abc123',
from: '2024-01-01T00:00:00Z',
to: '2024-01-01T01:00:00Z',
node_name: 'node-1'
})
};
fetch('https://appsignal.com/api/v2/kubernetes/nodes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://appsignal.com/api/v2/kubernetes/nodes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'site_id' => 'abc123',
'from' => '2024-01-01T00:00:00Z',
'to' => '2024-01-01T01:00:00Z',
'node_name' => 'node-1'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://appsignal.com/api/v2/kubernetes/nodes"
payload := strings.NewReader("{\n \"site_id\": \"abc123\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-01T01:00:00Z\",\n \"node_name\": \"node-1\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://appsignal.com/api/v2/kubernetes/nodes")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"site_id\": \"abc123\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-01T01:00:00Z\",\n \"node_name\": \"node-1\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/kubernetes/nodes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"site_id\": \"abc123\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-01T01:00:00Z\",\n \"node_name\": \"node-1\"\n}"
response = http.request(request)
puts response.read_body[
{
"timestamp": "2023-11-07T05:31:56Z",
"node_name": "<string>",
"cpu_usage_nano_cores": 123,
"memory_rss_bytes": 123,
"memory_usage_bytes": 123,
"memory_working_set_bytes": 123,
"memory_page_faults": 123,
"memory_major_page_faults": 123,
"fs_used_bytes": 123,
"fs_available_bytes": 123,
"fs_capacity_bytes": 123,
"fs_inodes_free": 123,
"fs_inodes_used": 123,
"fs_inodes": 123,
"network_rx_bytes": 123,
"network_tx_bytes": 123,
"phase": 1
}
]{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}