Skip to content

Schema Reference

The extension emits typed tables based on the OpenTelemetry ClickHouse exporter schema and aligns fields with the OpenTelemetry Arrow data model where the models overlap. All column names use snake_case.

Table functionColumnsNotes
read_otlp_traces24Spans with identifiers, scope metadata, attributes, events, and links
read_otlp_logs18Log records with severity, body, resource attributes, and trace correlation
read_otlp_metrics_gauge17Gauge metrics with numeric value columns and metadata
read_otlp_metrics_sum19Sum/counter metrics with aggregation temporality
read_otlp_metrics_exp_histogram27Exponential histogram metrics with bucket data
read_otlp_metrics_histogram22Standard histogram metrics with explicit bucket bounds

read_otlp_metrics (union schema) and read_otlp_metrics_summary are registered placeholders.

24 columns total:

ColumnTypeDescription
start_time_unix_nanoTIMESTAMP_NSSpan start time
duration_time_unix_nanoBIGINTSpan duration in nanoseconds
trace_idVARCHARTrace identifier (hex string)
span_idVARCHARSpan identifier (hex string)
parent_span_idVARCHARParent span identifier (hex string)
trace_stateVARCHARW3C trace state
service_nameVARCHARService name from resource attributes
service_namespaceVARCHARService namespace from resource attributes
service_instance_idVARCHARService instance ID from resource attributes
nameVARCHAROperation name
kindINTEGERSpan kind (0=unspecified, 1=internal, 2=server, 3=client, 4=producer, 5=consumer)
status_codeINTEGERStatus code (0=unset, 1=ok, 2=error)
status_status_messageVARCHARStatus description
resource_attributesVARCHARResource attributes as JSON string
scope_nameVARCHARInstrumentation scope name
scope_versionVARCHARInstrumentation scope version
scope_attributesVARCHARScope attributes as JSON string
span_attributesVARCHARSpan attributes as JSON string
events_jsonVARCHARSpan events as JSON array
links_jsonVARCHARSpan links as JSON array
dropped_attributes_countINTEGERNumber of dropped attributes
dropped_events_countINTEGERNumber of dropped events
dropped_links_countINTEGERNumber of dropped links
flagsINTEGERTrace flags

Each span is emitted once, even if multiple files are scanned. Use standard DuckDB SQL to join traces back to logs or metrics via trace_id/span_id.

18 columns total:

ColumnTypeDescription
time_unix_nanoTIMESTAMP_NSLog timestamp
observed_time_unix_nanoTIMESTAMP_NSTime when the log was observed
trace_idVARCHARTrace identifier for correlation (hex string)
span_idVARCHARSpan identifier for correlation (hex string)
service_nameVARCHARService name from resource attributes
service_namespaceVARCHARService namespace from resource attributes
service_instance_idVARCHARService instance ID from resource attributes
severity_numberINTEGERNumeric severity level (1-24)
severity_textVARCHARSeverity text (e.g., “INFO”, “ERROR”)
event_nameVARCHAREvent name attribute, when present
bodyVARCHARLog message body
resource_attributesVARCHARResource attributes as JSON string
scope_nameVARCHARInstrumentation scope name
scope_versionVARCHARInstrumentation scope version
scope_attributesVARCHARScope attributes as JSON string
log_attributesVARCHARLog record attributes as JSON string
dropped_attributes_countINTEGERNumber of dropped attributes
flagsINTEGERTrace flags

17 columns total:

ColumnTypeDescription
time_unix_nanoTIMESTAMP_NSData point timestamp
start_time_unix_nanoTIMESTAMP_NSStart time
nameVARCHARMetric name
descriptionVARCHARMetric description
unitVARCHARMetric unit
int_valueBIGINTInteger value, when encoded as an integer
double_valueDOUBLEFloating point value, when encoded as a double
service_nameVARCHARService name from resource attributes
service_namespaceVARCHARService namespace from resource attributes
service_instance_idVARCHARService instance ID from resource attributes
resource_attributesVARCHARResource attributes as JSON string
scope_nameVARCHARInstrumentation scope name
scope_versionVARCHARInstrumentation scope version
scope_attributesVARCHARScope attributes as JSON string
metric_attributesVARCHARData point attributes as JSON string
flagsINTEGERData point flags
exemplars_jsonVARCHARExemplars as JSON array

19 columns total (gauge columns plus):

ColumnTypeDescription
aggregation_temporalityINTEGERAggregation temporality (1=delta, 2=cumulative)
is_monotonicBOOLEANWhether the sum is monotonic (counter vs. up-down counter)

All gauge columns are included, plus the two sum-specific columns above.

Histogram Metrics (read_otlp_metrics_histogram)

Section titled “Histogram Metrics (read_otlp_metrics_histogram)”

22 columns total:

ColumnTypeDescription
time_unix_nanoTIMESTAMP_NSData point timestamp
start_time_unix_nanoTIMESTAMP_NSStart time
nameVARCHARMetric name
descriptionVARCHARMetric description
unitVARCHARMetric unit
countBIGINTTotal count of observations
sumDOUBLESum of all observations (optional)
minDOUBLEMinimum observed value (optional)
maxDOUBLEMaximum observed value (optional)
bucket_countsVARCHARBucket counts as JSON array of integers
explicit_boundsVARCHARExplicit bucket boundaries as JSON array of floats
service_nameVARCHARService name from resource attributes
service_namespaceVARCHARService namespace from resource attributes
service_instance_idVARCHARService instance ID from resource attributes
resource_attributesVARCHARResource attributes as JSON string
scope_nameVARCHARInstrumentation scope name
scope_versionVARCHARInstrumentation scope version
scope_attributesVARCHARScope attributes as JSON string
metric_attributesVARCHARData point attributes as JSON string
flagsINTEGERData point flags
exemplars_jsonVARCHARExemplars as JSON array
aggregation_temporalityINTEGERAggregation temporality (1=delta, 2=cumulative)

Exponential Histogram Metrics (read_otlp_metrics_exp_histogram)

Section titled “Exponential Histogram Metrics (read_otlp_metrics_exp_histogram)”

27 columns total:

ColumnTypeDescription
time_unix_nanoTIMESTAMP_NSData point timestamp
start_time_unix_nanoTIMESTAMP_NSStart time
nameVARCHARMetric name
descriptionVARCHARMetric description
unitVARCHARMetric unit
countBIGINTTotal count of observations
sumDOUBLESum of all observations (optional)
minDOUBLEMinimum observed value (optional)
maxDOUBLEMaximum observed value (optional)
scaleINTEGERScale factor for bucket boundaries
zero_countBIGINTCount of observations at zero
zero_thresholdDOUBLEBoundary for zero bucket (optional)
positive_offsetINTEGERStarting index for positive buckets
positive_bucket_countsVARCHARPositive bucket counts as JSON array
negative_offsetINTEGERStarting index for negative buckets
negative_bucket_countsVARCHARNegative bucket counts as JSON array
service_nameVARCHARService name from resource attributes
service_namespaceVARCHARService namespace from resource attributes
service_instance_idVARCHARService instance ID from resource attributes
resource_attributesVARCHARResource attributes as JSON string
scope_nameVARCHARInstrumentation scope name
scope_versionVARCHARInstrumentation scope version
scope_attributesVARCHARScope attributes as JSON string
metric_attributesVARCHARData point attributes as JSON string
flagsINTEGERData point flags
exemplars_jsonVARCHARExemplars as JSON array
aggregation_temporalityINTEGERAggregation temporality (1=delta, 2=cumulative)
  • trace_id and span_id are VARCHAR hex strings. Use unhex() to convert to binary if needed.
  • Attribute columns store JSON strings. Parse with DuckDB’s JSON functions: json_extract(resource_attributes, '$.key').
  • Timestamps: file readers expose nanosecond timestamp columns such as time_unix_nano and start_time_unix_nano as TIMESTAMP_NS. Live ingest tables keep the same column names but store those values as DuckDB TIMESTAMP for catalog compatibility.
  • Events and links are stored as JSON arrays in events_json and links_json.

For task-oriented queries and exports, use the how-to guides.