Skip to main content
Attributes are key-value pairs attached to spans for filtering and analysis.

Standard Attributes

Automatically extracted by Lumina:
AttributeTypeDescription
modelstringLLM model name
prompt_tokensintInput tokens
completion_tokensintOutput tokens
cost_usdfloatCalculated cost
latency_msintDuration
statusstringSuccess/error state

Custom Attributes

Add your own:
await lumina.trace('operation', async (span) => {
  span.setAttribute('userId', 'user-123');
  span.setAttribute('priority', 'high');
  span.setAttribute('retries', 3);
});

Querying by Attributes

Filter traces by attributes in the dashboard:
userId = "user-123"
cost_usd > 0.5
priority = "high"

Best Practices

Use consistent naming:
// Good
userId, sessionId, featureFlag

// Bad
uid, SessionID, flag
Add context:
span.setAttribute('model', 'gpt-4');
span.setAttribute('temperature', 0.7);
span.setAttribute('max_tokens', 1000);