Telemetry
Search logs
Returns the workspace’s OpenTelemetry logs in a time window, newest first. Error logs include the recorded exception type, message, and stack trace.
POST
/
telemetry
/
logs
/
search
Search logs
curl --request POST \
--url https://superlog.sh/api/v1/telemetry/logs/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"range": "1h",
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z",
"attributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"limit": 50,
"resourceAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"search": "<string>",
"service": "<string>",
"severity": "<string>",
"traceId": "<string>"
}
'import requests
url = "https://superlog.sh/api/v1/telemetry/logs/search"
payload = {
"range": "1h",
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z",
"attributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"limit": 50,
"resourceAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"search": "<string>",
"service": "<string>",
"severity": "<string>",
"traceId": "<string>"
}
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({
range: '1h',
since: '2023-11-07T05:31:56Z',
until: '2023-11-07T05:31:56Z',
attributes: [{key: '<string>', value: '<string>'}],
limit: 50,
resourceAttributes: [{key: '<string>', value: '<string>'}],
search: '<string>',
service: '<string>',
severity: '<string>',
traceId: '<string>'
})
};
fetch('https://superlog.sh/api/v1/telemetry/logs/search', 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://superlog.sh/api/v1/telemetry/logs/search",
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([
'range' => '1h',
'since' => '2023-11-07T05:31:56Z',
'until' => '2023-11-07T05:31:56Z',
'attributes' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'limit' => 50,
'resourceAttributes' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'search' => '<string>',
'service' => '<string>',
'severity' => '<string>',
'traceId' => '<string>'
]),
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://superlog.sh/api/v1/telemetry/logs/search"
payload := strings.NewReader("{\n \"range\": \"1h\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"limit\": 50,\n \"resourceAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"search\": \"<string>\",\n \"service\": \"<string>\",\n \"severity\": \"<string>\",\n \"traceId\": \"<string>\"\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://superlog.sh/api/v1/telemetry/logs/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"range\": \"1h\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"limit\": 50,\n \"resourceAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"search\": \"<string>\",\n \"service\": \"<string>\",\n \"severity\": \"<string>\",\n \"traceId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://superlog.sh/api/v1/telemetry/logs/search")
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 \"range\": \"1h\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"limit\": 50,\n \"resourceAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"search\": \"<string>\",\n \"service\": \"<string>\",\n \"severity\": \"<string>\",\n \"traceId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"logs": [
{
"attributes": {},
"body": "<string>",
"eventName": "<string>",
"exception": {
"message": "<string>",
"stacktrace": "<string>",
"type": "<string>"
},
"resourceAttributes": {},
"service": "<string>",
"severity": "<string>",
"severityNumber": 123,
"spanId": "<string>",
"timestamp": "<string>",
"traceId": "<string>"
}
],
"since": "<string>",
"until": "<string>"
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}Authorizations
Body
application/json
⌘I
Search logs
curl --request POST \
--url https://superlog.sh/api/v1/telemetry/logs/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"range": "1h",
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z",
"attributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"limit": 50,
"resourceAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"search": "<string>",
"service": "<string>",
"severity": "<string>",
"traceId": "<string>"
}
'import requests
url = "https://superlog.sh/api/v1/telemetry/logs/search"
payload = {
"range": "1h",
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z",
"attributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"limit": 50,
"resourceAttributes": [
{
"key": "<string>",
"value": "<string>"
}
],
"search": "<string>",
"service": "<string>",
"severity": "<string>",
"traceId": "<string>"
}
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({
range: '1h',
since: '2023-11-07T05:31:56Z',
until: '2023-11-07T05:31:56Z',
attributes: [{key: '<string>', value: '<string>'}],
limit: 50,
resourceAttributes: [{key: '<string>', value: '<string>'}],
search: '<string>',
service: '<string>',
severity: '<string>',
traceId: '<string>'
})
};
fetch('https://superlog.sh/api/v1/telemetry/logs/search', 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://superlog.sh/api/v1/telemetry/logs/search",
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([
'range' => '1h',
'since' => '2023-11-07T05:31:56Z',
'until' => '2023-11-07T05:31:56Z',
'attributes' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'limit' => 50,
'resourceAttributes' => [
[
'key' => '<string>',
'value' => '<string>'
]
],
'search' => '<string>',
'service' => '<string>',
'severity' => '<string>',
'traceId' => '<string>'
]),
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://superlog.sh/api/v1/telemetry/logs/search"
payload := strings.NewReader("{\n \"range\": \"1h\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"limit\": 50,\n \"resourceAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"search\": \"<string>\",\n \"service\": \"<string>\",\n \"severity\": \"<string>\",\n \"traceId\": \"<string>\"\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://superlog.sh/api/v1/telemetry/logs/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"range\": \"1h\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"limit\": 50,\n \"resourceAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"search\": \"<string>\",\n \"service\": \"<string>\",\n \"severity\": \"<string>\",\n \"traceId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://superlog.sh/api/v1/telemetry/logs/search")
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 \"range\": \"1h\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"attributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"limit\": 50,\n \"resourceAttributes\": [\n {\n \"key\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"search\": \"<string>\",\n \"service\": \"<string>\",\n \"severity\": \"<string>\",\n \"traceId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"logs": [
{
"attributes": {},
"body": "<string>",
"eventName": "<string>",
"exception": {
"message": "<string>",
"stacktrace": "<string>",
"type": "<string>"
},
"resourceAttributes": {},
"service": "<string>",
"severity": "<string>",
"severityNumber": 123,
"spanId": "<string>",
"timestamp": "<string>",
"traceId": "<string>"
}
],
"since": "<string>",
"until": "<string>"
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}{
"error": "<string>",
"code": "<string>",
"issues": [
{
"message": "<string>",
"path": [
"<string>"
]
}
]
}