Expand description
Per-table semantic metadata accumulated during one ingest pass (OTLP metrics, Prometheus remote write v2).
Each written table collects the scalar semantic keys its wire metadata
declares (an OTLP histogram fans out into _bucket/_sum/_count
companions; a remote write series names one metric family). The resulting
index is serialized onto the greptime.internal.semantic.per_table_index
context extension as {schema -> {table -> {key -> value}}} and folded into
each table’s options at auto-create time.
Conflict handling follows the RFC: when two sources disagree on a
single-valued key the value collapses to mixed (or unknown for keys whose
domain has no mixed).
Structs§
- Semantic
Index - Index of
{table_name -> {semantic_key -> value}}for one target schema. - Semantic
Indexes - Schema-aware collection of
SemanticIndexes: Prometheus remote write lets each series override the target schema with a special label, so one request may write the same metric name into several schemas — their metadata must not collapse into each other.
Constants§
- METRIC_
TYPE_ COUNTER - METRIC_
TYPE_ GAUGE - METRIC_
TYPE_ GAUGE_ HISTOGRAM - METRIC_
TYPE_ HISTOGRAM - METRIC_
TYPE_ INFO - METRIC_
TYPE_ STATESET - METRIC_
TYPE_ SUMMARY - METRIC_
TYPE_ UPDOWN_ COUNTER
Functions§
- collapse_
value 🔒 - The collapsed value for a conflicting scalar key:
mixedwhen the key’s domain accepts it, elseunknown. Uses the vocabulary validator as the single source of truth for which keys allowmixed. - openmetrics_
unit_ to_ ucum - Maps an OpenMetrics unit name (open vocabulary full words:
seconds,bytes) to the UCUM code thegreptime.semantic.metric.unitoption is defined in. Only the OpenMetrics base units are mapped; anything else is dropped — a missing unit beats a corrupted cross-protocol vocabulary.