Query in-cluster Loki log histogram
curl --request POST \
--url https://api.ravion.com/logs/eks-loki/histogram \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endTime": "<string>",
"startTime": "<string>",
"deploymentResourceId": "<string>",
"environmentId": "<string>",
"logSourceKeys": [
"<string>"
],
"moduleInstanceIds": [
"<string>"
],
"periodSeconds": 123
}
'import requests
url = "https://api.ravion.com/logs/eks-loki/histogram"
payload = {
"endTime": "<string>",
"startTime": "<string>",
"deploymentResourceId": "<string>",
"environmentId": "<string>",
"logSourceKeys": ["<string>"],
"moduleInstanceIds": ["<string>"],
"periodSeconds": 123
}
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({
endTime: '<string>',
startTime: '<string>',
deploymentResourceId: '<string>',
environmentId: '<string>',
logSourceKeys: ['<string>'],
moduleInstanceIds: ['<string>'],
periodSeconds: 123
})
};
fetch('https://api.ravion.com/logs/eks-loki/histogram', 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.ravion.com/logs/eks-loki/histogram",
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([
'endTime' => '<string>',
'startTime' => '<string>',
'deploymentResourceId' => '<string>',
'environmentId' => '<string>',
'logSourceKeys' => [
'<string>'
],
'moduleInstanceIds' => [
'<string>'
],
'periodSeconds' => 123
]),
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://api.ravion.com/logs/eks-loki/histogram"
payload := strings.NewReader("{\n \"endTime\": \"<string>\",\n \"startTime\": \"<string>\",\n \"deploymentResourceId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"logSourceKeys\": [\n \"<string>\"\n ],\n \"moduleInstanceIds\": [\n \"<string>\"\n ],\n \"periodSeconds\": 123\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://api.ravion.com/logs/eks-loki/histogram")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endTime\": \"<string>\",\n \"startTime\": \"<string>\",\n \"deploymentResourceId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"logSourceKeys\": [\n \"<string>\"\n ],\n \"moduleInstanceIds\": [\n \"<string>\"\n ],\n \"periodSeconds\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/logs/eks-loki/histogram")
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 \"endTime\": \"<string>\",\n \"startTime\": \"<string>\",\n \"deploymentResourceId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"logSourceKeys\": [\n \"<string>\"\n ],\n \"moduleInstanceIds\": [\n \"<string>\"\n ],\n \"periodSeconds\": 123\n}"
response = http.request(request)
puts response.read_body{
"histogram": [
{
"bucketStartMs": 123,
"counts": {
"debug": 123,
"error": 123,
"info": 123,
"warn": 123
}
}
],
"missedSources": [
"<string>"
],
"offlineClusters": [
"<string>"
],
"partial": true,
"periodSeconds": 123
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}EksLoki
Query in-cluster Loki log histogram
Compute the per-level histogram for the same scope, window and filter as the row query. POST /logs/eks-loki/histogram in the Ravion API reference.
POST
/
logs
/
eks-loki
/
histogram
Query in-cluster Loki log histogram
curl --request POST \
--url https://api.ravion.com/logs/eks-loki/histogram \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endTime": "<string>",
"startTime": "<string>",
"deploymentResourceId": "<string>",
"environmentId": "<string>",
"logSourceKeys": [
"<string>"
],
"moduleInstanceIds": [
"<string>"
],
"periodSeconds": 123
}
'import requests
url = "https://api.ravion.com/logs/eks-loki/histogram"
payload = {
"endTime": "<string>",
"startTime": "<string>",
"deploymentResourceId": "<string>",
"environmentId": "<string>",
"logSourceKeys": ["<string>"],
"moduleInstanceIds": ["<string>"],
"periodSeconds": 123
}
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({
endTime: '<string>',
startTime: '<string>',
deploymentResourceId: '<string>',
environmentId: '<string>',
logSourceKeys: ['<string>'],
moduleInstanceIds: ['<string>'],
periodSeconds: 123
})
};
fetch('https://api.ravion.com/logs/eks-loki/histogram', 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.ravion.com/logs/eks-loki/histogram",
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([
'endTime' => '<string>',
'startTime' => '<string>',
'deploymentResourceId' => '<string>',
'environmentId' => '<string>',
'logSourceKeys' => [
'<string>'
],
'moduleInstanceIds' => [
'<string>'
],
'periodSeconds' => 123
]),
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://api.ravion.com/logs/eks-loki/histogram"
payload := strings.NewReader("{\n \"endTime\": \"<string>\",\n \"startTime\": \"<string>\",\n \"deploymentResourceId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"logSourceKeys\": [\n \"<string>\"\n ],\n \"moduleInstanceIds\": [\n \"<string>\"\n ],\n \"periodSeconds\": 123\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://api.ravion.com/logs/eks-loki/histogram")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endTime\": \"<string>\",\n \"startTime\": \"<string>\",\n \"deploymentResourceId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"logSourceKeys\": [\n \"<string>\"\n ],\n \"moduleInstanceIds\": [\n \"<string>\"\n ],\n \"periodSeconds\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ravion.com/logs/eks-loki/histogram")
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 \"endTime\": \"<string>\",\n \"startTime\": \"<string>\",\n \"deploymentResourceId\": \"<string>\",\n \"environmentId\": \"<string>\",\n \"logSourceKeys\": [\n \"<string>\"\n ],\n \"moduleInstanceIds\": [\n \"<string>\"\n ],\n \"periodSeconds\": 123\n}"
response = http.request(request)
puts response.read_body{
"histogram": [
{
"bucketStartMs": 123,
"counts": {
"debug": 123,
"error": 123,
"info": 123,
"warn": 123
}
}
],
"missedSources": [
"<string>"
],
"offlineClusters": [
"<string>"
],
"partial": true,
"periodSeconds": 123
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}{
"code": "<string>",
"message": "<string>",
"action": {
"label": "<string>",
"url": "<string>"
},
"description": "<string>",
"details": [
{
"render": "<string>",
"title": "<string>",
"items": [
"<string>"
],
"object": {}
}
],
"isInternal": true,
"metadata": {},
"requestId": "<string>"
}Body
application/json
Request body for the full-window per-level histogram. Same scope, window and filter as the row query; no paging.
Inclusive end of the query window (ISO 8601).
Inclusive start of the query window (ISO 8601).
Structured filter applied before counting, the same as the row query.
Show child attributes
Show child attributes
Bucket period in seconds. Omit to derive one from the window. Clamped to 1–86400.
Was this page helpful?