Get a performance action's trace
curl --request POST \
--url https://appsignal.com/api/v2/tracing/trace/performance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"site_ids": [
"abc123"
],
"namespace": "web",
"action_name": "POST /api/users",
"trace_id": "last"
}
'import requests
url = "https://appsignal.com/api/v2/tracing/trace/performance"
payload = {
"site_ids": ["abc123"],
"namespace": "web",
"action_name": "POST /api/users",
"trace_id": "last"
}
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: ['abc123'],
namespace: 'web',
action_name: 'POST /api/users',
trace_id: 'last'
})
};
fetch('https://appsignal.com/api/v2/tracing/trace/performance', 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/trace/performance",
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' => [
'abc123'
],
'namespace' => 'web',
'action_name' => 'POST /api/users',
'trace_id' => 'last'
]),
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/trace/performance"
payload := strings.NewReader("{\n \"site_ids\": [\n \"abc123\"\n ],\n \"namespace\": \"web\",\n \"action_name\": \"POST /api/users\",\n \"trace_id\": \"last\"\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/trace/performance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"site_ids\": [\n \"abc123\"\n ],\n \"namespace\": \"web\",\n \"action_name\": \"POST /api/users\",\n \"trace_id\": \"last\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/tracing/trace/performance")
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 \"abc123\"\n ],\n \"namespace\": \"web\",\n \"action_name\": \"POST /api/users\",\n \"trace_id\": \"last\"\n}"
response = http.request(request)
puts response.read_body[
{
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"site_id": "<string>",
"trace_id": "<string>",
"parent_span_id": "<string>",
"span_id": "<string>",
"digest": "<string>",
"duration": 123,
"trace_state": "<string>",
"subtrace_root": true,
"resource_attributes": {},
"service_name": "<string>",
"namespace": "<string>",
"revision": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"action_name": "<string>",
"span_name": "<string>",
"span_kind": "<string>",
"span_attributes": {},
"status_code": "<string>",
"status_message": "<string>",
"events.timestamp": [
"<string>"
],
"events.name": [
"<string>"
],
"events.attributes": [
{}
],
"links.trace_id": [
"<string>"
],
"links.span_id": [
"<string>"
],
"links.trace_state": [
"<string>"
],
"links.attributes": [
{}
]
}
]{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}Authorizations
Authorization: Bearer <token>
Body
The performance action whose trace to fetch.
Sites to search; the token must have access to all of them.
Name of the action, e.g. POST /api/users.
Namespace of the action, e.g. web.
A specific trace ID, or "last" (the default) for the most recent trace of the action.
Response
The trace's spans.
Timestamp when the span started.
Timestamp when the span ended.
Identifier of the site this span belongs to.
Unique identifier for the entire trace.
Span ID of the parent span, empty for root spans.
Unique identifier for this span.
Hash digest identifying the span's operation.
Duration of the span in milliseconds.
W3C trace state header value.
Whether this span is the root of a subtrace (a separate service boundary).
Resource-level attributes (e.g. host, service metadata).
Show child attributes
Show child attributes
Name of the service that produced this span.
Namespace the span belongs to (e.g. "web", "background").
Git revision or deployment identifier active when the span was recorded.
Instrumentation scope name (e.g. the library that produced the span).
Instrumentation scope version.
Action name for the span (e.g. "POST /api/users").
Low-cardinality name of the operation (e.g. "HTTP GET").
Span kind (e.g. "server", "client", "internal").
Span-level attributes (e.g. HTTP headers, database statements).
Show child attributes
Show child attributes
OpenTelemetry status code: "unset", "ok" or "error".
Human-readable status message, typically set on error.
Timestamps of span events.
Names of span events (e.g. "exception").
Attributes for each span event.
Show child attributes
Show child attributes
Trace IDs of linked spans.
Span IDs of linked spans.
Trace state values of linked spans.
Attributes for each span link.
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://appsignal.com/api/v2/tracing/trace/performance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"site_ids": [
"abc123"
],
"namespace": "web",
"action_name": "POST /api/users",
"trace_id": "last"
}
'import requests
url = "https://appsignal.com/api/v2/tracing/trace/performance"
payload = {
"site_ids": ["abc123"],
"namespace": "web",
"action_name": "POST /api/users",
"trace_id": "last"
}
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: ['abc123'],
namespace: 'web',
action_name: 'POST /api/users',
trace_id: 'last'
})
};
fetch('https://appsignal.com/api/v2/tracing/trace/performance', 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/trace/performance",
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' => [
'abc123'
],
'namespace' => 'web',
'action_name' => 'POST /api/users',
'trace_id' => 'last'
]),
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/trace/performance"
payload := strings.NewReader("{\n \"site_ids\": [\n \"abc123\"\n ],\n \"namespace\": \"web\",\n \"action_name\": \"POST /api/users\",\n \"trace_id\": \"last\"\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/trace/performance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"site_ids\": [\n \"abc123\"\n ],\n \"namespace\": \"web\",\n \"action_name\": \"POST /api/users\",\n \"trace_id\": \"last\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://appsignal.com/api/v2/tracing/trace/performance")
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 \"abc123\"\n ],\n \"namespace\": \"web\",\n \"action_name\": \"POST /api/users\",\n \"trace_id\": \"last\"\n}"
response = http.request(request)
puts response.read_body[
{
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"site_id": "<string>",
"trace_id": "<string>",
"parent_span_id": "<string>",
"span_id": "<string>",
"digest": "<string>",
"duration": 123,
"trace_state": "<string>",
"subtrace_root": true,
"resource_attributes": {},
"service_name": "<string>",
"namespace": "<string>",
"revision": "<string>",
"scope_name": "<string>",
"scope_version": "<string>",
"action_name": "<string>",
"span_name": "<string>",
"span_kind": "<string>",
"span_attributes": {},
"status_code": "<string>",
"status_message": "<string>",
"events.timestamp": [
"<string>"
],
"events.name": [
"<string>"
],
"events.attributes": [
{}
],
"links.trace_id": [
"<string>"
],
"links.span_id": [
"<string>"
],
"links.trace_state": [
"<string>"
],
"links.attributes": [
{}
]
}
]{
"error": "<string>",
"message": "<string>",
"details": "<unknown>"
}{
"error": "<string>"
}{
"error": "<string>"
}{
"error": "<string>",
"suggestion": "<string>"
}{
"error": "<string>"
}