Skip to content

Add support for extra_headers #6

@eyalben

Description

@eyalben

Cylestio Custom Headers Support

We want to support additional headers sent from the client to override default behavior and attach additional event data to requests flowing through the gateway.

Overview

The gateway will support two categories of x-cylestio- headers:

  • Cylestio Headers - Core event metadata and tracing information
  • Additional Attributes - Custom filterable attributes for each event/session

Core Cylestio Headers

These headers provide essential metadata for event tracking and observability:

  • x-cylestio-agent-id: Agent identifier or name for multi-agent workflows
  • x-cylestio-trace-id: OpenTelemetry TraceID for distributed tracing
  • x-cylestio-span-id: OpenTelemetry SpanID for span correlation
  • x-cylestio-workflow-id: Multi-agent architecture workflow identifier

Additional Attributes

Store custom attributes for each request using the x-cylestio-extra-* prefix pattern. These attributes will be filterable in the Cylestio platform for advanced analytics and segmentation.

Examples:

  • x-cylestio-extra-tenant-id: Multi-tenant organization identifier
  • x-cylestio-extra-user-id: End-user identifier for user-level analytics
  • x-cylestio-extra-environment: Deployment environment (dev, staging, prod)
  • x-cylestio-extra-application: Source application name
  • x-cylestio-extra-region: Geographic region or data center

Usage Example

curl -X POST http://localhost:3000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "x-cylestio-agent-id: customer-support-bot" \
  -H "x-cylestio-trace-id: 4bf92f3577b34da6a3ce929d0e0e4736" \
  -H "x-cylestio-extra-tenant-id: acme-corp" \
  -H "x-cylestio-extra-user-id: user-12345" \
  -d '{"model": "gpt-3.5-turbo", "messages": [...]}'

This approach provides flexible event enrichment while maintaining a consistent header naming convention for easy identification and processing.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions