mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-09-05 21:18:57 +00:00
* fix(servers): compose OTLP metrics job from service.namespace/service.name
The OTel Prometheus compatibility spec defines job as
"<service.namespace>/<service.name>" when the namespace is present.
The OTLP metrics path only used the bare service.name, so the job tag
diverged from target_info produced by Prometheus-side exporters for the
same resource. Compose the namespace form, and keep not fabricating a
job when service.name is absent.
Behavior change: resources carrying service.namespace now get
"namespace/name" as their job tag value.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* feat(otlp): synthesize otel_resource_info at OTLP metrics ingestion
Ordinary OTLP metrics scatter filtered resource attributes as tags over
every logical metric table, so metrics-only services contribute nothing
to the semantic entity graph. Each request now also projects its
distinct resources into one info-metric-shaped mito table,
otel_resource_info: a fixed allowlist of identity-relevant attributes
under their raw OTel keys (independent of the label translation
strategy and the promote/ignore headers) plus derived job/instance
compatibility columns, value 1.0, and the newest data-point timestamp.
The descriptor is written after the main insert is committed; a failure
there (conflicting pre-existing table, auto-create disabled) degrades
to an OTLP partial_success warning with rejected_data_points = 0
instead of failing the request and triggering client retries of
already-accepted data. A request writing a metric named
otel_resource_info suppresses synthesis. Legacy mode is unchanged.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* feat(operator): otel info-metric conventions with host/container entities
Whitelist the ingestion-synthesized otel_resource_info descriptor via a
new otel_info_metrics conventions map, gated on source=opentelemetry
(the existing gate hardcoded source=prometheus). Its declarations use
explicit descriptive lists instead of descriptive_rest so identifying
attributes of other entities do not leak into service.instance.
Conventions tightened per the Astronomy Shop findings: host identity is
host.id with host.name descriptive only (host.name is not stable across
SDKs and resource detectors), a generic container entity (new entity
type) is declared only when container.id is present, and trace-v1
tables now synthesize host/container from their flattened resource
attributes too. New co-declared edges: service.instance runs_on
container, container runs_on host.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(otlp): cover the resource descriptor in integration tests
Covers the descriptor's raw-key columns and info-metric options through
the HTTP path, the namespace/name job composition end-to-end, column
names being independent of the translation strategy, the allowlist
excluding unlisted resource attributes, auto-create after a drop, the
metric-name collision suppressing synthesis, and the partial-success
warning (rejected_data_points = 0) when a pre-existing incompatible
table fails the descriptor write while metric data is accepted.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* chore: cargo fmt
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(frontend): degrade descriptor permission denial to a warning
A table-level permission policy denying otel_resource_info would have
failed the whole OTLP metrics request because the descriptor's
permission check ran before the main insert. The descriptor is derived
enrichment: check its permission in the degrade path so a denial skips
the write and surfaces as the partial-success warning, like any other
descriptor write failure.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(otlp): guard descriptor writes with semantic ownership markers
A pre-existing schema-compatible table named otel_resource_info would
silently receive descriptor rows while its missing semantic stamps kept
it out of the entity graph. The descriptor write now requires the
auto-created table's ownership markers (mito engine + signal_type +
source + metric.type=info + metadata_quality=declared) and otherwise
degrades to the partial-success warning; the entity-graph gate for the
otel whitelist likewise requires metric.type=info, so a user table
stamped with only signal/source no longer picks up implicit
declarations.
Also fold the descriptor write cost into the response and surface the
degrade warning through the otel-arrow BatchStatus status_message.
Integration tests pin the full marker set on auto-create and that an
existing owned descriptor keeps accepting writes without degrading —
a missing marker would otherwise silently stop every descriptor write
after the first request.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* perf(otlp): build descriptor rows without the per-resource BTreeMap
Projecting a resource allocated a BTreeMap and then collected it into the
row key, and every attribute was matched against the allowlist by linear
scan. Collect the tags into a Vec and sort once, and match the allowlist
instead of scanning it. Measured on the conversion path: descriptor work
drops 16-18%, from 10.6% to 8.9% of conversion CPU on the worst shape
(1000 resources with 4 data points each), where the cost tracks resource
count rather than data-point count.
Also trims the comments and tests added with the descriptor to what
carries information.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(otlp): pin the descriptor permission-denial degrade path
A policy denying the descriptor table must not fail the metrics request,
which the fix in 2401b3dd9c does but nothing covered. Verified as a
regression guard by mutation: moving the permission check back before
the main write makes this test fail.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* test(otlp): keep legacy mode covered after trimming the unit tests
Trimming the descriptor tests dropped the only assertion that legacy
mode skips the job/instance remap and the promote filter. Both alter
the columns of tables already in use, so fold the check into the legacy
conversion test rather than leaving it uncovered.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(semantic-graph): stop encoding column names into composite entity ids
A composite entity id rendered the identifying columns as sorted
`col=value` pairs, so the same identity split into one entity per
signal: a trace table names its columns service_name and
resource_attributes.service.instance.id where a metric table names them
job and instance. One service instance became two nodes with two
parallel edge sets, breaking the walk from a trace to that instance's
metrics.
Render an id as its values in declared order instead, escaping the
separator so components stay distinguishable, which is what single-column
ids already did by keeping only the value. entity_id_attrs still carries
the structured form.
Values alone are not enough for a namespaced service: the metric side
folds service.namespace into job while traces keep the bare name. Add
qualified_by to the conventions so the trace declarations compose the
namespace the same way, per the OTel rule that job is
<service.namespace>/<service.name> or the bare name when the namespace
is empty. A table without the namespace column keeps the unqualified
identity rather than losing the declaration.
Conventions validation now rejects one entity type declared with a
different number of id columns by two sources, which would silently
produce ids that can never match.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* style(otlp): import the parent module by crate path
check-super-imports.py, part of the CI format gate, rejects a
file-level `use super::`.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* feat(otlp): gate the resource descriptor, and fix what review found
Synthesizing greptime_otel_resource_info creates and writes a table the
user never sent, so it is now off unless
otlp.experimental_enable_resource_info says otherwise. With it off the
request costs exactly what it did before the descriptor existed: nothing
is projected, no table is created, no write and no permission check
happen. Tests run with it on. StandaloneOptions carried no otlp field,
so the whole [otlp] section was silently dropped in standalone mode; map
it through, or the new option (and trace_ingest_chunk_size before it)
would do nothing there.
Renamed from otel_resource_info: the greptime_ prefix marks the table as
engine-managed and makes a collision with a user metric unlikely, which
is what the pre-existing-table ownership check and its per-request
catalog lookup were defending against. Both are gone.
A request may carry data for several graph windows, but the descriptor
folded every data-point time into one row at the newest of them, leaving
the earlier windows with metric rows and no entities. Key the rows by
window as well, and take the times from the data points the encoder
actually writes: it drops exponential histograms, and a resource
carrying nothing else was being described as an entity with no
measurements.
Projecting a resource cloned its attributes once per data point. Nest
the windows under the attributes instead, so they are moved once per
resource, and walk the data-point times through a visitor rather than
collecting a Vec per metric.
Also documents what the two maps key and hold, and lifts the projected
attribute names to constants beside KEY_SERVICE_NAME.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(otlp): skip the descriptor's work entirely when it is disabled
The collision scan over the request's output tables ran even with the
feature off. Short-circuit on the option instead, and update the config
snapshot the new [otlp] section changed.
Also drops the doc comment orphaned by the deleted ownership check: it
had attached itself to the trait impl and described a check that no
longer exists.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* refactor(semantic-graph): drop the expect and name the service identity
The CASE is built through Case directly rather than the fallible
when().otherwise() builder, so the non-test path no longer carries an
expect (architecture-invariants $4).
service_identity returned two same-typed Options that both call sites
destructured positionally; a named struct makes a swap fail to compile.
Also records that id-column order is part of the identity, where the
option docs and the conventions authors will read it.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* chore(semantic-graph): drop comments that narrate the code
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(semantic-graph): cast duration_nano before the trace-table union
Trace tables written before the signed-integer ingest change hold
duration_nano as UInt64 and later ones as Int64. The calls derivation
unions the per-table selects, and the two have no common integer type,
so a deployment holding both shapes could not build the plan. The
cross-table test now spans both.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* refactor(semantic-graph): drop the redundant duration_nano casts
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
* fix(otlp): decide exponential histogram acceptance in one place
The resource descriptor mirrored only the experimental gate, so with both
experimental flags on a resource whose only metric is a delta exponential
histogram was described as an entity with no measurements. The encoder's
whole-metric rules move into exponential_histogram_gate, which both call,
and the descriptor takes its timestamps through exponential_histogram_value
so per-point rejections drop out too.
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
---------
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
417 lines
15 KiB
TOML
417 lines
15 KiB
TOML
## The default timezone of the server.
|
|
## @toml2docs:none-default
|
|
default_timezone = "UTC"
|
|
|
|
## The default column prefix for auto-created time index, value, and native histogram columns.
|
|
## Legacy OTLP summary columns keep their historical `greptime_` prefix.
|
|
## @toml2docs:none-default
|
|
default_column_prefix = "greptime"
|
|
|
|
## Server-side global switch for auto table creation on write.
|
|
## When `false`, a missing table is never auto-created even if the request sets the `auto_create_table` hint to `true`. Default: `true`.
|
|
#+ auto_create_table = true
|
|
|
|
## The user provider for authentication.
|
|
## Examples: "static_user_provider:file:/path/to/users", "static_user_provider:cmd:greptime_user=greptime_pwd"
|
|
## Password verifier formats: "plain:<password>", "pbkdf2_sha256:<iterations>:<hex_salt>:<hex_hash>",
|
|
## "mysql_native_password:<hex_sha1_sha1_password>",
|
|
## "pg_scram_sha256:<iterations>:<hex_salt>:<hex_stored_key>:<hex_server_key>"
|
|
## "pbkdf2_sha256" and "pg_scram_sha256" protect passwords at rest, but cannot authenticate over MySQL's
|
|
## native password handshake; a MySQL client must send the password in cleartext for such users.
|
|
## "mysql_native_password" is MySQL-specific and cannot authenticate over PostgreSQL at all.
|
|
## PostgreSQL SCRAM only covers "plain" and "pg_scram_sha256" users; if any user is "pbkdf2_sha256" or
|
|
## "mysql_native_password", PostgreSQL falls back to cleartext password auth for every user.
|
|
## For "pg_scram_sha256" users, keep the default iteration count (4096) and salt length (16): both are
|
|
## observable in the SCRAM server-first message, and non-default values weaken resistance to username
|
|
## enumeration.
|
|
## @toml2docs:none-default
|
|
#+ user_provider = "static_user_provider:file:/path/to/users"
|
|
|
|
## Maximum total memory for all concurrent write request bodies and messages (HTTP, gRPC, Flight).
|
|
## Set to 0 to disable the limit. Default: "0" (unlimited)
|
|
## @toml2docs:none-default
|
|
#+ max_in_flight_write_bytes = "1GB"
|
|
|
|
## Policy when write bytes quota is exhausted.
|
|
## Options: "wait" (default, 10s timeout), "wait(<duration>)" (e.g., "wait(30s)"), "fail"
|
|
## @toml2docs:none-default
|
|
#+ write_bytes_exhausted_policy = "wait"
|
|
|
|
## The runtime options.
|
|
#+ [runtime]
|
|
## The number of threads to execute the runtime for global read operations.
|
|
#+ global_rt_size = 8
|
|
## The number of threads to execute compact operations.
|
|
#+ compact_rt_size = 4
|
|
## The maximum number of blocking threads for compact operations.
|
|
## Defaults to max(num_cpus / 2, 2).
|
|
#+ compact_rt_max_blocking_threads = 4
|
|
|
|
## The HTTP server options.
|
|
[http]
|
|
## The address to bind the HTTP server.
|
|
addr = "127.0.0.1:4000"
|
|
## HTTP request timeout. Set to 0 to disable timeout.
|
|
## When Prometheus pending-row batching is enabled, a nonzero timeout less than or equal to the
|
|
## `prom_store.pending_rows_flush_interval` plus 1 second is adjusted to that value.
|
|
timeout = "0s"
|
|
## HTTP request body limit.
|
|
## The following units are supported: `B`, `KB`, `KiB`, `MB`, `MiB`, `GB`, `GiB`, `TB`, `TiB`, `PB`, `PiB`.
|
|
## Set to 0 to disable limit.
|
|
body_limit = "64MB"
|
|
## HTTP CORS support, it's turned on by default
|
|
## This allows browser to access http APIs without CORS restrictions
|
|
enable_cors = true
|
|
## Customize allowed origins for HTTP CORS.
|
|
## @toml2docs:none-default
|
|
cors_allowed_origins = ["https://example.com"]
|
|
## Experimental: enable POST /v1/sql/analyze/stream for streaming EXPLAIN ANALYZE VERBOSE metrics.
|
|
experimental_enable_explain_analyze_stream = true
|
|
|
|
## Whether to start the dedicated public HTTP **API** server. This server serves
|
|
## only the `v1` interfaces plus the dashboard, and shares every other `[http]`
|
|
## option with the main server. It is disabled by default; set to `true` to enable.
|
|
enable_api_server = false
|
|
## The address to bind the dedicated HTTP API server, in the same form as `addr`.
|
|
## Defaults to `127.0.0.1:4006`.
|
|
api_server_addr = "127.0.0.1:4006"
|
|
|
|
## The gRPC server options.
|
|
[grpc]
|
|
## The address to bind the gRPC server.
|
|
bind_addr = "127.0.0.1:4001"
|
|
## The address advertised to the metasrv, and used for connections from outside the host.
|
|
## If left empty or unset, the server will automatically use the IP address of the first network interface
|
|
## on the host, with the same port number as the one specified in `grpc.bind_addr`.
|
|
server_addr = "127.0.0.1:4001"
|
|
## The number of server worker threads.
|
|
runtime_size = 8
|
|
## Compression mode for frontend side Arrow IPC service. Available options:
|
|
## - `none`: disable all compression
|
|
## - `transport`: only enable gRPC transport compression (zstd)
|
|
## - `arrow_ipc`: only enable Arrow IPC compression (lz4)
|
|
## - `all`: enable all compression.
|
|
## Default to `none`
|
|
flight_compression = "arrow_ipc"
|
|
## The maximum connection age for gRPC connection.
|
|
## The value can be a human-readable time string. For example: `10m` for ten minutes or `1h` for one hour.
|
|
## Refer to https://grpc.io/docs/guides/keepalive/ for more details.
|
|
## @toml2docs:none-default
|
|
#+ max_connection_age = "10m"
|
|
|
|
## gRPC server TLS options, see `mysql.tls` section.
|
|
[grpc.tls]
|
|
## TLS mode.
|
|
mode = "disable"
|
|
|
|
## Certificate file path.
|
|
## @toml2docs:none-default
|
|
cert_path = ""
|
|
|
|
## Private key file path.
|
|
## @toml2docs:none-default
|
|
key_path = ""
|
|
|
|
## Watch for Certificate and key file change and auto reload.
|
|
## For now, gRPC tls config does not support auto reload.
|
|
watch = false
|
|
|
|
## The internal gRPC server options. Internal gRPC port for nodes inside cluster to access frontend.
|
|
[internal_grpc]
|
|
## The address to bind the gRPC server.
|
|
bind_addr = "127.0.0.1:4010"
|
|
## The address advertised to the metasrv, and used for connections from outside the host.
|
|
## If left empty or unset, the server will automatically use the IP address of the first network interface
|
|
## on the host, with the same port number as the one specified in `internal_grpc.bind_addr`.
|
|
server_addr = "127.0.0.1:4010"
|
|
## The number of server worker threads.
|
|
runtime_size = 8
|
|
## Compression mode for frontend side Arrow IPC service. Available options:
|
|
## - `none`: disable all compression
|
|
## - `transport`: only enable gRPC transport compression (zstd)
|
|
## - `arrow_ipc`: only enable Arrow IPC compression (lz4)
|
|
## - `all`: enable all compression.
|
|
## Default to `none`
|
|
flight_compression = "arrow_ipc"
|
|
|
|
## internal gRPC server TLS options, see `mysql.tls` section.
|
|
[internal_grpc.tls]
|
|
## TLS mode.
|
|
mode = "disable"
|
|
|
|
## Certificate file path.
|
|
## @toml2docs:none-default
|
|
cert_path = ""
|
|
|
|
## Private key file path.
|
|
## @toml2docs:none-default
|
|
key_path = ""
|
|
|
|
## Watch for Certificate and key file change and auto reload.
|
|
## For now, gRPC tls config does not support auto reload.
|
|
watch = false
|
|
|
|
## MySQL server options.
|
|
[mysql]
|
|
## Whether to enable.
|
|
enable = true
|
|
## The addr to bind the MySQL server.
|
|
addr = "127.0.0.1:4002"
|
|
## The number of server worker threads.
|
|
runtime_size = 2
|
|
## Server-side keep-alive time.
|
|
## Set to 0 (default) to disable.
|
|
keep_alive = "0s"
|
|
## Maximum entries in the MySQL prepared statement cache; default is 10,000.
|
|
prepared_stmt_cache_size = 10000
|
|
|
|
# MySQL server TLS options.
|
|
[mysql.tls]
|
|
|
|
## TLS mode, refer to https://www.postgresql.org/docs/current/libpq-ssl.html
|
|
## - `disable` (default value)
|
|
## - `prefer`
|
|
## - `require`
|
|
## - `verify-ca`
|
|
## - `verify-full`
|
|
mode = "disable"
|
|
|
|
## Certificate file path.
|
|
## @toml2docs:none-default
|
|
cert_path = ""
|
|
|
|
## Private key file path.
|
|
## @toml2docs:none-default
|
|
key_path = ""
|
|
|
|
## Watch for Certificate and key file change and auto reload
|
|
watch = false
|
|
|
|
## PostgresSQL server options.
|
|
[postgres]
|
|
## Whether to enable
|
|
enable = true
|
|
## The addr to bind the PostgresSQL server.
|
|
addr = "127.0.0.1:4003"
|
|
## The number of server worker threads.
|
|
runtime_size = 2
|
|
## Server-side keep-alive time.
|
|
## Set to 0 (default) to disable.
|
|
keep_alive = "0s"
|
|
|
|
## PostgresSQL server TLS options, see `mysql.tls` section.
|
|
[postgres.tls]
|
|
## TLS mode.
|
|
mode = "disable"
|
|
|
|
## Certificate file path.
|
|
## @toml2docs:none-default
|
|
cert_path = ""
|
|
|
|
## Private key file path.
|
|
## @toml2docs:none-default
|
|
key_path = ""
|
|
|
|
## Watch for Certificate and key file change and auto reload
|
|
watch = false
|
|
|
|
## OpenTSDB protocol options.
|
|
[opentsdb]
|
|
## Whether to enable OpenTSDB put in HTTP API.
|
|
enable = true
|
|
|
|
## InfluxDB protocol options.
|
|
[influxdb]
|
|
## Whether to enable InfluxDB protocol in HTTP API.
|
|
enable = true
|
|
## Default merge mode for tables automatically created by InfluxDB protocol.
|
|
## Available values: "last_non_null", "last_row".
|
|
default_merge_mode = "last_non_null"
|
|
|
|
## Jaeger protocol options.
|
|
[jaeger]
|
|
## Whether to enable Jaeger protocol in HTTP API.
|
|
enable = true
|
|
|
|
## OpenTelemetry protocol options.
|
|
[otlp]
|
|
## Whether to enable OpenTelemetry protocol in HTTP API.
|
|
enable = true
|
|
## Experimental: enable cumulative OTLP exponential histogram ingestion.
|
|
experimental_enable_exponential_histogram = false
|
|
## Maximum spans per trace ingest chunk. Set to 0 to disable splitting.
|
|
trace_ingest_chunk_size = 512
|
|
## Whether to synthesize the `greptime_otel_resource_info` table from OTLP metric
|
|
## resource attributes, so metrics-only services reach the semantic graph.
|
|
experimental_enable_resource_info = false
|
|
|
|
## Prometheus remote storage options
|
|
[prom_store]
|
|
## Whether to enable Prometheus remote write and read in HTTP API.
|
|
enable = true
|
|
## Whether to store the data from Prometheus remote write in metric engine.
|
|
with_metric_engine = true
|
|
## Whether to enable validation for Prometheus remote write requests.
|
|
## Available options:
|
|
## - strict: deny invalid UTF-8 strings (default).
|
|
## - lossy: allow invalid UTF-8 strings, replace invalid characters with REPLACEMENT_CHARACTER(U+FFFD).
|
|
## - unchecked: do not valid strings.
|
|
prom_validation_mode = "strict"
|
|
## Experimental: enable Prometheus remote write v2 native histogram ingestion.
|
|
experimental_enable_prometheus_native_histogram = false
|
|
## Interval to flush pending rows batcher.
|
|
## Set to "0s" to disable batching mode in Prometheus Remote Write endpoint
|
|
#+pending_rows_flush_interval = "0s"
|
|
## Max rows per pending batch before triggering a flush.
|
|
#+max_batch_rows = 100000
|
|
## Max number of concurrent batch flushes.
|
|
#+max_concurrent_flushes = 256
|
|
## Capacity of the pending batch worker channel.
|
|
#+worker_channel_capacity = 65526
|
|
## Max inflight write requests before backpressure.
|
|
#+max_inflight_requests = 3000
|
|
## Maximum number of logical-table flow notifications waiting in the shared queue.
|
|
#+flow_notification_queue_capacity = 1024
|
|
|
|
## The metasrv client options.
|
|
[meta_client]
|
|
## The addresses of the metasrv.
|
|
metasrv_addrs = ["127.0.0.1:3002"]
|
|
|
|
## Operation timeout.
|
|
timeout = "3s"
|
|
|
|
## DDL timeout.
|
|
ddl_timeout = "10s"
|
|
|
|
## Connect server timeout.
|
|
connect_timeout = "1s"
|
|
|
|
## `TCP_NODELAY` option for accepted connections.
|
|
tcp_nodelay = true
|
|
|
|
## The configuration about the cache of the metadata.
|
|
metadata_cache_max_capacity = 100000
|
|
|
|
## TTL of the metadata cache.
|
|
metadata_cache_ttl = "10m"
|
|
|
|
# TTI of the metadata cache.
|
|
metadata_cache_tti = "5m"
|
|
|
|
## The query engine options.
|
|
[query]
|
|
## Parallelism of the query engine.
|
|
## Default to 0, which means the number of CPU cores.
|
|
parallelism = 0
|
|
## Whether to allow query fallback when push down optimize fails.
|
|
## Default to false, meaning when push down optimize failed, return error msg
|
|
allow_query_fallback = false
|
|
|
|
## Memory pool size for query execution operators (aggregation, sorting, join).
|
|
## Supports absolute size (e.g., "4GB", "8GB") or percentage of system memory (e.g., "30%").
|
|
## Setting it to 0 disables the limit (unbounded, default behavior).
|
|
## When this limit is reached, queries will fail with ResourceExhausted error.
|
|
## NOTE: This does NOT limit memory used by table scans (only applies to datanodes).
|
|
memory_pool_size = "50%"
|
|
|
|
## Datanode options.
|
|
[datanode]
|
|
## Datanode client options.
|
|
[datanode.client]
|
|
connect_timeout = "10s"
|
|
tcp_nodelay = true
|
|
## The maximum receive message size for the gRPC client.
|
|
max_recv_message_size = "512MB"
|
|
## The maximum send message size for the gRPC client.
|
|
max_send_message_size = "512MB"
|
|
|
|
## The logging options.
|
|
[logging]
|
|
## The directory to store the log files. If set to empty, logs will not be written to files.
|
|
dir = "./greptimedb_data/logs"
|
|
|
|
## The log level. Can be `info`/`debug`/`warn`/`error`.
|
|
## @toml2docs:none-default
|
|
level = "info"
|
|
|
|
## Enable OTLP tracing.
|
|
enable_otlp_tracing = false
|
|
|
|
## The OTLP tracing endpoint.
|
|
otlp_endpoint = "http://localhost:4318/v1/traces"
|
|
|
|
## Whether to append logs to stdout.
|
|
append_stdout = true
|
|
|
|
## Whether to write logs to files in `dir`.
|
|
enable_file_logging = true
|
|
|
|
## The log format. Can be `text`/`json`.
|
|
log_format = "text"
|
|
|
|
## The maximum amount of log files.
|
|
max_log_files = 720
|
|
|
|
## Whether to enable per-region metrics.
|
|
## Default to false.
|
|
enable_per_region_metrics = false
|
|
|
|
## The OTLP tracing export protocol. Can be `grpc`/`http`.
|
|
otlp_export_protocol = "http"
|
|
|
|
## Additional OTLP headers, only valid when using OTLP http
|
|
[logging.otlp_headers]
|
|
## @toml2docs:none-default
|
|
#Authorization = "Bearer my-token"
|
|
## @toml2docs:none-default
|
|
#Database = "My database"
|
|
|
|
## The percentage of tracing will be sampled and exported.
|
|
## Valid range `[0, 1]`, 1 means all traces are sampled, 0 means all traces are not sampled, the default value is 1.
|
|
## ratio > 1 are treated as 1. Fractions < 0 are treated as 0
|
|
[logging.tracing_sample_ratio]
|
|
default_ratio = 1.0
|
|
|
|
## The slow query log options.
|
|
[slow_query]
|
|
## Whether to enable slow query log.
|
|
enable = true
|
|
|
|
## The record type of slow queries. It can be `system_table` or `log`.
|
|
## If `system_table` is selected, the slow queries will be recorded in a system table `greptime_private.slow_queries`.
|
|
## If `log` is selected, the slow queries will be logged in a log file `greptimedb-slow-queries.*`.
|
|
record_type = "system_table"
|
|
|
|
## The threshold of slow query. It can be human readable time string, for example: `10s`, `100ms`, `1s`.
|
|
threshold = "30s"
|
|
|
|
## The sampling ratio of slow query log. The value should be in the range of (0, 1]. For example, `0.1` means 10% of the slow queries will be logged and `1.0` means all slow queries will be logged.
|
|
sample_ratio = 1.0
|
|
|
|
## The TTL of the `slow_queries` system table. Default is `90d` when `record_type` is `system_table`.
|
|
ttl = "90d"
|
|
|
|
## The tracing options. Only effect when compiled with `tokio-console` feature.
|
|
#+ [tracing]
|
|
## The tokio console address.
|
|
## @toml2docs:none-default
|
|
#+ tokio_console_addr = "127.0.0.1"
|
|
|
|
## The memory options.
|
|
[memory]
|
|
## Whether to enable heap profiling activation during startup.
|
|
## When enabled, heap profiling will be activated if the `MALLOC_CONF` environment variable
|
|
## is set to "prof:true,prof_active:false". The official image adds this env variable.
|
|
## Default is true.
|
|
enable_heap_profiling = true
|
|
|
|
## Configuration options for the event recorder.
|
|
[event_recorder]
|
|
## TTL for the events table that will be used to store the events. Default is `90d`.
|
|
ttl = "90d"
|
|
## Event types to record. Current available event type: `admin_function`.
|
|
## When omitted, all current and future event types are recorded.
|
|
## Set to an empty array to disable event recording.
|
|
#+ event_types = ["admin_function"]
|