meta table into alerts table (#5390)
#5253 The overall goal of this PR is to migrate alerts data out of `meta` table into `alerts` table. To accomplish this three main changes are made. Unfortunately, all three of these changes need to be synchronized and submitted in the same PR. 1. A new migration script is added to - Parse alerts JSON currently stored in the `meta` table into Rust models for alerts. These Rust models are isolated to the migration script since they represent the schema of alerts as they are stored in the `meta` table before this migration executes. - Convert those Rust models into Sea ORM entities for alerts. - Insert all the Sea ORM entities for alerts into the new `alerts` table. 2. Create get/put/delete/list methods for accessing the data in the `alerts` table - These functions use SeaORM to query and update the database. - These functions must also convert between SeaORM alert entities and the application's current data model for alerts (as defined in `config::meta::alerts`. - It's entirely expected that the models inside `config::meta::alerts` will change over time. When this happens in the future, developers will need to update the transformation functions between SeaORM alert entities and the models in `config::meta::alerts`. Luckily, the compiler should help to direct developers to where these transformation functions need to be updated. 3. Update the old logic in `/src/service/db/alerts.rs` that previously read and wrote alerts to the `meta` table so that it now reads and writes alerts to the `alerts` table. - The methods for accessing the `meta` table included logic for triggering "cache update events" to the cluster coordinator and for sending events to the super cluster queue. Since the new logic accesses the `alerts` table rather than the `meta` table, this logic for emitting events had to be reproduced. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `ListAlertsParams` struct for flexible querying of alerts. - Enhanced `TriggerCondition` struct with new timing parameters. - Added new error variants for improved error handling in alert management. - Created a comprehensive alert management system with CRUD operations. - Added integration tests for various functionalities related to alerts and dashboards. - Introduced a new `Alerts` variant in the `FolderType` enum for better folder management. - **Bug Fixes** - Improved error handling for folder deletion when alerts are present. - **Documentation** - Updated documentation for several functions to clarify their scope and functionality. - **Chores** - Added new dependencies to support additional functionality. - Introduced migration scripts for database schema changes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
🚀 10x easier, 🚀 140x lower storage cost, 🚀 high performance, 🚀 petabyte scale - Elasticsearch/Splunk/Datadog alternative for 🚀 (logs, metrics, traces).
OpenObserve (O2 for short) is a cloud-native observability platform built specifically for logs, metrics, traces, analytics, RUM (Real User Monitoring - Performance, Errors, Session Replay) designed to work at petabyte scale.
It is straightforward and easy to operate, in contrast to Elasticsearch, which requires understanding and tuning numerous settings. Get OpenObserve up and running in under 2 minutes.
OpenObserve serves as a seamless replacement for Elasticsearch for users who ingest data using APIs and perform searches. OpenObserve comes with its own user interface, eliminating the need for separate installation.
You can reduce your log storage costs by ~140x compared to Elasticsearch by using OpenObserve. Below, we present the results from pushing logs from our production Kubernetes cluster to both Elasticsearch and OpenObserve using Fluent Bit.
🎥 Introduction Video
🌟 Features:
- Logs, Metrics, Traces: Comprehensive support for various data types.
- OpenTelemetry Support: Full compatibility with OTLP for logs, metrics, and traces.
- Real User Monitoring (RUM): Includes performance tracking, error logging, and session replay.
- Dashboards, Reports, Alerts: Features over 18 different chart types for comprehensive data visualization for on-the-fly analysis and reporting along with alerting.
- Pipelines: Enrich, redact, reduce, normalize data on the fly. Stream processing for logs to metrics and more.
- Advanced Embedded GUI: Intuitive and user-friendly interface.
- SQL and PromQL Support: Query logs and traces with SQL, and metrics with SQL and PromQL.
- Single Binary or HA Installation: Install using a single binary for small deployments or in HA mode for large deployments.
- Versatile Storage Options: Supports local disk, S3, MinIO, GCS, Azure Blob Storage.
- High Availability and Clustering: Ensures reliable and scalable performance.
- Dynamic Schema: Adapts to your data structure seamlessly.
- Built-in Authentication: Secure and ready to use.
- Ease of Operation: Designed for simplicity and efficiency.
- Seamless Upgrades: Hassle-free updates.
- Multilingual UI: Supports 11 languages, including English, Spanish, German, French, Chinese, and more.
For a full list of features, check the documentation.
⚡️ Quick start
🐳 Docker:
docker run -d \
--name openobserve \
-v $PWD/data:/data \
-p 5080:5080 \
-e ZO_ROOT_USER_EMAIL="root@example.com" \
-e ZO_ROOT_USER_PASSWORD="Complexpass#123" \
public.ecr.aws/zinclabs/openobserve:latest
🐙 Docker Compose:
services:
openobserve:
image: public.ecr.aws/zinclabs/openobserve:latest
restart: unless-stopped
environment:
ZO_ROOT_USER_EMAIL: "root@example.com"
ZO_ROOT_USER_PASSWORD: "Complexpass#123"
ports:
- "5080:5080"
volumes:
- data:/data
volumes:
data:
For other ways to quickly install OpenObserve or use OpenObserve cloud, check quickstart documentation.
For installing OpenObserve in HA mode, check HA deployment documentation.
📷 Screenshots
Home
Logs
Traces (OpenTelemetry)
Golden metrics based on traces

Visualizations and Dashboards
Front end monitoring
Alerts
Streams
Ingestion
SBOM
Software Bill of Materials for OpenObserve
Rust
SBOM can be found here. You can analyze it using dependency track.
In order to generate the SBOM, you can use the following commands:
Install cargo-cyclonedx:
cargo install cargo-cyclonedx
Generate the SBOM:
cargo-cyclonedx cyclonedx
JavaScript
SBOM can be found here. You can analyze it using dependency track.
In order to generate the SBOM, you can use the following commands:
Install cyclonedx-npm:
npm install --global @cyclonedx/cyclonedx-npm
Generate the SBOM:
cd web
cyclonedx-npm > sbom.json
⚖️ License
OpenObserve is licensed under the AGPL-3.0 license. For more details, see the LICENSE.
🌍 Community
🔗 Join OpenObserve community on Slack
Easiest way to get support is to join the Slack channel.
📱 Join OpenObserve community on WeChat















