* fix(query): validate DistAnalyzeExec child count (#8510) * fix(query): validate DistAnalyzeExec child count Signed-off-by: discord9 <discord9@163.com> * test(query): avoid implicit clone lint Signed-off-by: discord9 <discord9@163.com> --------- Signed-off-by: discord9 <discord9@163.com> (cherry picked from commit623145e635) * fix: avoid panic when negating MIN-valued literals (#8484) Value::try_negative and the temporal negative() helpers negated with raw unary minus, which panics (debug) or wraps (release) on MIN values such as -i64::MIN. try_negative already returns None for the unsigned arms; make the signed and temporal arms honor that contract via checked_neg / checked_negative so a MIN literal produces a clean error instead. Signed-off-by: raphaelroshan <raphaelroshan@gmail.com> (cherry picked from commit1a476f76e2) * fix: preserve nulls in timestamp arrays (#8508) Signed-off-by: discord9 <discord9@163.com> (cherry picked from commitc7bcddacc5) * fix: timestamp display precision should respect column schema (#8227) (#8238) * fix: timestamp display precision should respect column schema (#8227) Previously, the MySQL writer converted timestamps to NaiveDateTime via to_chrono_datetime_with_timezone(), then passed the NaiveDateTime to write_col(). NaiveDateTime::Display uses a fixed 6-digit fractional- second format, causing: - TIMESTAMP(3) to show '.195000' instead of '.195' - TIMESTAMP(9) to show '.195123' instead of '.195123456' Fix: use Timestamp::to_timezone_aware_string() directly, which formats with chrono's '%.f' specifier — it strips trailing zeros and preserves full nanosecond fidelity based on the actual stored unit. Also add comprehensive unit tests in mysql_writer_test.rs covering: - All concrete data type → MySQL column type mappings - UNSIGNED_FLAG propagation for unsigned integer types - Timestamp precision for all four units (0/3/6/9 decimal places) - Edge cases: zero subseconds, trailing-zero stripping, Unix epoch, negative timestamps, and timezone offset shifts - Column-def ordering, empty schema, and decimal variants Signed-off-by: Divyansh <anshmcs@gmail.com> * perf: reuse format buffer for timestamp serialization to avoid per-row heap allocation Signed-off-by: Divyansh <anshmcs@gmail.com> * refactor: rename test variable and update visibility of create_mysql_column function Signed-off-by: Divyansh <anshmcs@gmail.com> * test: fix timestamp test constants and add sqlness case for display precision - Correct the base epoch constant: 1_748_836_200 is 2025-06-02, not 2026-06-02; use 1_780_372_200 to match the documented instant. - Fix subsecond expectations: chrono's %.f renders fractional digits in groups of 3 (.100 / .010), it does not strip to .1 / .01. - Add sqlness case timestamp_precision_display reproducing issue #8227 over the MySQL protocol (TIMESTAMP(0/3/6/9) rendering). - cargo fmt reflow of create_mysql_column signature. Signed-off-by: Divyansh <anshmcs@gmail.com> * fix: support binary protocol for timestamp column Signed-off-by: Divyansh <anshmcs@gmail.com> * test: update sqlness results for new timestamp display precision Signed-off-by: Divyansh <anshmcs@gmail.com> --------- Signed-off-by: Divyansh <anshmcs@gmail.com> (cherry picked from commit1acdec9334) * fix(mito): chunk manifest object writes (#8567) Signed-off-by: WenyXu <wenymedia@gmail.com> (cherry picked from commitd1e61a4ad2) * fix: display codes in metasrv client errors (#8558) * fix: display codes in metasrv client errors Signed-off-by: evenyag <realevenyag@gmail.com> * fix: normalize meta client errors in sqlness Signed-off-by: evenyag <realevenyag@gmail.com> --------- Signed-off-by: evenyag <realevenyag@gmail.com> (cherry picked from commitb1580c98f6) * fix(mito): notify bulk writes on WAL error (#8563) * fix(mito): notify bulk writes on WAL error Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * fix(mito): move write ctx tests after items Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> * docs: mention PR template in agent guide Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> --------- Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> (cherry picked from commit25909bd1aa) * fix: ignore dropping marker during GC (#8588) Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> (cherry picked from commit036db3d1ec) * fix(query): preserve bare plan names in analyze json (#8519) Signed-off-by: discord9 <discord9@163.com> (cherry picked from commit4a0dd8f9bc) * fix(flow): lower routine batching messages to debug (#8592) fix(flow): reduce expected batching log noise Signed-off-by: discord9 <discord9@163.com> (cherry picked from commit9f5a11e82a) * fix(flow): downgrade disabled incremental checkpoint log (#8572) Signed-off-by: discord9 <discord9@163.com> (cherry picked from commit4c5be47400) * fix: demote expected remote dynamic filter misses (#8574) Signed-off-by: discord9 <discord9@163.com> (cherry picked from commit45fc51ebd2) * fix: prevent credential leaks in sanitize_connection_string (#8539) Parse PostgreSQL DSNs (URL or libpq keyword) with tokio_postgres::Config — the backend's own parser — and log its Debug, which redacts the password. This matches the backend grammar exactly (multi-host URIs, backslash escapes, any Unicode whitespace, percent-encoded query keys, and '&'/';'/ '://' inside values) rather than approximating it by hand. Other URLs are redacted via the url crate; a best-effort keyword fallback covers inputs neither parser accepts. Signed-off-by: raphaelroshan <raphaelroshan@gmail.com> (cherry picked from commite19df8960e) * fix(mito2): remove stale compaction status when next compaction is throttled (#8618) When a compaction finishes with no pending request/DDL, on_compaction_finished leaves the region's CompactionStatus in the map with no active compaction. If the worker then skips schedule_next_compaction because min_compaction_interval has not passed, the stale status is never cleaned up: all subsequent compaction requests are swallowed by the "status exists" branch (regular waiters hang, manual StrictWindow requests pend forever) and the region never compacts again until restart. Add CompactionScheduler::remove_inactive_status() and call it from handle_compaction_finished when the interval gate skips scheduling the next compaction, restoring the invariant that a status in the map always has an active compaction. Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> (cherry picked from commitd1ac9e2da7) * fix(meta): configure gRPC message limits (#8616) * fix(meta): configure gRPC message limits Signed-off-by: WenyXu <wenymedia@gmail.com> * fix(meta): preserve follower range limits Signed-off-by: WenyXu <wenymedia@gmail.com> --------- Signed-off-by: WenyXu <wenymedia@gmail.com> (cherry picked from commit82de463940) * fix(flow): convert streaming expiration to milliseconds (#8481) * fix(flow): convert streaming expiration to milliseconds Flow EXPIRE AFTER values are stored in seconds, while streaming flow timestamps and durations use milliseconds. Passing the value through unchanged expires state and limits refill scans 1000 times too early. Convert the value at streaming create and refill boundaries, reject overflow, and document the CreateFlowArgs unit. Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com> * fix(flow): reject negative streaming expiration Reject negative EXPIRE AFTER values at the streaming adapter boundary so refill ranges cannot move into the future. Keep zero valid and retain checked seconds-to-milliseconds conversion. Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com> --------- Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com> * fix: qualify scalar-subquery tables in persisted views (#8581) fix(query): traverse scalar subqueries in views Signed-off-by: discord9 <discord9@163.com> * chore: bump version Signed-off-by: WenyXu <wenymedia@gmail.com> --------- Signed-off-by: discord9 <discord9@163.com> Signed-off-by: raphaelroshan <raphaelroshan@gmail.com> Signed-off-by: Divyansh <anshmcs@gmail.com> Signed-off-by: WenyXu <wenymedia@gmail.com> Signed-off-by: evenyag <realevenyag@gmail.com> Signed-off-by: Lei, HUANG <ratuthomm@gmail.com> Signed-off-by: Lei, HUANG <mrsatangel@gmail.com> Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com> Co-authored-by: discord9 <discord9@163.com> Co-authored-by: raphaelroshan <49832307+raphaelroshan@users.noreply.github.com> Co-authored-by: Div <anshmcs@gmail.com> Co-authored-by: Yingwen <realevenyag@gmail.com> Co-authored-by: Lei, HUANG <6406592+v0y4g3r@users.noreply.github.com> Co-authored-by: QuakeWang <45645138+QuakeWang@users.noreply.github.com>
One database for metrics, logs, and traces
replacing Prometheus, Loki, and Elasticsearch
The unified OpenTelemetry backend — with SQL + PromQL on object storage.
- Introduction
- Overview
- Features
- How GreptimeDB Compares
- Architecture
- Try GreptimeDB
- Getting Started
- Build From Source
- Tools & Extensions
- Project Status
- Community
- License
- Commercial Support
- Contributing
- Acknowledgement
Introduction
GreptimeDB is an open-source observability database built for Observability 2.0 — treating metrics, logs, and traces as one unified data model (wide events) instead of three separate pillars.
Use it as the single OpenTelemetry backend — replacing Prometheus, Loki, and Elasticsearch with one database built on object storage. Query with SQL and PromQL, scale without pain, cut costs up to 50×.
Overview
A quick overview of what GreptimeDB ingests, how it connects to other systems, and what its distributed engine lets you do.
Features
| Feature | Description |
|---|---|
| Observability 2.0 native | Logs, metrics, and traces in one engine with SQL + PromQL. Native OpenTelemetry, Prometheus remote write, and Jaeger. Migrate one signal at a time, or use as a single backend. |
| Elastic compute-storage separation | Scale reads independently with horizontal replicas. Serve high-concurrency workloads from dashboards, alerting, and AI agents — without resharding or data migration. |
| Sub-second on PB–EB-scale data | Columnar engine with fulltext, inverted, and skipping indexes. Written in Rust. Designed for high-concurrency point queries, not just analytical scans. |
| 50× lower cost | Object storage (S3, GCS, Azure Blob) as primary storage, with a tiered cache (memory + local disk) to keep writes and queries fast. |
Perfect for:
- Replacing Prometheus + Loki + Elasticsearch with a single observability backend
- Scaling past Prometheus — high cardinality, long-term storage, no Thanos/Mimir overhead
- AI/agent workloads — store GenAI telemetry (OTel GenAI conventions), and serve high-concurrency reads from SRE/developer agents via horizontal read replicas
- Cutting observability costs with object storage (up to 50× savings on traces, 30% on logs)
- Edge-to-cloud observability with unified APIs on resource-constrained devices
Why Observability 2.0? Three separate databases for metrics, logs, and traces means three storage layers, three query languages, and three sets of dashboards. GreptimeDB stores all three as timestamped wide events in one columnar engine — JOIN across signals in SQL, run one stack instead of three, and ingest AI agent telemetry the same way. Read more: Observability 2.0 and the Database for It.
Learn more in Why GreptimeDB.
How GreptimeDB Compares
| Capability | GreptimeDB | Prometheus / Thanos / Mimir | Grafana Loki | Elasticsearch |
|---|---|---|---|---|
| Data types | Metrics, logs, traces | Metrics only | Logs only | Logs, traces |
| Query language | SQL + PromQL | PromQL | LogQL | Query DSL |
| Storage | Native object storage (S3, etc.) | Local disk + object storage (Thanos/Mimir) | Object storage (chunks) | Local disk |
| Scaling | Compute-storage separation, stateless nodes | Federation / Thanos / Mimir — multi-component, ops heavy | Stateless + object storage | Shard-based, ops heavy |
| Cost efficiency | Up to 50× lower storage cost | High at scale | Moderate | High (inverted index overhead) |
| OpenTelemetry | Native (metrics + logs + traces) | Partial (metrics only) | Partial (logs only) | Via instrumentation |
Benchmarks:
Architecture
GreptimeDB can run in two modes:
- Standalone — single binary for development and small deployments.
- Distributed — four components, each independently scalable:
- Frontend — protocol entry (OTel, Prometheus, MySQL/PostgreSQL, gRPC, ingestion APIs for Elasticsearch/InfluxDB/Loki) and the distributed query engine. Stateless, scales horizontally.
- Datanode — region engine with WAL, memtable, SST, cache, compaction, and indexes. Persists data to object storage. Elastic.
- Metasrv — metadata, routing, repartitioning, autopilot, and security. Backed by a pluggable KV layer (etcd or RDS).
- Flownode (optional) — continuous flow computation (streaming and materialized views).
For deeper coverage, see the architecture doc or DeepWiki.
Try GreptimeDB
For AI agents — paste this prompt into your agent:
Read https://docs.greptime.com/SKILL.md and follow the instructions
to deploy, configure, ingest, and query GreptimeDB.
docker run -p 127.0.0.1:4000-4003:4000-4003 \
-v "$(pwd)/greptimedb_data:/greptimedb_data" \
--name greptime --rm \
greptime/greptimedb:latest standalone start \
--http-addr 0.0.0.0:4000 \
--rpc-bind-addr 0.0.0.0:4001 \
--mysql-addr 0.0.0.0:4002 \
--postgres-addr 0.0.0.0:4003
Dashboard: http://localhost:4000/dashboard
Read more in the full Install Guide.
Troubleshooting:
- Cannot connect to the database? Ensure that ports
4000,4001,4002, and4003are not blocked by a firewall or used by other services. - Failed to start? Check the container logs with
docker logs greptimefor further details.
Getting Started
Build From Source
Prerequisites:
- Rust toolchain — nightly, pinned by
rust-toolchain.toml - Protobuf compiler (>= 3.15)
- C/C++ building essentials:
gcc/g++/autoconfand the glibc dev package (libc6-devon Ubuntu,glibc-develon Fedora) - Python toolchain (optional, only for some test scripts)
Build and run:
make # build greptime binary
cargo run -- standalone start # start in standalone mode
Common dev commands:
make fmt # format Rust code
make clippy # lint (fails on warnings)
make test # unit + integration tests (uses cargo-nextest)
make sqlness-test # SQL regression tests
See the Contribution Guidelines for the full developer workflow.
Tools & Extensions
- Kubernetes: GreptimeDB Operator
- Helm Charts: Greptime Helm Charts
- Dashboard: Web UI
- gRPC Ingester: Go, Java, C++, Erlang, Rust, .NET
- Grafana Data Source: GreptimeDB Grafana data source plugin
- Grafana Dashboard: Official Dashboard for monitoring
Project Status
GreptimeDB is at v1.0 GA with stable APIs and regular releases. It runs in production at scale — OceanBase Cloud operates 80+ GreptimeDB clusters managing 300 TB of logs, cutting log storage cost by 60% after migrating from Grafana Loki. See more in case studies.
Read the v1.0 highlights and 2026 roadmap, or browse the version reference.
If GreptimeDB is useful to you, please star the repo.
Community
We invite you to engage and contribute!
License
GreptimeDB is licensed under the Apache License 2.0.
Commercial Support
Running GreptimeDB in your organization? We offer enterprise add-ons, services, training, and consulting. Contact us for details.
Contributing
- Read our Contribution Guidelines.
- Explore Internal Concepts and DeepWiki.
- Pick up a good first issue and join the #contributors Slack channel.
Acknowledgement
Special thanks to all contributors! See AUTHOR.md.
- Uses Apache Arrow™ (memory model)
- Apache Parquet™ (file storage)
- Apache DataFusion™ (query engine)
- Apache OpenDAL™ (data access abstraction)
All trademarks, logos, and brand names referenced in this README and in the Overview diagram are the property of their respective owners. Their use is for identification purposes only and does not imply endorsement or affiliation.
