Skip to main content

Module semantic

Module semantic 

Source
Expand description

Table semantic layer vocabulary.

A thin layer of semantic metadata attached to a table via table_options, so machine consumers (LLM agents, alert/dashboard builders, MCP servers, ETL) can align a table with the observability concept it stands for without guessing from column names. See docs/rfcs/2026-05-28-table-semantic-layer.md.

All public table-option keys share the SEMANTIC_PREFIX namespace and are string-valued. is_semantic_option_key gates them through crate::requests::validate_table_option, so they are accepted both on the ingestion auto-create path and on explicit CREATE TABLE ... WITH (...) DDL.

Constants§

METADATA_QUALITY_DECLARED
METADATA_QUALITY_INFERRED
SEMANTIC_LOG_BODY_FORMAT
string / json / mixed — how to parse body.
SEMANTIC_LOG_SEVERITY_SCHEME
otlp / syslog / custom — which mapping to use for severity_number.
SEMANTIC_METRIC_METADATA_QUALITY
METADATA_QUALITY_DECLARED when the protocol stated the type, or METADATA_QUALITY_INFERRED when guessed from a name suffix.
SEMANTIC_METRIC_MONOTONIC
true / false for sum / counter typed data.
SEMANTIC_METRIC_ORIGINAL_NAME
Pre-translation OTel metric name when the table name was Prometheus-ised.
SEMANTIC_METRIC_TEMPORALITY
cumulative / delta (OTel only).
SEMANTIC_METRIC_TYPE
Instrument kind: counter / gauge / histogram / summary / updown_counter / gauge_histogram / info / stateset.
SEMANTIC_METRIC_UNIT
UCUM unit, e.g. s, By, {request}.
SEMANTIC_OPTION_KEYS
Every recognised public semantic table-option key. The set is a closed whitelist: keys under SEMANTIC_PREFIX that are not listed here are rejected, so an unknown key like greptime.semantic.unknown_key does not silently land in a table’s options. Adding a key to the vocabulary means adding it here.
SEMANTIC_PER_TABLE_INDEX_KEY
Internal QueryContext extension key carrying the per-table semantic index (a {table_name -> {semantic_key: value}} JSON blob) from the ingestion encode path to the auto-create site. Deliberately OUTSIDE SEMANTIC_PREFIX so it is not a valid table option and never leaks into a table’s options.
SEMANTIC_PIPELINE
Internal ingestion pipeline / data model, e.g. greptime_trace_v1.
SEMANTIC_PREFIX
Reserved prefix for every public semantic table-option key.
SEMANTIC_RESOURCE_ATTRIBUTES_DROPPED
true / false — whether any resource attribute was dropped at ingest.
SEMANTIC_RESOURCE_ATTRIBUTES_PRESERVED
JSON array string of resource attributes promoted to first-class columns.
SEMANTIC_SCOPE_PRESERVED
true / false — whether scope.name / scope.version survive on the row.
SEMANTIC_SIGNAL_TYPE
Signal kind: one of SIGNAL_TYPE_TRACE / SIGNAL_TYPE_LOG / SIGNAL_TYPE_METRIC / SIGNAL_TYPE_EVENT.
SEMANTIC_SOURCE
Ingestion ecosystem, e.g. SOURCE_OPENTELEMETRY / SOURCE_PROMETHEUS.
SEMANTIC_SOURCE_VERSION
Optional protocol or SDK version string, e.g. v2 (Prom remote write), 1.30.0.
SEMANTIC_TRACE_CONVENTIONS
Semantic-conventions version the rows conform to (e.g. otel-semconv-1.27), or SEMANTIC_VALUE_UNKNOWN / SEMANTIC_VALUE_MIXED when not single-valued.
SEMANTIC_TRACE_HAS_EVENTS
Whether span_events are preserved on the table.
SEMANTIC_TRACE_HAS_LINKS
Whether span_links are preserved on the table.
SEMANTIC_VALUE_MIXED
Sentinel for a single-valued key that saw conflicting sources.
SEMANTIC_VALUE_UNKNOWN
Sentinel for a key that cannot be determined at stamp time.
SIGNAL_TYPE_EVENT
SIGNAL_TYPE_LOG
SIGNAL_TYPE_METRIC
SIGNAL_TYPE_TRACE
SOURCE_OPENTELEMETRY
SOURCE_PROMETHEUS

Functions§

is_semantic_option_key
Returns true if key is a recognised semantic table-option key (whitelist).
validate_semantic_option
Validates a greptime.semantic.* option’s value against its allowed domain.