mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-06-03 13:50:40 +00:00
20 lines
14 KiB
HTML
20 lines
14 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Table semantic layer vocabulary."><title>table::requests::semantic - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../../static.files/rustdoc-17e0aaed.css"><meta name="rustdoc-vars" data-root-path="../../../" data-static-root-path="../../../static.files/" data-current-crate="table" data-themes="" data-resource-suffix="" data-rustdoc-version="1.96.0-nightly (ac7f9ec7d 2026-03-20)" data-channel="nightly" data-search-js="search-63369b7b.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../../static.files/storage-41dd4d93.js"></script><script defer src="../sidebar-items.js"></script><script defer src="../../../static.files/main-5013f961.js"></script><noscript><link rel="stylesheet" href="../../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../../static.files/favicon-044be391.svg"></head><body class="rustdoc mod"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Module semantic</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../../table/index.html">table</a><span class="version">1.1.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Module semantic</a></h2><h3><a href="#constants">Module Items</a></h3><ul class="block"><li><a href="#constants" title="Constants">Constants</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"><h2><a href="../index.html">In table::<wbr>requests</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../../index.html">table</a>::<wbr><a href="../index.html">requests</a></div><h1>Module <span>semantic</span> <button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../../src/table/requests/semantic.rs.html#15-280">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Table semantic layer vocabulary.</p>
|
||
<p>A thin layer of semantic metadata attached to a table via <code>table_options</code>, 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 <code>docs/rfcs/2026-05-28-table-semantic-layer.md</code>.</p>
|
||
<p>All public table-option keys share the <a href="../constant.SEMANTIC_PREFIX.html" title="constant table::requests::SEMANTIC_PREFIX"><code>SEMANTIC_PREFIX</code></a> namespace and are
|
||
string-valued. <a href="../fn.is_semantic_option_key.html" title="fn table::requests::is_semantic_option_key"><code>is_semantic_option_key</code></a> gates them through
|
||
<a href="../fn.validate_table_option.html" title="fn table::requests::validate_table_option"><code>crate::requests::validate_table_option</code></a>, so they are accepted both on the
|
||
ingestion auto-create path and on explicit <code>CREATE TABLE ... WITH (...)</code> DDL.</p>
|
||
</div></details><h2 id="constants" class="section-header">Constants<a href="#constants" class="anchor">§</a></h2><dl class="item-table"><dt><a class="constant" href="constant.METADATA_QUALITY_DECLARED.html" title="constant table::requests::semantic::METADATA_QUALITY_DECLARED">METADATA_<wbr>QUALITY_<wbr>DECLARED</a></dt><dt><a class="constant" href="constant.METADATA_QUALITY_INFERRED.html" title="constant table::requests::semantic::METADATA_QUALITY_INFERRED">METADATA_<wbr>QUALITY_<wbr>INFERRED</a></dt><dt><a class="constant" href="constant.SEMANTIC_LOG_BODY_FORMAT.html" title="constant table::requests::semantic::SEMANTIC_LOG_BODY_FORMAT">SEMANTIC_<wbr>LOG_<wbr>BODY_<wbr>FORMAT</a></dt><dd><code>string</code> / <code>json</code> / <code>mixed</code> — how to parse <code>body</code>.</dd><dt><a class="constant" href="constant.SEMANTIC_LOG_SEVERITY_SCHEME.html" title="constant table::requests::semantic::SEMANTIC_LOG_SEVERITY_SCHEME">SEMANTIC_<wbr>LOG_<wbr>SEVERITY_<wbr>SCHEME</a></dt><dd><code>otlp</code> / <code>syslog</code> / <code>custom</code> — which mapping to use for <code>severity_number</code>.</dd><dt><a class="constant" href="constant.SEMANTIC_METRIC_METADATA_QUALITY.html" title="constant table::requests::semantic::SEMANTIC_METRIC_METADATA_QUALITY">SEMANTIC_<wbr>METRIC_<wbr>METADATA_<wbr>QUALITY</a></dt><dd><a href="../constant.METADATA_QUALITY_DECLARED.html" title="constant table::requests::METADATA_QUALITY_DECLARED"><code>METADATA_QUALITY_DECLARED</code></a> when the protocol stated the type, or
|
||
<a href="../constant.METADATA_QUALITY_INFERRED.html" title="constant table::requests::METADATA_QUALITY_INFERRED"><code>METADATA_QUALITY_INFERRED</code></a> when guessed from a name suffix.</dd><dt><a class="constant" href="constant.SEMANTIC_METRIC_MONOTONIC.html" title="constant table::requests::semantic::SEMANTIC_METRIC_MONOTONIC">SEMANTIC_<wbr>METRIC_<wbr>MONOTONIC</a></dt><dd><code>true</code> / <code>false</code> for sum / counter typed data.</dd><dt><a class="constant" href="constant.SEMANTIC_METRIC_ORIGINAL_NAME.html" title="constant table::requests::semantic::SEMANTIC_METRIC_ORIGINAL_NAME">SEMANTIC_<wbr>METRIC_<wbr>ORIGINAL_<wbr>NAME</a></dt><dd>Pre-translation OTel metric name when the table name was Prometheus-ised.</dd><dt><a class="constant" href="constant.SEMANTIC_METRIC_TEMPORALITY.html" title="constant table::requests::semantic::SEMANTIC_METRIC_TEMPORALITY">SEMANTIC_<wbr>METRIC_<wbr>TEMPORALITY</a></dt><dd><code>cumulative</code> / <code>delta</code> (OTel only).</dd><dt><a class="constant" href="constant.SEMANTIC_METRIC_TYPE.html" title="constant table::requests::semantic::SEMANTIC_METRIC_TYPE">SEMANTIC_<wbr>METRIC_<wbr>TYPE</a></dt><dd>Instrument kind: <code>counter</code> / <code>gauge</code> / <code>histogram</code> / <code>summary</code> /
|
||
<code>updown_counter</code> / <code>gauge_histogram</code> / <code>info</code> / <code>stateset</code>.</dd><dt><a class="constant" href="constant.SEMANTIC_METRIC_UNIT.html" title="constant table::requests::semantic::SEMANTIC_METRIC_UNIT">SEMANTIC_<wbr>METRIC_<wbr>UNIT</a></dt><dd>UCUM unit, e.g. <code>s</code>, <code>By</code>, <code>{request}</code>.</dd><dt><a class="constant" href="constant.SEMANTIC_OPTION_KEYS.html" title="constant table::requests::semantic::SEMANTIC_OPTION_KEYS">SEMANTIC_<wbr>OPTION_<wbr>KEYS</a></dt><dd>Every recognised public semantic table-option key. The set is a closed
|
||
whitelist: keys under <a href="../constant.SEMANTIC_PREFIX.html" title="constant table::requests::SEMANTIC_PREFIX"><code>SEMANTIC_PREFIX</code></a> that are not listed here are rejected,
|
||
so an unknown key like <code>greptime.semantic.unknown_key</code> does not silently land
|
||
in a table’s options. Adding a key to the vocabulary means adding it here.</dd><dt><a class="constant" href="constant.SEMANTIC_PER_TABLE_INDEX_KEY.html" title="constant table::requests::semantic::SEMANTIC_PER_TABLE_INDEX_KEY">SEMANTIC_<wbr>PER_<wbr>TABLE_<wbr>INDEX_<wbr>KEY</a></dt><dd>Internal <code>QueryContext</code> extension key carrying the per-table semantic index
|
||
(a <code>{table_name -> {semantic_key: value}}</code> JSON blob) from the ingestion
|
||
encode path to the auto-create site. Deliberately OUTSIDE <a href="../constant.SEMANTIC_PREFIX.html" title="constant table::requests::SEMANTIC_PREFIX"><code>SEMANTIC_PREFIX</code></a>
|
||
so it is not a valid table option and never leaks into a table’s options.</dd><dt><a class="constant" href="constant.SEMANTIC_PIPELINE.html" title="constant table::requests::semantic::SEMANTIC_PIPELINE">SEMANTIC_<wbr>PIPELINE</a></dt><dd>Internal ingestion pipeline / data model, e.g. <code>greptime_trace_v1</code>.</dd><dt><a class="constant" href="constant.SEMANTIC_PREFIX.html" title="constant table::requests::semantic::SEMANTIC_PREFIX">SEMANTIC_<wbr>PREFIX</a></dt><dd>Reserved prefix for every public semantic table-option key.</dd><dt><a class="constant" href="constant.SEMANTIC_RESOURCE_ATTRIBUTES_DROPPED.html" title="constant table::requests::semantic::SEMANTIC_RESOURCE_ATTRIBUTES_DROPPED">SEMANTIC_<wbr>RESOURCE_<wbr>ATTRIBUTES_<wbr>DROPPED</a></dt><dd><code>true</code> / <code>false</code> — whether any resource attribute was dropped at ingest.</dd><dt><a class="constant" href="constant.SEMANTIC_RESOURCE_ATTRIBUTES_PRESERVED.html" title="constant table::requests::semantic::SEMANTIC_RESOURCE_ATTRIBUTES_PRESERVED">SEMANTIC_<wbr>RESOURCE_<wbr>ATTRIBUTES_<wbr>PRESERVED</a></dt><dd>JSON array string of resource attributes promoted to first-class columns.</dd><dt><a class="constant" href="constant.SEMANTIC_SCOPE_PRESERVED.html" title="constant table::requests::semantic::SEMANTIC_SCOPE_PRESERVED">SEMANTIC_<wbr>SCOPE_<wbr>PRESERVED</a></dt><dd><code>true</code> / <code>false</code> — whether <code>scope.name</code> / <code>scope.version</code> survive on the row.</dd><dt><a class="constant" href="constant.SEMANTIC_SIGNAL_TYPE.html" title="constant table::requests::semantic::SEMANTIC_SIGNAL_TYPE">SEMANTIC_<wbr>SIGNAL_<wbr>TYPE</a></dt><dd>Signal kind: one of <a href="../constant.SIGNAL_TYPE_TRACE.html" title="constant table::requests::SIGNAL_TYPE_TRACE"><code>SIGNAL_TYPE_TRACE</code></a> / <a href="../constant.SIGNAL_TYPE_LOG.html" title="constant table::requests::SIGNAL_TYPE_LOG"><code>SIGNAL_TYPE_LOG</code></a> /
|
||
<a href="../constant.SIGNAL_TYPE_METRIC.html" title="constant table::requests::SIGNAL_TYPE_METRIC"><code>SIGNAL_TYPE_METRIC</code></a> / <a href="../constant.SIGNAL_TYPE_EVENT.html" title="constant table::requests::SIGNAL_TYPE_EVENT"><code>SIGNAL_TYPE_EVENT</code></a>.</dd><dt><a class="constant" href="constant.SEMANTIC_SOURCE.html" title="constant table::requests::semantic::SEMANTIC_SOURCE">SEMANTIC_<wbr>SOURCE</a></dt><dd>Ingestion ecosystem, e.g. <a href="../constant.SOURCE_OPENTELEMETRY.html" title="constant table::requests::SOURCE_OPENTELEMETRY"><code>SOURCE_OPENTELEMETRY</code></a> / <a href="../constant.SOURCE_PROMETHEUS.html" title="constant table::requests::SOURCE_PROMETHEUS"><code>SOURCE_PROMETHEUS</code></a>.</dd><dt><a class="constant" href="constant.SEMANTIC_SOURCE_VERSION.html" title="constant table::requests::semantic::SEMANTIC_SOURCE_VERSION">SEMANTIC_<wbr>SOURCE_<wbr>VERSION</a></dt><dd>Optional protocol or SDK version string, e.g. <code>v2</code> (Prom remote write), <code>1.30.0</code>.</dd><dt><a class="constant" href="constant.SEMANTIC_TRACE_CONVENTIONS.html" title="constant table::requests::semantic::SEMANTIC_TRACE_CONVENTIONS">SEMANTIC_<wbr>TRACE_<wbr>CONVENTIONS</a></dt><dd>Semantic-conventions version the rows conform to (e.g. <code>otel-semconv-1.27</code>),
|
||
or <a href="../constant.SEMANTIC_VALUE_UNKNOWN.html" title="constant table::requests::SEMANTIC_VALUE_UNKNOWN"><code>SEMANTIC_VALUE_UNKNOWN</code></a> / <a href="../constant.SEMANTIC_VALUE_MIXED.html" title="constant table::requests::SEMANTIC_VALUE_MIXED"><code>SEMANTIC_VALUE_MIXED</code></a> when not single-valued.</dd><dt><a class="constant" href="constant.SEMANTIC_TRACE_HAS_EVENTS.html" title="constant table::requests::semantic::SEMANTIC_TRACE_HAS_EVENTS">SEMANTIC_<wbr>TRACE_<wbr>HAS_<wbr>EVENTS</a></dt><dd>Whether <code>span_events</code> are preserved on the table.</dd><dt><a class="constant" href="constant.SEMANTIC_TRACE_HAS_LINKS.html" title="constant table::requests::semantic::SEMANTIC_TRACE_HAS_LINKS">SEMANTIC_<wbr>TRACE_<wbr>HAS_<wbr>LINKS</a></dt><dd>Whether <code>span_links</code> are preserved on the table.</dd><dt><a class="constant" href="constant.SEMANTIC_VALUE_MIXED.html" title="constant table::requests::semantic::SEMANTIC_VALUE_MIXED">SEMANTIC_<wbr>VALUE_<wbr>MIXED</a></dt><dd>Sentinel for a single-valued key that saw conflicting sources.</dd><dt><a class="constant" href="constant.SEMANTIC_VALUE_UNKNOWN.html" title="constant table::requests::semantic::SEMANTIC_VALUE_UNKNOWN">SEMANTIC_<wbr>VALUE_<wbr>UNKNOWN</a></dt><dd>Sentinel for a key that cannot be determined at stamp time.</dd><dt><a class="constant" href="constant.SIGNAL_TYPE_EVENT.html" title="constant table::requests::semantic::SIGNAL_TYPE_EVENT">SIGNAL_<wbr>TYPE_<wbr>EVENT</a></dt><dt><a class="constant" href="constant.SIGNAL_TYPE_LOG.html" title="constant table::requests::semantic::SIGNAL_TYPE_LOG">SIGNAL_<wbr>TYPE_<wbr>LOG</a></dt><dt><a class="constant" href="constant.SIGNAL_TYPE_METRIC.html" title="constant table::requests::semantic::SIGNAL_TYPE_METRIC">SIGNAL_<wbr>TYPE_<wbr>METRIC</a></dt><dt><a class="constant" href="constant.SIGNAL_TYPE_TRACE.html" title="constant table::requests::semantic::SIGNAL_TYPE_TRACE">SIGNAL_<wbr>TYPE_<wbr>TRACE</a></dt><dt><a class="constant" href="constant.SOURCE_OPENTELEMETRY.html" title="constant table::requests::semantic::SOURCE_OPENTELEMETRY">SOURCE_<wbr>OPENTELEMETRY</a></dt><dt><a class="constant" href="constant.SOURCE_PROMETHEUS.html" title="constant table::requests::semantic::SOURCE_PROMETHEUS">SOURCE_<wbr>PROMETHEUS</a></dt></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.is_semantic_option_key.html" title="fn table::requests::semantic::is_semantic_option_key">is_<wbr>semantic_<wbr>option_<wbr>key</a></dt><dd>Returns true if <code>key</code> is a recognised semantic table-option key (whitelist).</dd><dt><a class="fn" href="fn.validate_semantic_option.html" title="fn table::requests::semantic::validate_semantic_option">validate_<wbr>semantic_<wbr>option</a></dt><dd>Validates a <code>greptime.semantic.*</code> option’s <code>value</code> against its allowed domain.</dd></dl></section></div></main></body></html> |