Sync metric config
curl --request GET \
--url https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config', 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://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"version": 123,
"vector_config": "<string>",
"metrics": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"namespace": "<string>",
"description": "<string>",
"enabled": true,
"source_field": "<string>",
"filter": {
"field": "<string>",
"value": "<string>",
"conditions": "<array>"
},
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"counter_opts": {
"increment_by": "<string>"
},
"gauge_opts": {
"value_field": "<string>"
},
"histogram_opts": {
"value_field": "<string>",
"buckets": [
123
]
},
"cardinality": {
"max_tag_cardinality": 1000,
"on_limit_exceeded": "drop"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"has_update": true
}{
"error": "<string>",
"message": "<string>"
}Edge API
Sync Config
Edge agents poll this endpoint to get their metric extraction config. Returns empty response if agent is up to date.
GET
/
api
/
v1
/
edge
/
agents
/
{agentId}
/
metric-config
Sync metric config
curl --request GET \
--url https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config', 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://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.logfleet.io/api/v1/edge/agents/{agentId}/metric-config")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"version": 123,
"vector_config": "<string>",
"metrics": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"config_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"namespace": "<string>",
"description": "<string>",
"enabled": true,
"source_field": "<string>",
"filter": {
"field": "<string>",
"value": "<string>",
"conditions": "<array>"
},
"tags": [
{
"name": "<string>",
"value": "<string>"
}
],
"counter_opts": {
"increment_by": "<string>"
},
"gauge_opts": {
"value_field": "<string>"
},
"histogram_opts": {
"value_field": "<string>",
"buckets": [
123
]
},
"cardinality": {
"max_tag_cardinality": 1000,
"on_limit_exceeded": "drop"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"has_update": true
}{
"error": "<string>",
"message": "<string>"
}Fetches the latest metric extraction configuration for this agent. Called periodically (every 60 seconds) to pick up configuration changes.
The response includes all active metric configurations that should be applied by the agent.
Authorizations
API key for edge agents
Path Parameters
Agent ID (for edge API)
Query Parameters
Current config version on agent
Required range:
x >= 0⌘I