Skip to main content

Traces API

Send and query distributed tracing data.

Send Span

trace_id
string
required
Unique trace identifier
span_id
string
required
Unique span identifier
parent_span_id
string
Parent span ID (null for root span)
operation_name
string
required
Name of the operation
service_name
string
required
Name of the service
timestamp
string
Start time (ISO 8601)
duration_ms
number
required
Duration in milliseconds
status_code
string
Status: OK, ERROR, UNSET
attributes
object
Additional span attributes
curl -X POST https://api.itsfriday.in/v1/traces/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "trace_id": "abc123def456",
    "span_id": "span001",
    "parent_span_id": null,
    "operation_name": "HTTP GET /users",
    "service_name": "api-gateway",
    "duration_ms": 145.5,
    "status_code": "OK",
    "attributes": {
      "http.method": "GET",
      "http.url": "/users",
      "http.status_code": "200"
    }
  }'

Response

{
  "data": {
    "accepted": true
  }
}

Send Batch Spans

curl -X POST https://api.itsfriday.in/v1/traces/batch/ \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "spans": [
      {
        "trace_id": "abc123",
        "span_id": "span001",
        "operation_name": "HTTP GET /users",
        "service_name": "api-gateway",
        "duration_ms": 145.5
      },
      {
        "trace_id": "abc123",
        "span_id": "span002",
        "parent_span_id": "span001",
        "operation_name": "SELECT users",
        "service_name": "user-service",
        "duration_ms": 12.3
      }
    ]
  }'

Get Trace

Get a complete trace with all spans.
curl "https://api.itsfriday.in/v1/traces/abc123def456/" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
  "data": {
    "trace_id": "abc123def456",
    "spans": [
      {
        "span_id": "span001",
        "parent_span_id": null,
        "operation_name": "HTTP GET /users",
        "service_name": "api-gateway",
        "timestamp": "2024-01-15T10:30:00Z",
        "duration_ms": 145.5,
        "status_code": "OK",
        "attributes": {...}
      },
      {
        "span_id": "span002",
        "parent_span_id": "span001",
        "operation_name": "SELECT users",
        "service_name": "user-service",
        "timestamp": "2024-01-15T10:30:00.010Z",
        "duration_ms": 12.3,
        "status_code": "OK",
        "attributes": {...}
      }
    ],
    "duration_ms": 145.5,
    "service_count": 2
  }
}

Search Traces

service
string
Filter by service name
operation
string
Filter by operation name
min_duration_ms
number
Minimum trace duration
max_duration_ms
number
Maximum trace duration
status
string
Filter by status: OK, ERROR
from
string
Start time (ISO 8601)
to
string
End time (ISO 8601)
curl -G "https://api.itsfriday.in/v1/traces/search/" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "service=api-gateway" \
  --data-urlencode "min_duration_ms=100" \
  --data-urlencode "status=ERROR" \
  --data-urlencode "limit=20"

Response

{
  "data": {
    "traces": [
      {
        "trace_id": "abc123def456",
        "root_operation": "HTTP GET /users",
        "root_service": "api-gateway",
        "timestamp": "2024-01-15T10:30:00Z",
        "duration_ms": 245.5,
        "span_count": 5,
        "status": "ERROR"
      }
    ]
  },
  "meta": {
    "total": 150,
    "limit": 20
  }
}

Get Service Stats

Get trace statistics per service.
curl -G "https://api.itsfriday.in/v1/traces/services/" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "from=2024-01-15T00:00:00Z"

Response

{
  "data": {
    "services": [
      {
        "name": "api-gateway",
        "trace_count": 1500,
        "avg_duration_ms": 45.2,
        "error_rate": 0.02
      },
      {
        "name": "user-service",
        "trace_count": 1200,
        "avg_duration_ms": 12.5,
        "error_rate": 0.01
      }
    ]
  }
}

Span Attributes

HTTP Spans

AttributeDescription
http.methodHTTP method (GET, POST, etc.)
http.urlRequest URL
http.status_codeResponse status code
http.hostTarget host

Database Spans

AttributeDescription
db.systemDatabase type (postgresql, mysql)
db.statementQuery statement
db.operationOperation type (SELECT, INSERT)
db.rows_affectedNumber of rows affected

Messaging Spans

AttributeDescription
messaging.systemSystem (kafka, rabbitmq)
messaging.destinationQueue/topic name
messaging.operationOperation (publish, consume)