mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-07-04 13:00:38 +00:00
* feat: expose region read load through Prometheus metrics and heartbeat Introduce region-level query load tracking (CPU time and scanned bytes) collected by `RegionScanExec`, exposed via Prometheus metrics and optionally reported through heartbeat region stats. - **Region metrics** (`src/mito2/src/metrics.rs`, `src/store-api/src/metrics.rs`): Add `greptime_mito_region_query_cpu_time`, `greptime_mito_region_query_scanned_bytes`, and `greptime_mito_region_written_bytes_since_open` gauge metrics. - **MitoRegion** (`src/mito2/src/region.rs`, `src/mito2/src/region/opener.rs`, `src/mito2/src/region_write_ctx.rs`): Replace `AtomicU64` `written_bytes` with `IntGauge`; add `query_cpu_time`/`query_scanned_bytes` fields with lifecycle management (init, reset, remove-on-drop). - **RegionStatistic** (`src/store-api/src/region_engine.rs`, `src/store-api/src/storage/requests.rs`): Add `query_cpu_time` and `query_scanned_bytes` fields. - **Metric-engine** (`src/metric-engine/src/utils.rs`): Aggregate query load from metadata and data regions. - **Heartbeat** (`src/datanode/src/heartbeat.rs`, `src/common/meta/src/datanode.rs`): Relay region query load via heartbeat `RegionStat`; add test. - **Query engine** (`src/query/src/options.rs`, `src/query/src/query_engine/state.rs`, `src/query/src/datafusion.rs`, `src/query/src/dist_plan/merge_scan.rs`, `src/query/src/dist_plan/analyzer.rs`, `src/query/src/dummy_catalog.rs`): Add `enable_region_query_load_report` config; wire `RegionScanExec` to accumulate CPU time and scanned bytes. - **Table scan** (`src/table/src/table/scan.rs`, `src/table/src/table/metrics.rs`): Wire table scan metrics. - **Config** (`config/standalone.example.toml`, `config/datanode.example.toml`, `config/frontend.example.toml`, `config/config.md`): Add example config and documentation for `enable_region_query_load_report`. - **Tests** (`src/mito2/src/engine/basic_test.rs`, `src/mito2/src/engine/close_test.rs`, `src/cmd/tests/load_config_test.rs`, `src/flow/src/adapter.rs`): Add unit tests for region query load reporting and metric cleanup on region close; set default config values. Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * feat: move region read load report config from query layer to mito engine Move the `enable_region_query_load_report` setting from query-level config (`QueryOptions`/`DistPlannerOptions`) into the mito2 storage engine config (`MitoConfig`), and expose it through the `RegionScanner` trait instead of `ScanRequest`/`PrepareRequest`. - Mito config: `src/mito2/src/config.rs`, `src/mito2/src/engine.rs` - Scan region plumbing: `src/mito2/src/read/scan_region.rs` - RegionScanner trait: `src/store-api/src/region_engine.rs` - Scanner impls: `src/mito2/src/read/seq_scan.rs`, `src/mito2/src/read/series_scan.rs`, `src/mito2/src/read/unordered_scan.rs` - RegionScanExec: `src/table/src/table/scan.rs` - Removed from query layer: `src/query/src/options.rs`, `src/query/src/dist_plan/analyzer.rs`, `src/query/src/query_engine/state.rs`, `src/query/src/datafusion.rs`, `src/query/src/dummy_catalog.rs` - Removed from test/config: `src/query/src/dist_plan/analyzer/test.rs`, `src/flow/src/adapter.rs`, `src/cmd/tests/load_config_test.rs`, `src/store-api/src/storage/requests.rs` - Config docs: `config/config.md`, `config/datanode.example.toml`, `config/frontend.example.toml`, `config/standalone.example.toml` Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * feat: move region query load report config from MitoConfig to LoggingOptions Relocate the `enable_region_query_load_report` setting from `MitoConfig` to `LoggingOptions` (as `enable_per_region_metrics`), and thread it into `MitoEngineBuilder` instead of reading from the engine config directly. This makes the region read-load reporting a per-node logging/observability concern rather than a per-engine storage setting. - `config/config.md` - `config/datanode.example.toml` - `config/standalone.example.toml` - `src/common/telemetry/src/logging.rs` - `src/datanode/src/datanode.rs` - `src/mito2/src/config.rs` - `src/mito2/src/engine.rs` - `src/mito2/src/region.rs` Signed-off-by: Lei Huang <lei@huang.to> Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * feat: report region query load on stream drop instead of stream end Move `report_region_query_load()` from `StreamWithMetricWrapper::poll_next()` to `Drop::drop()` so that region query load is reported even when the stream is dropped prematurely (not just when fully consumed). Affected files: - `src/table/src/table/scan.rs` Signed-off-by: Lei, Huang <huanglei@qiyi.com> Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * feat: make region query load reporting configurable Introduce `enable_region_query_load_report` flag to optionally report per-region `query_cpu_time` and `query_scanned_bytes` metrics instead of always creating them. When disabled, the Prometheus gauges are not created (`None`), avoiding metric churn for workloads that do not need query-level load tracking. - `src/common/meta/src/datanode.rs` — Placeholder fields for query load - `src/mito2/src/region.rs` — Make query metrics `Option<IntGauge>`, conditional create/remove/reset - `src/mito2/src/region/opener.rs` — Thread flag through `RegionOpener` - `src/mito2/src/worker.rs` — Thread flag through `WorkerGroup`/`WorkerStarter`/`RegionWorkerLoop` - `src/mito2/src/worker/handle_catchup.rs` — Pass flag on region open - `src/mito2/src/worker/handle_create.rs` — Pass flag on region create - `src/mito2/src/worker/handle_open.rs` — Pass flag on region open - `src/mito2/src/engine.rs` — Pass flag from `MitoEngineBuilder` - `src/mito2/src/test_util.rs` — Test helpers for both modes - `src/mito2/src/engine/basic_test.rs` — Cover disabled and preserve cases - `src/mito2/src/engine/close_test.rs` — Adapt to optional metrics Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * refactor: remove elapsed_compute metric from scan stream The elapsed_compute metric conflated poll-wait time with actual CPU computation, making it misleading. Removed the metric and its recording path from StreamMetrics and StreamWithMetricWrapper. Added a test asserting that poll duration is not reported as elapsed_compute. - `src/table/src/table/metrics.rs` — removed elapsed_compute field, builder, and record_elapsed_compute method - `src/table/src/table/scan.rs` — removed record_elapsed_compute call; added SlowRecordBatchStream test helper and wrapper_poll_time_is_not_elapsed_compute test Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * feat: disable region query load report for compaction scans Compaction scans are internal operations initiated by the engine, not user queries. Disable region query load reporting when the scan input is marked as compaction to avoid misleading load metrics. - `src/mito2/src/read/scan_region.rs` — set `enable_region_query_load_report` to `false` when compaction is enabled; add unit test Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * test: add `enable_per_region_metrics` config to HTTP integration test - Enable per-region metrics config in HTTP test setup \`tests-integration/tests/http.rs\` Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * refactor: remove region query load reporting tests and helpers Remove the region query load reporting feature from the codebase, including tests, test utilities, and helper infrastructure that were part of this now-deprecated functionality. Specifically: - Remove region query load reporting tests from `src/mito2/src/engine/basic_test.rs` and `src/table/src/table/scan.rs`, and the region close metrics test from `src/mito2/src/engine/close_test.rs` - Remove region query load report test utilities and simplify engine construction helpers in `src/mito2/src/test_util.rs` Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * perf: avoid disabled region query load timing Summary: - Avoid per-poll `Instant::now` and elapsed-time accumulation when `enable_region_query_load_report` is disabled. - Keep region query-load CPU accounting active only when reporting is enabled. Files: - `src/table/src/table/scan.rs` Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * feat: move per-region query load reporting from storage to query engine Move `enable_per_region_metrics` from datanode to frontend config and migrate query load tracking (CPU time, scanned bytes) from mito2 storage engine to the query engine's distributed scan planner. The storage-level metrics plumbing and `enable_region_query_load_report` flag are removed from mito2, `ScanInput`, `ScanRegion`, and `RegionScanner`. Query-level metrics are now collected in `merge_scan.rs` via `scan_region_load`. - `src/mito2/` -- Remove `query_cpu_time`, `query_scanned_bytes` metrics, `enable_region_query_load_report` plumbing from engine, region, opener, scanner types, workers - `src/store-api/` -- Remove `query_cpu_time`, `query_scanned_bytes` from `RegionStatistic` - `src/metric-engine/` -- Remove query load fields from `get_region_statistic` - `src/query/` -- Add `enable_per_region_metrics` to `QueryOptions`; wire through planner, optimizer, merge scan with `scan_region_load` metrics - `src/frontend/` -- Pass `enable_per_region_metrics` into `QueryOptions` - `src/common/meta/` -- Remove TODO for query load fields - `config/` -- Move `enable_per_region_metrics` from datanode to frontend and standalone example configs - `src/cmd/tests/` -- Add `enable_per_region_metrics` to flownode config test - `src/flow/` -- Add `enable_per_region_metrics` default to flownode options - `src/table/` -- Remove unused query load fields from scan - `src/datanode/` -- Remove `with_enable_region_query_load_report` calls Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * refactor: remove obsolete mito write load metric Remove obsolete mito-side region written-bytes metric plumbing that is not needed by the frontend read-load reporting path. Related files: - \`src/mito2/src/metrics.rs\` - \`src/mito2/src/region.rs\` - \`src/mito2/src/region/opener.rs\` - \`src/mito2/src/region_write_ctx.rs\` - \`src/mito2/src/engine/basic_test.rs\` - \`src/mito2/src/worker.rs\` - \`src/mito2/src/config.rs\` Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * feat: change region query load metrics from gauge to counter Change `REGION_QUERY_CPU_TIME` and `REGION_QUERY_SCANNED_BYTES` from `IntGaugeVec` to `IntCounterVec` since these values are monotonically increasing and do not need gauge semantics. Update corresponding `add` calls to `inc_by` in merge scan reporting. Files: - `src/store-api/src/metrics.rs` — metric type and label changes - `src/query/src/dist_plan/merge_scan.rs` — caller adaptation Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * refactor: pass ReadItem directly to report_region_query_load Move `region_scan_load` call to the caller, so `report_region_query_load` accepts the already-computed `ReadItem` instead of `RecordBatchMetrics`. - `src/query/src/dist_plan/merge_scan.rs` — update signature, inline call, remove stale test Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * feat: ensure region query load is reported on MergeScanExec drop Remove the `enable_per_region_metrics` parameter from `report_region_query_load` so region load metrics are always emitted. Add a `Drop` impl for `MergeScanExec` that reports sub-stage metrics when the executor is dropped, covering edge cases where per-region metric emission was missed. Add a unit test verifying CPU time and scanned bytes are recorded on drop. Affected file: `src/query/src/dist_plan/merge_scan.rs` Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * fix: gate region query load reporting Guard drop-time region query load reporting with the configured per-region metrics flag. Related files: - \`src/query/src/dist_plan/merge_scan.rs\` Symbols: - \`MergeScanExec::drop\` - \`enable_per_region_metrics\` Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> * fix: clean region query load metrics on drop Remove per-region query load metric labels when a region is dropped so stale label series do not remain in the registry. Related files: - \`src/mito2/src/region.rs\` Symbols: - \`MitoRegion::drop\` - \`REGION_QUERY_CPU_TIME\` - \`REGION_QUERY_SCANNED_BYTES\` Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> --------- Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> Signed-off-by: Lei Huang <lei@huang.to> Signed-off-by: Lei, Huang <huanglei@qiyi.com>
366 lines
12 KiB
TOML
366 lines
12 KiB
TOML
## The default timezone of the server.
|
|
## @toml2docs:none-default
|
|
default_timezone = "UTC"
|
|
|
|
## The default column prefix for auto-created time index and value columns.
|
|
## @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>"
|
|
## "pbkdf2_sha256" protects passwords at rest but is not compatible with mysql_native_password.
|
|
## @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 the runtime for global write operations.
|
|
#+ compact_rt_size = 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.
|
|
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"]
|
|
## 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"
|
|
|
|
## 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
|
|
|
|
## 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
|
|
## 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
|
|
|
|
## 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 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
|
|
|
|
## 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"
|