Trace Structure
klira.user.messageCoreRoot span — one per user interaction. Always a root (no parent).
● 4 required○ 4 optional
| Attribute | Type | Req | Description |
|---|---|---|---|
klira.entity_type | string | ● | "user_message" |
klira.user_id | string | ● | User identifier |
klira.conversation_id | string | ● | Conversation identifier |
klira.message_id | string | ● | Unique message ID (UUID) |
klira.input | string | ○ | User input text (truncated 10 000 chars) |
klira.entity_name | string | ○ | Entity name |
klira.evals.run_id | string | ○ | Eval run ID (eval mode only) |
klira.duration_ms | float | ○ | Span duration in ms (processor) |
Span Catalog
Core
LLM
Guardrails
Compliance
Clinical
Evals
Resource
Context Attrs
Healthcare Context
Healthcare ContextHealthcare Context
Set on the current active span via context setters — not tied to a specific span type.
| Attribute | Type | Setter | Description |
|---|---|---|---|
klira.healthcare.patient_id | string | set_patient_context() | Patient identifier |
klira.healthcare.encounter_id | string | set_patient_context() | Encounter identifier |
klira.healthcare.department | string | set_clinical_context() | Hospital department |
klira.healthcare.specialty | string | set_clinical_context() | Medical specialty |
klira.healthcare.clinical_domain | string | set_clinical_context() | Clinical domain |
klira.healthcare.interaction_modality | string | set_interaction_modality() | chat, voice, portal |
PHI Attributes
PHI AttributesPHI
Appended at export-time by KliraOTLPSpanExporter when anonymization=True. Scans: gen_ai.prompt, gen_ai.prompt.original, klira.output, klira.input.
| Attribute | Type | Setter | Description |
|---|---|---|---|
klira.phi.detected | bool | Exporter (always) | Whether PHI was detected |
klira.phi.entity_count | int | Exporter (if detected) | Number of PHI entities found |
klira.phi.entity_types | string | Exporter (if detected) | "PERSON,PHONE_NUMBER", etc. |
Processor-Added
Processor-AddedAuto (Processor)
Auto-set by NoneAttributeFilterProcessor on span end.
| Attribute | Type | Setter | Description |
|---|---|---|---|
klira.duration_ms | float | Processor | Span duration in ms (all klira.* spans) |
klira.guardrails.latency_ms | float | Processor | Guardrails-specific duration alias |