curl --request POST \
--url https://api.galileo.ai/v2/projects/{project_id}/traces \
--header 'Content-Type: application/json' \
--header 'Galileo-API-Key: <api-key>' \
--data '
{
"traces": [
{
"type": "trace",
"input": "",
"redacted_input": "<string>",
"output": "<string>",
"redacted_output": "<string>",
"name": "",
"created_at": "2023-11-07T05:31:56Z",
"user_metadata": {},
"tags": [
"<string>"
],
"status_code": 123,
"metrics": {
"duration_ns": 123
},
"external_id": "<string>",
"dataset_input": "<string>",
"dataset_output": "<string>",
"dataset_metadata": {},
"id": "<string>",
"session_id": "<string>",
"trace_id": "<string>",
"step_number": 123,
"parent_id": "<string>",
"spans": [
{
"type": "agent",
"input": "",
"redacted_input": "<string>",
"output": "<string>",
"redacted_output": "<string>",
"name": "",
"created_at": "2023-11-07T05:31:56Z",
"user_metadata": {},
"tags": [
"<string>"
],
"status_code": 123,
"metrics": {
"duration_ns": 123
},
"external_id": "<string>",
"dataset_input": "<string>",
"dataset_output": "<string>",
"dataset_metadata": {},
"id": "<string>",
"session_id": "<string>",
"trace_id": "<string>",
"step_number": 123,
"parent_id": "<string>",
"spans": "<array>",
"agent_type": "default"
}
]
}
],
"log_stream_id": "<string>",
"experiment_id": "<string>",
"metrics_testing_id": "<string>",
"logging_method": "api_direct",
"client_version": "<string>",
"reliable": true,
"session_id": "<string>",
"session_external_id": "<string>",
"is_complete": true,
"include_trace_ids": false
}
'import requests
url = "https://api.galileo.ai/v2/projects/{project_id}/traces"
payload = {
"traces": [
{
"type": "trace",
"input": "",
"redacted_input": "<string>",
"output": "<string>",
"redacted_output": "<string>",
"name": "",
"created_at": "2023-11-07T05:31:56Z",
"user_metadata": {},
"tags": ["<string>"],
"status_code": 123,
"metrics": { "duration_ns": 123 },
"external_id": "<string>",
"dataset_input": "<string>",
"dataset_output": "<string>",
"dataset_metadata": {},
"id": "<string>",
"session_id": "<string>",
"trace_id": "<string>",
"step_number": 123,
"parent_id": "<string>",
"spans": [
{
"type": "agent",
"input": "",
"redacted_input": "<string>",
"output": "<string>",
"redacted_output": "<string>",
"name": "",
"created_at": "2023-11-07T05:31:56Z",
"user_metadata": {},
"tags": ["<string>"],
"status_code": 123,
"metrics": { "duration_ns": 123 },
"external_id": "<string>",
"dataset_input": "<string>",
"dataset_output": "<string>",
"dataset_metadata": {},
"id": "<string>",
"session_id": "<string>",
"trace_id": "<string>",
"step_number": 123,
"parent_id": "<string>",
"spans": "<array>",
"agent_type": "default"
}
]
}
],
"log_stream_id": "<string>",
"experiment_id": "<string>",
"metrics_testing_id": "<string>",
"logging_method": "api_direct",
"client_version": "<string>",
"reliable": True,
"session_id": "<string>",
"session_external_id": "<string>",
"is_complete": True,
"include_trace_ids": False
}
headers = {
"Galileo-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Galileo-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
traces: [
{
type: 'trace',
input: '',
redacted_input: '<string>',
output: '<string>',
redacted_output: '<string>',
name: '',
created_at: '2023-11-07T05:31:56Z',
user_metadata: {},
tags: ['<string>'],
status_code: 123,
metrics: {duration_ns: 123},
external_id: '<string>',
dataset_input: '<string>',
dataset_output: '<string>',
dataset_metadata: {},
id: '<string>',
session_id: '<string>',
trace_id: '<string>',
step_number: 123,
parent_id: '<string>',
spans: [
{
type: 'agent',
input: '',
redacted_input: '<string>',
output: '<string>',
redacted_output: '<string>',
name: '',
created_at: '2023-11-07T05:31:56Z',
user_metadata: {},
tags: ['<string>'],
status_code: 123,
metrics: {duration_ns: 123},
external_id: '<string>',
dataset_input: '<string>',
dataset_output: '<string>',
dataset_metadata: {},
id: '<string>',
session_id: '<string>',
trace_id: '<string>',
step_number: 123,
parent_id: '<string>',
spans: '<array>',
agent_type: 'default'
}
]
}
],
log_stream_id: '<string>',
experiment_id: '<string>',
metrics_testing_id: '<string>',
logging_method: 'api_direct',
client_version: '<string>',
reliable: true,
session_id: '<string>',
session_external_id: '<string>',
is_complete: true,
include_trace_ids: false
})
};
fetch('https://api.galileo.ai/v2/projects/{project_id}/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.galileo.ai/v2/projects/{project_id}/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([
'traces' => [
[
'type' => 'trace',
'input' => '',
'redacted_input' => '<string>',
'output' => '<string>',
'redacted_output' => '<string>',
'name' => '',
'created_at' => '2023-11-07T05:31:56Z',
'user_metadata' => [
],
'tags' => [
'<string>'
],
'status_code' => 123,
'metrics' => [
'duration_ns' => 123
],
'external_id' => '<string>',
'dataset_input' => '<string>',
'dataset_output' => '<string>',
'dataset_metadata' => [
],
'id' => '<string>',
'session_id' => '<string>',
'trace_id' => '<string>',
'step_number' => 123,
'parent_id' => '<string>',
'spans' => [
[
'type' => 'agent',
'input' => '',
'redacted_input' => '<string>',
'output' => '<string>',
'redacted_output' => '<string>',
'name' => '',
'created_at' => '2023-11-07T05:31:56Z',
'user_metadata' => [
],
'tags' => [
'<string>'
],
'status_code' => 123,
'metrics' => [
'duration_ns' => 123
],
'external_id' => '<string>',
'dataset_input' => '<string>',
'dataset_output' => '<string>',
'dataset_metadata' => [
],
'id' => '<string>',
'session_id' => '<string>',
'trace_id' => '<string>',
'step_number' => 123,
'parent_id' => '<string>',
'spans' => '<array>',
'agent_type' => 'default'
]
]
]
],
'log_stream_id' => '<string>',
'experiment_id' => '<string>',
'metrics_testing_id' => '<string>',
'logging_method' => 'api_direct',
'client_version' => '<string>',
'reliable' => true,
'session_id' => '<string>',
'session_external_id' => '<string>',
'is_complete' => true,
'include_trace_ids' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Galileo-API-Key: <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.galileo.ai/v2/projects/{project_id}/traces"
payload := strings.NewReader("{\n \"traces\": [\n {\n \"type\": \"trace\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": [\n {\n \"type\": \"agent\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": \"<array>\",\n \"agent_type\": \"default\"\n }\n ]\n }\n ],\n \"log_stream_id\": \"<string>\",\n \"experiment_id\": \"<string>\",\n \"metrics_testing_id\": \"<string>\",\n \"logging_method\": \"api_direct\",\n \"client_version\": \"<string>\",\n \"reliable\": true,\n \"session_id\": \"<string>\",\n \"session_external_id\": \"<string>\",\n \"is_complete\": true,\n \"include_trace_ids\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Galileo-API-Key", "<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.galileo.ai/v2/projects/{project_id}/traces")
.header("Galileo-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"traces\": [\n {\n \"type\": \"trace\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": [\n {\n \"type\": \"agent\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": \"<array>\",\n \"agent_type\": \"default\"\n }\n ]\n }\n ],\n \"log_stream_id\": \"<string>\",\n \"experiment_id\": \"<string>\",\n \"metrics_testing_id\": \"<string>\",\n \"logging_method\": \"api_direct\",\n \"client_version\": \"<string>\",\n \"reliable\": true,\n \"session_id\": \"<string>\",\n \"session_external_id\": \"<string>\",\n \"is_complete\": true,\n \"include_trace_ids\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galileo.ai/v2/projects/{project_id}/traces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Galileo-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"traces\": [\n {\n \"type\": \"trace\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": [\n {\n \"type\": \"agent\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": \"<array>\",\n \"agent_type\": \"default\"\n }\n ]\n }\n ],\n \"log_stream_id\": \"<string>\",\n \"experiment_id\": \"<string>\",\n \"metrics_testing_id\": \"<string>\",\n \"logging_method\": \"api_direct\",\n \"client_version\": \"<string>\",\n \"reliable\": true,\n \"session_id\": \"<string>\",\n \"session_external_id\": \"<string>\",\n \"is_complete\": true,\n \"include_trace_ids\": false\n}"
response = http.request(request)
puts response.read_body{
"project_id": "<string>",
"project_name": "<string>",
"records_count": 123,
"traces_count": 123,
"spans_count": 123,
"log_stream_id": "<string>",
"experiment_id": "<string>",
"metrics_testing_id": "<string>",
"session_id": "<string>",
"trace_ids": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Log Traces
curl --request POST \
--url https://api.galileo.ai/v2/projects/{project_id}/traces \
--header 'Content-Type: application/json' \
--header 'Galileo-API-Key: <api-key>' \
--data '
{
"traces": [
{
"type": "trace",
"input": "",
"redacted_input": "<string>",
"output": "<string>",
"redacted_output": "<string>",
"name": "",
"created_at": "2023-11-07T05:31:56Z",
"user_metadata": {},
"tags": [
"<string>"
],
"status_code": 123,
"metrics": {
"duration_ns": 123
},
"external_id": "<string>",
"dataset_input": "<string>",
"dataset_output": "<string>",
"dataset_metadata": {},
"id": "<string>",
"session_id": "<string>",
"trace_id": "<string>",
"step_number": 123,
"parent_id": "<string>",
"spans": [
{
"type": "agent",
"input": "",
"redacted_input": "<string>",
"output": "<string>",
"redacted_output": "<string>",
"name": "",
"created_at": "2023-11-07T05:31:56Z",
"user_metadata": {},
"tags": [
"<string>"
],
"status_code": 123,
"metrics": {
"duration_ns": 123
},
"external_id": "<string>",
"dataset_input": "<string>",
"dataset_output": "<string>",
"dataset_metadata": {},
"id": "<string>",
"session_id": "<string>",
"trace_id": "<string>",
"step_number": 123,
"parent_id": "<string>",
"spans": "<array>",
"agent_type": "default"
}
]
}
],
"log_stream_id": "<string>",
"experiment_id": "<string>",
"metrics_testing_id": "<string>",
"logging_method": "api_direct",
"client_version": "<string>",
"reliable": true,
"session_id": "<string>",
"session_external_id": "<string>",
"is_complete": true,
"include_trace_ids": false
}
'import requests
url = "https://api.galileo.ai/v2/projects/{project_id}/traces"
payload = {
"traces": [
{
"type": "trace",
"input": "",
"redacted_input": "<string>",
"output": "<string>",
"redacted_output": "<string>",
"name": "",
"created_at": "2023-11-07T05:31:56Z",
"user_metadata": {},
"tags": ["<string>"],
"status_code": 123,
"metrics": { "duration_ns": 123 },
"external_id": "<string>",
"dataset_input": "<string>",
"dataset_output": "<string>",
"dataset_metadata": {},
"id": "<string>",
"session_id": "<string>",
"trace_id": "<string>",
"step_number": 123,
"parent_id": "<string>",
"spans": [
{
"type": "agent",
"input": "",
"redacted_input": "<string>",
"output": "<string>",
"redacted_output": "<string>",
"name": "",
"created_at": "2023-11-07T05:31:56Z",
"user_metadata": {},
"tags": ["<string>"],
"status_code": 123,
"metrics": { "duration_ns": 123 },
"external_id": "<string>",
"dataset_input": "<string>",
"dataset_output": "<string>",
"dataset_metadata": {},
"id": "<string>",
"session_id": "<string>",
"trace_id": "<string>",
"step_number": 123,
"parent_id": "<string>",
"spans": "<array>",
"agent_type": "default"
}
]
}
],
"log_stream_id": "<string>",
"experiment_id": "<string>",
"metrics_testing_id": "<string>",
"logging_method": "api_direct",
"client_version": "<string>",
"reliable": True,
"session_id": "<string>",
"session_external_id": "<string>",
"is_complete": True,
"include_trace_ids": False
}
headers = {
"Galileo-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Galileo-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
traces: [
{
type: 'trace',
input: '',
redacted_input: '<string>',
output: '<string>',
redacted_output: '<string>',
name: '',
created_at: '2023-11-07T05:31:56Z',
user_metadata: {},
tags: ['<string>'],
status_code: 123,
metrics: {duration_ns: 123},
external_id: '<string>',
dataset_input: '<string>',
dataset_output: '<string>',
dataset_metadata: {},
id: '<string>',
session_id: '<string>',
trace_id: '<string>',
step_number: 123,
parent_id: '<string>',
spans: [
{
type: 'agent',
input: '',
redacted_input: '<string>',
output: '<string>',
redacted_output: '<string>',
name: '',
created_at: '2023-11-07T05:31:56Z',
user_metadata: {},
tags: ['<string>'],
status_code: 123,
metrics: {duration_ns: 123},
external_id: '<string>',
dataset_input: '<string>',
dataset_output: '<string>',
dataset_metadata: {},
id: '<string>',
session_id: '<string>',
trace_id: '<string>',
step_number: 123,
parent_id: '<string>',
spans: '<array>',
agent_type: 'default'
}
]
}
],
log_stream_id: '<string>',
experiment_id: '<string>',
metrics_testing_id: '<string>',
logging_method: 'api_direct',
client_version: '<string>',
reliable: true,
session_id: '<string>',
session_external_id: '<string>',
is_complete: true,
include_trace_ids: false
})
};
fetch('https://api.galileo.ai/v2/projects/{project_id}/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.galileo.ai/v2/projects/{project_id}/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([
'traces' => [
[
'type' => 'trace',
'input' => '',
'redacted_input' => '<string>',
'output' => '<string>',
'redacted_output' => '<string>',
'name' => '',
'created_at' => '2023-11-07T05:31:56Z',
'user_metadata' => [
],
'tags' => [
'<string>'
],
'status_code' => 123,
'metrics' => [
'duration_ns' => 123
],
'external_id' => '<string>',
'dataset_input' => '<string>',
'dataset_output' => '<string>',
'dataset_metadata' => [
],
'id' => '<string>',
'session_id' => '<string>',
'trace_id' => '<string>',
'step_number' => 123,
'parent_id' => '<string>',
'spans' => [
[
'type' => 'agent',
'input' => '',
'redacted_input' => '<string>',
'output' => '<string>',
'redacted_output' => '<string>',
'name' => '',
'created_at' => '2023-11-07T05:31:56Z',
'user_metadata' => [
],
'tags' => [
'<string>'
],
'status_code' => 123,
'metrics' => [
'duration_ns' => 123
],
'external_id' => '<string>',
'dataset_input' => '<string>',
'dataset_output' => '<string>',
'dataset_metadata' => [
],
'id' => '<string>',
'session_id' => '<string>',
'trace_id' => '<string>',
'step_number' => 123,
'parent_id' => '<string>',
'spans' => '<array>',
'agent_type' => 'default'
]
]
]
],
'log_stream_id' => '<string>',
'experiment_id' => '<string>',
'metrics_testing_id' => '<string>',
'logging_method' => 'api_direct',
'client_version' => '<string>',
'reliable' => true,
'session_id' => '<string>',
'session_external_id' => '<string>',
'is_complete' => true,
'include_trace_ids' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Galileo-API-Key: <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.galileo.ai/v2/projects/{project_id}/traces"
payload := strings.NewReader("{\n \"traces\": [\n {\n \"type\": \"trace\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": [\n {\n \"type\": \"agent\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": \"<array>\",\n \"agent_type\": \"default\"\n }\n ]\n }\n ],\n \"log_stream_id\": \"<string>\",\n \"experiment_id\": \"<string>\",\n \"metrics_testing_id\": \"<string>\",\n \"logging_method\": \"api_direct\",\n \"client_version\": \"<string>\",\n \"reliable\": true,\n \"session_id\": \"<string>\",\n \"session_external_id\": \"<string>\",\n \"is_complete\": true,\n \"include_trace_ids\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Galileo-API-Key", "<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.galileo.ai/v2/projects/{project_id}/traces")
.header("Galileo-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"traces\": [\n {\n \"type\": \"trace\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": [\n {\n \"type\": \"agent\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": \"<array>\",\n \"agent_type\": \"default\"\n }\n ]\n }\n ],\n \"log_stream_id\": \"<string>\",\n \"experiment_id\": \"<string>\",\n \"metrics_testing_id\": \"<string>\",\n \"logging_method\": \"api_direct\",\n \"client_version\": \"<string>\",\n \"reliable\": true,\n \"session_id\": \"<string>\",\n \"session_external_id\": \"<string>\",\n \"is_complete\": true,\n \"include_trace_ids\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.galileo.ai/v2/projects/{project_id}/traces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Galileo-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"traces\": [\n {\n \"type\": \"trace\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": [\n {\n \"type\": \"agent\",\n \"input\": \"\",\n \"redacted_input\": \"<string>\",\n \"output\": \"<string>\",\n \"redacted_output\": \"<string>\",\n \"name\": \"\",\n \"created_at\": \"2023-11-07T05:31:56Z\",\n \"user_metadata\": {},\n \"tags\": [\n \"<string>\"\n ],\n \"status_code\": 123,\n \"metrics\": {\n \"duration_ns\": 123\n },\n \"external_id\": \"<string>\",\n \"dataset_input\": \"<string>\",\n \"dataset_output\": \"<string>\",\n \"dataset_metadata\": {},\n \"id\": \"<string>\",\n \"session_id\": \"<string>\",\n \"trace_id\": \"<string>\",\n \"step_number\": 123,\n \"parent_id\": \"<string>\",\n \"spans\": \"<array>\",\n \"agent_type\": \"default\"\n }\n ]\n }\n ],\n \"log_stream_id\": \"<string>\",\n \"experiment_id\": \"<string>\",\n \"metrics_testing_id\": \"<string>\",\n \"logging_method\": \"api_direct\",\n \"client_version\": \"<string>\",\n \"reliable\": true,\n \"session_id\": \"<string>\",\n \"session_external_id\": \"<string>\",\n \"is_complete\": true,\n \"include_trace_ids\": false\n}"
response = http.request(request)
puts response.read_body{
"project_id": "<string>",
"project_name": "<string>",
"records_count": 123,
"traces_count": 123,
"spans_count": 123,
"log_stream_id": "<string>",
"experiment_id": "<string>",
"metrics_testing_id": "<string>",
"session_id": "<string>",
"trace_ids": [
"<string>"
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Body
Request model for ingesting traces.
List of traces to log.
1Show child attributes
Show child attributes
Log stream id associated with the traces.
Experiment id associated with the traces.
Metrics testing id associated with the traces.
playground, python_client, typescript_client, api_direct Whether or not to use reliable logging. If set to False, the method will respond immediately before verifying that the traces have been successfully ingested, and no error message will be returned if ingestion fails. If set to True, the method will wait for the traces to be successfully ingested or return an error message if there is an ingestion failure.
Session id associated with the traces.
External id of the session (e.g., OTEL session.id from span attributes).
Whether or not the records in this request are complete.
If True, include the list of ingested trace IDs in the response.
Response
Successful Response
Project id associated with the traces.
Project name associated with the traces.
Total number of records ingested
total number of traces ingested
total number of spans ingested
Log stream id associated with the traces.
Experiment id associated with the traces.
Metrics testing id associated with the traces.
Session id associated with the traces.
List of trace IDs that were ingested. Only included if include_trace_ids=True in request.
Was this page helpful?