Trace Pipeline Health
Return queue depth + drop count from the running exporter.
Safe-default: when no exporter is attached to app.state (engine
booted without a trace pipeline, or T7 wiring not present), return
zeroes plus writer_running=False so the UI panel stays
renderable instead of erroring.
Declared before the /{otel_trace_id} route so the literal
path takes precedence over the path-parameter route at match time
— FastAPI iterates in declaration order.
Also surfaces database_dialect (read off the sessionmaker bind)
so the UI can conditionally render the SQLite operational banner
without a second round-trip.
curl --request GET \
--url https://api.example.com/admin/api/v1/traces/_healthimport requests
url = "https://api.example.com/admin/api/v1/traces/_health"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/admin/api/v1/traces/_health', 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.example.com/admin/api/v1/traces/_health",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/admin/api/v1/traces/_health"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/admin/api/v1/traces/_health")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/admin/api/v1/traces/_health")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"queueDepth": 123,
"maxQueueSize": 123,
"overflowCount": 123,
"writerRunning": true,
"databaseDialect": "unknown",
"instrumentorStatus": "ok",
"instrumentorMessage": "<string>"
}Response
Successful Response
Body of GET /admin/api/v1/traces/_health.
Reflects the running StandaloneSpanExporter's queue. When the
trace pipeline is not attached (engine booted without traces) the
router returns zeroes + writer_running=False instead of 404 so
the UI panel can render a stable "pipeline idle" state.
database_dialect lets the UI conditionally render the SQLite
operational banner without a second round-trip; it mirrors the
SQLAlchemy bind dialect name ("sqlite" or "postgresql")
and falls back to "unknown" when no bind is reachable.
Was this page helpful?
curl --request GET \
--url https://api.example.com/admin/api/v1/traces/_healthimport requests
url = "https://api.example.com/admin/api/v1/traces/_health"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/admin/api/v1/traces/_health', 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.example.com/admin/api/v1/traces/_health",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/admin/api/v1/traces/_health"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/admin/api/v1/traces/_health")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/admin/api/v1/traces/_health")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"queueDepth": 123,
"maxQueueSize": 123,
"overflowCount": 123,
"writerRunning": true,
"databaseDialect": "unknown",
"instrumentorStatus": "ok",
"instrumentorMessage": "<string>"
}