ワンクリックで
adaline-logs
// Send traces and spans to Adaline for AI agent observability. Use when instrumenting LLM calls, tools, retrieval, embeddings, guardrails, or custom operations.
// Send traces and spans to Adaline for AI agent observability. Use when instrumenting LLM calls, tools, retrieval, embeddings, guardrails, or custom operations.
Create and manage evaluation datasets in Adaline. Use when building test cases, adding dataset columns/rows, importing data, or triggering dynamic columns.
Fetch deployed prompt snapshots from Adaline at runtime. Use when integrating prompt deployments, environment-based latest lookups, prompt caching, or pinned deployment IDs.
Run and manage evaluations in Adaline to test prompt quality at scale. Use when creating evaluation runs, polling status, analyzing results, or cancelling runs.
Create and manage evaluators in Adaline to score prompt outputs. Use when setting up LLM-as-a-judge, JavaScript, text-matcher, cost, latency, or response-length evaluators.
High-level guide for integrating your AI application with Adaline. Use when starting a new Adaline integration, choosing between API/SDK approaches, or planning which Adaline features to adopt.
Create and manage prompts in Adaline via the v2 API or SDK clients. Use when programmatically creating prompts, updating prompt drafts, listing prompts, or reading prompt/playground data.
| name | adaline-logs |
| description | Send traces and spans to Adaline for AI agent observability. Use when instrumenting LLM calls, tools, retrieval, embeddings, guardrails, or custom operations. |
Adaline Logs captures AI application execution as traces and spans.
Key terms:
Model, ModelStream, Tool, Retrieval, Embeddings, Function, Guardrail, or OtherSet these environment variables when credentials are available:
ADALINE_API_KEY — workspace API key from Admin > API KeysADALINE_PROJECT_ID — project IDBase URL: https://api.adaline.ai/v2
import { Adaline } from '@adaline/client';
import type { LogSpanContent } from '@adaline/api';
const adaline = new Adaline();
const monitor = adaline.initMonitor({ projectId: process.env.ADALINE_PROJECT_ID! });
const trace = monitor.logTrace({ name: 'chat-request', sessionId: 'user_42' });
const span = trace.logSpan({
name: 'llm-call',
status: 'unknown',
});
// Run provider call here.
span.update({
status: 'success',
content: {
type: 'Model',
provider: 'openai',
model: 'gpt-4o',
input: JSON.stringify(openaiRequest),
output: JSON.stringify(openaiResponse),
} as LogSpanContent,
});
span.end();
trace.update({ status: 'success' });
trace.end();
await monitor.flush();
monitor.stop();
import json
from adaline import Adaline
from adaline_api.models.log_span_content import LogSpanContent
from adaline_api.models.log_span_model_content import LogSpanModelContent
adaline = Adaline()
monitor = adaline.init_monitor(project_id="project_abc123")
trace = monitor.log_trace(name="chat-request", session_id="user_42")
span = trace.log_span(name="llm-call", status="unknown")
# Run provider call here.
span.update({
"status": "success",
"content": LogSpanContent(LogSpanModelContent(
type="Model",
provider="openai",
model="gpt-4o",
input=json.dumps(openai_request),
output=json.dumps(openai_response),
)),
})
span.end()
trace.update({"status": "success"})
trace.end()
await monitor.flush()
monitor.stop()
curl -X POST "https://api.adaline.ai/v2/logs/trace" \
-H "Authorization: Bearer $ADALINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"projectId": "project_abc123",
"trace": {
"name": "chat-request",
"status": "success",
"referenceId": "request-123",
"startedAt": 1713657600000,
"endedAt": 1713657602500
},
"spans": [
{
"name": "llm-call",
"status": "success",
"referenceId": "span-123",
"startedAt": 1713657600100,
"endedAt": 1713657602400,
"content": {
"type": "Model",
"provider": "openai",
"model": "gpt-4o",
"input": "{\"messages\":[]}",
"output": "{\"choices\":[]}"
}
}
]
}'
Use the SDK monitor. Create a trace, create spans from that trace, call end(), then flush before process exit.
const parent = trace.logSpan({ name: 'agent-loop', referenceId: 'loop-1' });
const child = parent.logSpan({ name: 'tool-call' });
child.end();
parent.end();
parent = trace.log_span(name="agent-loop", reference_id="loop-1")
child = parent.log_span(name="tool-call")
child.end()
parent.end()
Use REST POST /logs/span or raw SDK logsApi/logs_api with traceReferenceId / trace_reference_id when a different process needs to attach a span to an existing trace.
Use PATCH /logs/trace with logTrace.attributes and logTrace.tags operation arrays.
input and output.referenceId on traces and spans so distributed systems can stitch work together.sessionId for multi-turn chats or long-running workflows.monitor.flush() in Python and TypeScript before shutdown/serverless return.LogSpanContent(...) wrapper objects, not raw dictionaries, for SDK span content.See references/api.md for REST payloads. See references/typescript-sdk.md for TypeScript SDK usage. See references/python-sdk.md for Python SDK usage.