Search traces
curl --request POST \
--url https://appsignal.com/api/v2/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"site_ids": [
"6591f2705fa150d75339e232"
],
"query": "error:RuntimeError",
"kind": "exception",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-02T00:00:00Z"
}
'import requests
url = "https://appsignal.com/api/v2/search"
payload = {
"site_ids": ["6591f2705fa150d75339e232"],
"query": "error:RuntimeError",
"kind": "exception",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-02T00:00:00Z"
}
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_ids: ['6591f2705fa150d75339e232'],
query: 'error:RuntimeError',
kind: 'exception',
from: '2024-01-01T00:00:00Z',
to: '2024-01-02T00:00:00Z'
})
};
fetch('https://appsignal.com/api/v2/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://appsignal.com/api/v2/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([
'site_ids' => [
'6591f2705fa150d75339e232'
],
'query' => 'error:RuntimeError',
'kind' => 'exception',
'from' => '2024-01-01T00:00:00Z',
'to' => '2024-01-02T00:00:00Z'
]),
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/search"
payload := strings.NewReader("{\n \"site_ids\": [\n \"6591f2705fa150d75339e232\"\n ],\n \"query\": \"error:RuntimeError\",\n \"kind\": \"exception\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-02T00:00:00Z\"\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/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"site_ids\": [\n \"6591f2705fa150d75339e232\"\n ],\n \"query\": \"error:RuntimeError\",\n \"kind\": \"exception\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-02T00:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/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 \"site_ids\": [\n \"6591f2705fa150d75339e232\"\n ],\n \"query\": \"error:RuntimeError\",\n \"kind\": \"exception\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-02T00:00:00Z\"\n}"
response = http.request(request)
puts response.read_body[
{
"result_type": "exception",
"source": "trace",
"trace_id": "<string>",
"site_id": "<string>",
"time": "2023-11-07T05:31:56Z",
"duration": 123,
"tags": {},
"namespace": "<string>",
"revision": "<string>",
"action_name": "<string>",
"exception_name": "<string>",
"exception_message": "<string>",
"incident_digest": "<string>",
"incident_number": 123
}
]{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}Authorizations
Authorization: Bearer <token>
Body
Request body for the unified search endpoint.
Sites to search, as BSON ObjectIds: at least one, all in one account.
Bare words match an action name, exception name or tag value exactly, as one phrase.
action:, error: and tag: match one field exactly, message: a case-insensitive whole-word phrase; quote values with spaces.
Optional namespace filter (e.g. "web", "background").
Sample kind filter.
all, exception, performance Start of the time range (inclusive). Defaults to, and is clamped to, the start of the account's retention.
End of the time range (inclusive). Defaults to now.
Maximum number of results to return. Clamped to at most 2000.
x >= 0Response
Up to limit results, newest first: one per incident digest of each matching span, so trace_id can repeat.
Whether this is an exception or performance result.
exception, performance Where this result came from; always trace.
trace Identifier to open the trace with.
Site identifier this result belongs to.
Timestamp when the result was recorded.
Duration in milliseconds of the matched span.
User-defined tags.
Show child attributes
Show child attributes
Namespace the result belongs to (e.g. "web", "background").
Git revision or deployment identifier active when the result was recorded.
Action name of the result (e.g. "POST /api/users").
Exception name; present for exception results only.
Exception message; present for exception results only.
Incident digest used to link to the incident page.
Incident number, when the incident digest matches a known incident.
Was this page helpful?
curl --request POST \
--url https://appsignal.com/api/v2/search \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"site_ids": [
"6591f2705fa150d75339e232"
],
"query": "error:RuntimeError",
"kind": "exception",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-02T00:00:00Z"
}
'import requests
url = "https://appsignal.com/api/v2/search"
payload = {
"site_ids": ["6591f2705fa150d75339e232"],
"query": "error:RuntimeError",
"kind": "exception",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-02T00:00:00Z"
}
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_ids: ['6591f2705fa150d75339e232'],
query: 'error:RuntimeError',
kind: 'exception',
from: '2024-01-01T00:00:00Z',
to: '2024-01-02T00:00:00Z'
})
};
fetch('https://appsignal.com/api/v2/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://appsignal.com/api/v2/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([
'site_ids' => [
'6591f2705fa150d75339e232'
],
'query' => 'error:RuntimeError',
'kind' => 'exception',
'from' => '2024-01-01T00:00:00Z',
'to' => '2024-01-02T00:00:00Z'
]),
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/search"
payload := strings.NewReader("{\n \"site_ids\": [\n \"6591f2705fa150d75339e232\"\n ],\n \"query\": \"error:RuntimeError\",\n \"kind\": \"exception\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-02T00:00:00Z\"\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/search")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"site_ids\": [\n \"6591f2705fa150d75339e232\"\n ],\n \"query\": \"error:RuntimeError\",\n \"kind\": \"exception\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-02T00:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/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 \"site_ids\": [\n \"6591f2705fa150d75339e232\"\n ],\n \"query\": \"error:RuntimeError\",\n \"kind\": \"exception\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-02T00:00:00Z\"\n}"
response = http.request(request)
puts response.read_body[
{
"result_type": "exception",
"source": "trace",
"trace_id": "<string>",
"site_id": "<string>",
"time": "2023-11-07T05:31:56Z",
"duration": 123,
"tags": {},
"namespace": "<string>",
"revision": "<string>",
"action_name": "<string>",
"exception_name": "<string>",
"exception_message": "<string>",
"incident_digest": "<string>",
"incident_number": 123
}
]{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}