List slow events
curl --request POST \
--url https://appsignal.com/api/v2/tracing/slow_events \
--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",
"wanted_attributes": {
"payload": {
"Required": [
"db.query.text",
"db.statement"
]
},
"system": {
"Optional": [
"db.system.name"
]
}
}
}
'import requests
url = "https://appsignal.com/api/v2/tracing/slow_events"
payload = {
"site_id": "abc123",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-01T01:00:00Z",
"wanted_attributes": {
"payload": { "Required": ["db.query.text", "db.statement"] },
"system": { "Optional": ["db.system.name"] }
}
}
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',
wanted_attributes: {
payload: {Required: ['db.query.text', 'db.statement']},
system: {Optional: ['db.system.name']}
}
})
};
fetch('https://appsignal.com/api/v2/tracing/slow_events', 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/tracing/slow_events",
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',
'wanted_attributes' => [
'payload' => [
'Required' => [
'db.query.text',
'db.statement'
]
],
'system' => [
'Optional' => [
'db.system.name'
]
]
]
]),
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/tracing/slow_events"
payload := strings.NewReader("{\n \"site_id\": \"abc123\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-01T01:00:00Z\",\n \"wanted_attributes\": {\n \"payload\": {\n \"Required\": [\n \"db.query.text\",\n \"db.statement\"\n ]\n },\n \"system\": {\n \"Optional\": [\n \"db.system.name\"\n ]\n }\n }\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/tracing/slow_events")
.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 \"wanted_attributes\": {\n \"payload\": {\n \"Required\": [\n \"db.query.text\",\n \"db.statement\"\n ]\n },\n \"system\": {\n \"Optional\": [\n \"db.system.name\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/tracing/slow_events")
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 \"wanted_attributes\": {\n \"payload\": {\n \"Required\": [\n \"db.query.text\",\n \"db.statement\"\n ]\n },\n \"system\": {\n \"Optional\": [\n \"db.system.name\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body[
{
"digest": "1234567890",
"count": 42,
"mean": 125.5,
"impact": 5271,
"payload": "SELECT * FROM users WHERE id = ?",
"system": "postgresql"
}
]{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}wanted_attributes, see Querying traces.
Authorizations
Authorization: Bearer <token>
Body
Filters for listing slow events such as slow database queries.
Site to query.
Start of the time range; clamped to the account's data retention.
End of the time range; clamped to now.
Attributes to return, keyed by category (e.g. payload, system). The key appsignal.library
returns what follows appsignal/ in the span's scope (e.g. active_record), empty for other scopes.
Show child attributes
Show child attributes
Only return spans of this kind.
Client, Server, Internal, Producer, Consumer Attribute keys to exclude; a span is excluded if any listed key is present.
Response
The slow events, with the requested attributes.
Hash digest identifying the slow event's operation.
Number of times this slow event occurred in the time range.
x >= 0Mean duration of this slow event in milliseconds.
Relative impact score (higher means more total time spent).
Additional attributes for the slow event (e.g. query body, category).
Was this page helpful?
curl --request POST \
--url https://appsignal.com/api/v2/tracing/slow_events \
--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",
"wanted_attributes": {
"payload": {
"Required": [
"db.query.text",
"db.statement"
]
},
"system": {
"Optional": [
"db.system.name"
]
}
}
}
'import requests
url = "https://appsignal.com/api/v2/tracing/slow_events"
payload = {
"site_id": "abc123",
"from": "2024-01-01T00:00:00Z",
"to": "2024-01-01T01:00:00Z",
"wanted_attributes": {
"payload": { "Required": ["db.query.text", "db.statement"] },
"system": { "Optional": ["db.system.name"] }
}
}
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',
wanted_attributes: {
payload: {Required: ['db.query.text', 'db.statement']},
system: {Optional: ['db.system.name']}
}
})
};
fetch('https://appsignal.com/api/v2/tracing/slow_events', 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/tracing/slow_events",
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',
'wanted_attributes' => [
'payload' => [
'Required' => [
'db.query.text',
'db.statement'
]
],
'system' => [
'Optional' => [
'db.system.name'
]
]
]
]),
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/tracing/slow_events"
payload := strings.NewReader("{\n \"site_id\": \"abc123\",\n \"from\": \"2024-01-01T00:00:00Z\",\n \"to\": \"2024-01-01T01:00:00Z\",\n \"wanted_attributes\": {\n \"payload\": {\n \"Required\": [\n \"db.query.text\",\n \"db.statement\"\n ]\n },\n \"system\": {\n \"Optional\": [\n \"db.system.name\"\n ]\n }\n }\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/tracing/slow_events")
.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 \"wanted_attributes\": {\n \"payload\": {\n \"Required\": [\n \"db.query.text\",\n \"db.statement\"\n ]\n },\n \"system\": {\n \"Optional\": [\n \"db.system.name\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/tracing/slow_events")
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 \"wanted_attributes\": {\n \"payload\": {\n \"Required\": [\n \"db.query.text\",\n \"db.statement\"\n ]\n },\n \"system\": {\n \"Optional\": [\n \"db.system.name\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body[
{
"digest": "1234567890",
"count": 42,
"mean": 125.5,
"impact": 5271,
"payload": "SELECT * FROM users WHERE id = ?",
"system": "postgresql"
}
]{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}