Ingest OTLP traces
curl --request POST \
--url https://api.avidoai.com/v0/otel/traces \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-application-id: <api-key>' \
--data '
{
"resourceSpans": [
{
"scopeSpans": [
{
"spans": [
{
"traceId": "4bf92f3577b34da6a3ce929d0e0e4736",
"spanId": "00f067aa0ba902b7",
"name": "llm.generate",
"startTimeUnixNano": "1737052800000000000",
"endTimeUnixNano": "1737052800500000000",
"attributes": [
{
"key": "openinference.span.kind",
"value": {
"stringValue": "LLM"
}
},
{
"key": "llm.model_name",
"value": {
"stringValue": "gpt-4o-2024-08-06"
}
},
{
"key": "input.value",
"value": {
"stringValue": "Tell me a joke."
}
},
{
"key": "output.value",
"value": {
"stringValue": "Why did the chicken cross the road?"
}
},
{
"key": "llm.token_count.prompt",
"value": {
"intValue": 12
}
},
{
"key": "llm.token_count.completion",
"value": {
"intValue": 18
}
}
]
}
]
}
]
}
]
}
'import requests
url = "https://api.avidoai.com/v0/otel/traces"
payload = { "resourceSpans": [{ "scopeSpans": [{ "spans": [
{
"traceId": "4bf92f3577b34da6a3ce929d0e0e4736",
"spanId": "00f067aa0ba902b7",
"name": "llm.generate",
"startTimeUnixNano": "1737052800000000000",
"endTimeUnixNano": "1737052800500000000",
"attributes": [
{
"key": "openinference.span.kind",
"value": { "stringValue": "LLM" }
},
{
"key": "llm.model_name",
"value": { "stringValue": "gpt-4o-2024-08-06" }
},
{
"key": "input.value",
"value": { "stringValue": "Tell me a joke." }
},
{
"key": "output.value",
"value": { "stringValue": "Why did the chicken cross the road?" }
},
{
"key": "llm.token_count.prompt",
"value": { "intValue": 12 }
},
{
"key": "llm.token_count.completion",
"value": { "intValue": 18 }
}
]
}
] }] }] }
headers = {
"x-api-key": "<api-key>",
"x-application-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-application-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
resourceSpans: [
{
scopeSpans: [
{
spans: [
{
traceId: '4bf92f3577b34da6a3ce929d0e0e4736',
spanId: '00f067aa0ba902b7',
name: 'llm.generate',
startTimeUnixNano: '1737052800000000000',
endTimeUnixNano: '1737052800500000000',
attributes: [
{key: 'openinference.span.kind', value: {stringValue: 'LLM'}},
{key: 'llm.model_name', value: {stringValue: 'gpt-4o-2024-08-06'}},
{key: 'input.value', value: {stringValue: 'Tell me a joke.'}},
{
key: 'output.value',
value: {stringValue: 'Why did the chicken cross the road?'}
},
{key: 'llm.token_count.prompt', value: {intValue: 12}},
{key: 'llm.token_count.completion', value: {intValue: 18}}
]
}
]
}
]
}
]
})
};
fetch('https://api.avidoai.com/v0/otel/traces', 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.avidoai.com/v0/otel/traces",
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([
'resourceSpans' => [
[
'scopeSpans' => [
[
'spans' => [
[
'traceId' => '4bf92f3577b34da6a3ce929d0e0e4736',
'spanId' => '00f067aa0ba902b7',
'name' => 'llm.generate',
'startTimeUnixNano' => '1737052800000000000',
'endTimeUnixNano' => '1737052800500000000',
'attributes' => [
[
'key' => 'openinference.span.kind',
'value' => [
'stringValue' => 'LLM'
]
],
[
'key' => 'llm.model_name',
'value' => [
'stringValue' => 'gpt-4o-2024-08-06'
]
],
[
'key' => 'input.value',
'value' => [
'stringValue' => 'Tell me a joke.'
]
],
[
'key' => 'output.value',
'value' => [
'stringValue' => 'Why did the chicken cross the road?'
]
],
[
'key' => 'llm.token_count.prompt',
'value' => [
'intValue' => 12
]
],
[
'key' => 'llm.token_count.completion',
'value' => [
'intValue' => 18
]
]
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-application-id: <api-key>"
],
]);
$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://api.avidoai.com/v0/otel/traces"
payload := strings.NewReader("{\n \"resourceSpans\": [\n {\n \"scopeSpans\": [\n {\n \"spans\": [\n {\n \"traceId\": \"4bf92f3577b34da6a3ce929d0e0e4736\",\n \"spanId\": \"00f067aa0ba902b7\",\n \"name\": \"llm.generate\",\n \"startTimeUnixNano\": \"1737052800000000000\",\n \"endTimeUnixNano\": \"1737052800500000000\",\n \"attributes\": [\n {\n \"key\": \"openinference.span.kind\",\n \"value\": {\n \"stringValue\": \"LLM\"\n }\n },\n {\n \"key\": \"llm.model_name\",\n \"value\": {\n \"stringValue\": \"gpt-4o-2024-08-06\"\n }\n },\n {\n \"key\": \"input.value\",\n \"value\": {\n \"stringValue\": \"Tell me a joke.\"\n }\n },\n {\n \"key\": \"output.value\",\n \"value\": {\n \"stringValue\": \"Why did the chicken cross the road?\"\n }\n },\n {\n \"key\": \"llm.token_count.prompt\",\n \"value\": {\n \"intValue\": 12\n }\n },\n {\n \"key\": \"llm.token_count.completion\",\n \"value\": {\n \"intValue\": 18\n }\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-application-id", "<api-key>")
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://api.avidoai.com/v0/otel/traces")
.header("x-api-key", "<api-key>")
.header("x-application-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"resourceSpans\": [\n {\n \"scopeSpans\": [\n {\n \"spans\": [\n {\n \"traceId\": \"4bf92f3577b34da6a3ce929d0e0e4736\",\n \"spanId\": \"00f067aa0ba902b7\",\n \"name\": \"llm.generate\",\n \"startTimeUnixNano\": \"1737052800000000000\",\n \"endTimeUnixNano\": \"1737052800500000000\",\n \"attributes\": [\n {\n \"key\": \"openinference.span.kind\",\n \"value\": {\n \"stringValue\": \"LLM\"\n }\n },\n {\n \"key\": \"llm.model_name\",\n \"value\": {\n \"stringValue\": \"gpt-4o-2024-08-06\"\n }\n },\n {\n \"key\": \"input.value\",\n \"value\": {\n \"stringValue\": \"Tell me a joke.\"\n }\n },\n {\n \"key\": \"output.value\",\n \"value\": {\n \"stringValue\": \"Why did the chicken cross the road?\"\n }\n },\n {\n \"key\": \"llm.token_count.prompt\",\n \"value\": {\n \"intValue\": 12\n }\n },\n {\n \"key\": \"llm.token_count.completion\",\n \"value\": {\n \"intValue\": 18\n }\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avidoai.com/v0/otel/traces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-application-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resourceSpans\": [\n {\n \"scopeSpans\": [\n {\n \"spans\": [\n {\n \"traceId\": \"4bf92f3577b34da6a3ce929d0e0e4736\",\n \"spanId\": \"00f067aa0ba902b7\",\n \"name\": \"llm.generate\",\n \"startTimeUnixNano\": \"1737052800000000000\",\n \"endTimeUnixNano\": \"1737052800500000000\",\n \"attributes\": [\n {\n \"key\": \"openinference.span.kind\",\n \"value\": {\n \"stringValue\": \"LLM\"\n }\n },\n {\n \"key\": \"llm.model_name\",\n \"value\": {\n \"stringValue\": \"gpt-4o-2024-08-06\"\n }\n },\n {\n \"key\": \"input.value\",\n \"value\": {\n \"stringValue\": \"Tell me a joke.\"\n }\n },\n {\n \"key\": \"output.value\",\n \"value\": {\n \"stringValue\": \"Why did the chicken cross the road?\"\n }\n },\n {\n \"key\": \"llm.token_count.prompt\",\n \"value\": {\n \"intValue\": 12\n }\n },\n {\n \"key\": \"llm.token_count.completion\",\n \"value\": {\n \"intValue\": 18\n }\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"success": true,
"id": "123e4567-e89b-12d3-a456-426614174000",
"error": "Failed to write to database"
}
]
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Invalid request data",
"issues": [
{
"code": "invalid_string",
"message": "Invalid UUID",
"path": [
"id"
]
}
]
}{
"message": "Resource not found"
}Ingestion
Ingest OTLP traces
Ingest OpenTelemetry Protocol (OTLP) traces in JSON format. Converts OTLP spans to Avido events and processes them through the standard ingestion pipeline. Supports OpenInference semantic conventions for LLM, tool, retriever, and other span types.
POST
/
v0
/
otel
/
traces
Ingest OTLP traces
curl --request POST \
--url https://api.avidoai.com/v0/otel/traces \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-application-id: <api-key>' \
--data '
{
"resourceSpans": [
{
"scopeSpans": [
{
"spans": [
{
"traceId": "4bf92f3577b34da6a3ce929d0e0e4736",
"spanId": "00f067aa0ba902b7",
"name": "llm.generate",
"startTimeUnixNano": "1737052800000000000",
"endTimeUnixNano": "1737052800500000000",
"attributes": [
{
"key": "openinference.span.kind",
"value": {
"stringValue": "LLM"
}
},
{
"key": "llm.model_name",
"value": {
"stringValue": "gpt-4o-2024-08-06"
}
},
{
"key": "input.value",
"value": {
"stringValue": "Tell me a joke."
}
},
{
"key": "output.value",
"value": {
"stringValue": "Why did the chicken cross the road?"
}
},
{
"key": "llm.token_count.prompt",
"value": {
"intValue": 12
}
},
{
"key": "llm.token_count.completion",
"value": {
"intValue": 18
}
}
]
}
]
}
]
}
]
}
'import requests
url = "https://api.avidoai.com/v0/otel/traces"
payload = { "resourceSpans": [{ "scopeSpans": [{ "spans": [
{
"traceId": "4bf92f3577b34da6a3ce929d0e0e4736",
"spanId": "00f067aa0ba902b7",
"name": "llm.generate",
"startTimeUnixNano": "1737052800000000000",
"endTimeUnixNano": "1737052800500000000",
"attributes": [
{
"key": "openinference.span.kind",
"value": { "stringValue": "LLM" }
},
{
"key": "llm.model_name",
"value": { "stringValue": "gpt-4o-2024-08-06" }
},
{
"key": "input.value",
"value": { "stringValue": "Tell me a joke." }
},
{
"key": "output.value",
"value": { "stringValue": "Why did the chicken cross the road?" }
},
{
"key": "llm.token_count.prompt",
"value": { "intValue": 12 }
},
{
"key": "llm.token_count.completion",
"value": { "intValue": 18 }
}
]
}
] }] }] }
headers = {
"x-api-key": "<api-key>",
"x-application-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'x-api-key': '<api-key>',
'x-application-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
resourceSpans: [
{
scopeSpans: [
{
spans: [
{
traceId: '4bf92f3577b34da6a3ce929d0e0e4736',
spanId: '00f067aa0ba902b7',
name: 'llm.generate',
startTimeUnixNano: '1737052800000000000',
endTimeUnixNano: '1737052800500000000',
attributes: [
{key: 'openinference.span.kind', value: {stringValue: 'LLM'}},
{key: 'llm.model_name', value: {stringValue: 'gpt-4o-2024-08-06'}},
{key: 'input.value', value: {stringValue: 'Tell me a joke.'}},
{
key: 'output.value',
value: {stringValue: 'Why did the chicken cross the road?'}
},
{key: 'llm.token_count.prompt', value: {intValue: 12}},
{key: 'llm.token_count.completion', value: {intValue: 18}}
]
}
]
}
]
}
]
})
};
fetch('https://api.avidoai.com/v0/otel/traces', 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.avidoai.com/v0/otel/traces",
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([
'resourceSpans' => [
[
'scopeSpans' => [
[
'spans' => [
[
'traceId' => '4bf92f3577b34da6a3ce929d0e0e4736',
'spanId' => '00f067aa0ba902b7',
'name' => 'llm.generate',
'startTimeUnixNano' => '1737052800000000000',
'endTimeUnixNano' => '1737052800500000000',
'attributes' => [
[
'key' => 'openinference.span.kind',
'value' => [
'stringValue' => 'LLM'
]
],
[
'key' => 'llm.model_name',
'value' => [
'stringValue' => 'gpt-4o-2024-08-06'
]
],
[
'key' => 'input.value',
'value' => [
'stringValue' => 'Tell me a joke.'
]
],
[
'key' => 'output.value',
'value' => [
'stringValue' => 'Why did the chicken cross the road?'
]
],
[
'key' => 'llm.token_count.prompt',
'value' => [
'intValue' => 12
]
],
[
'key' => 'llm.token_count.completion',
'value' => [
'intValue' => 18
]
]
]
]
]
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>",
"x-application-id: <api-key>"
],
]);
$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://api.avidoai.com/v0/otel/traces"
payload := strings.NewReader("{\n \"resourceSpans\": [\n {\n \"scopeSpans\": [\n {\n \"spans\": [\n {\n \"traceId\": \"4bf92f3577b34da6a3ce929d0e0e4736\",\n \"spanId\": \"00f067aa0ba902b7\",\n \"name\": \"llm.generate\",\n \"startTimeUnixNano\": \"1737052800000000000\",\n \"endTimeUnixNano\": \"1737052800500000000\",\n \"attributes\": [\n {\n \"key\": \"openinference.span.kind\",\n \"value\": {\n \"stringValue\": \"LLM\"\n }\n },\n {\n \"key\": \"llm.model_name\",\n \"value\": {\n \"stringValue\": \"gpt-4o-2024-08-06\"\n }\n },\n {\n \"key\": \"input.value\",\n \"value\": {\n \"stringValue\": \"Tell me a joke.\"\n }\n },\n {\n \"key\": \"output.value\",\n \"value\": {\n \"stringValue\": \"Why did the chicken cross the road?\"\n }\n },\n {\n \"key\": \"llm.token_count.prompt\",\n \"value\": {\n \"intValue\": 12\n }\n },\n {\n \"key\": \"llm.token_count.completion\",\n \"value\": {\n \"intValue\": 18\n }\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-application-id", "<api-key>")
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://api.avidoai.com/v0/otel/traces")
.header("x-api-key", "<api-key>")
.header("x-application-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"resourceSpans\": [\n {\n \"scopeSpans\": [\n {\n \"spans\": [\n {\n \"traceId\": \"4bf92f3577b34da6a3ce929d0e0e4736\",\n \"spanId\": \"00f067aa0ba902b7\",\n \"name\": \"llm.generate\",\n \"startTimeUnixNano\": \"1737052800000000000\",\n \"endTimeUnixNano\": \"1737052800500000000\",\n \"attributes\": [\n {\n \"key\": \"openinference.span.kind\",\n \"value\": {\n \"stringValue\": \"LLM\"\n }\n },\n {\n \"key\": \"llm.model_name\",\n \"value\": {\n \"stringValue\": \"gpt-4o-2024-08-06\"\n }\n },\n {\n \"key\": \"input.value\",\n \"value\": {\n \"stringValue\": \"Tell me a joke.\"\n }\n },\n {\n \"key\": \"output.value\",\n \"value\": {\n \"stringValue\": \"Why did the chicken cross the road?\"\n }\n },\n {\n \"key\": \"llm.token_count.prompt\",\n \"value\": {\n \"intValue\": 12\n }\n },\n {\n \"key\": \"llm.token_count.completion\",\n \"value\": {\n \"intValue\": 18\n }\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.avidoai.com/v0/otel/traces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["x-application-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resourceSpans\": [\n {\n \"scopeSpans\": [\n {\n \"spans\": [\n {\n \"traceId\": \"4bf92f3577b34da6a3ce929d0e0e4736\",\n \"spanId\": \"00f067aa0ba902b7\",\n \"name\": \"llm.generate\",\n \"startTimeUnixNano\": \"1737052800000000000\",\n \"endTimeUnixNano\": \"1737052800500000000\",\n \"attributes\": [\n {\n \"key\": \"openinference.span.kind\",\n \"value\": {\n \"stringValue\": \"LLM\"\n }\n },\n {\n \"key\": \"llm.model_name\",\n \"value\": {\n \"stringValue\": \"gpt-4o-2024-08-06\"\n }\n },\n {\n \"key\": \"input.value\",\n \"value\": {\n \"stringValue\": \"Tell me a joke.\"\n }\n },\n {\n \"key\": \"output.value\",\n \"value\": {\n \"stringValue\": \"Why did the chicken cross the road?\"\n }\n },\n {\n \"key\": \"llm.token_count.prompt\",\n \"value\": {\n \"intValue\": 12\n }\n },\n {\n \"key\": \"llm.token_count.completion\",\n \"value\": {\n \"intValue\": 18\n }\n }\n ]\n }\n ]\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"success": true,
"id": "123e4567-e89b-12d3-a456-426614174000",
"error": "Failed to write to database"
}
]
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Invalid request data",
"issues": [
{
"code": "invalid_string",
"message": "Invalid UUID",
"path": [
"id"
]
}
]
}{
"message": "Resource not found"
}Authorizations
Your unique Avido API key
Your unique Avido Application ID
Body
application/json
OpenTelemetry Protocol traces request payload in JSON format. Contains resourceSpans array with nested spans, attributes, events, links, and metadata following the OTLP specification.
Maximum array length:
100Show child attributes
Show child attributes
Response
Successfully ingested OTLP traces.
Response schema for successful event ingestion.
Array of results for each ingested event.
Show child attributes
Show child attributes
⌘I