hertzbeat
hertzbeat copied to clipboard
[Task]Support Apache Doris as a time-series database for log.
Description
Requirements:
- Refer to https://doris.apache.org/docs/4.x/log-storage-analysis and create tables based on the recommended content and Apache Hetzbeat's actual implementation.
- Implement an optional automatic log data expiration feature.
- Implement identical log collection and query functionality to the existing Greptimedb, ensuring seamless user switching (module located in hertzbeat-log).
- Log writing is recommended to use stream load mode; log queries are recommended to utilize database connection pools and MySQL JDBC.
Task List
No response
@zqr10159 Hi, I'd like to give it a try, could you please assign this issue to me? tks!
@Saramanda9988 Looking forward to your contribution
Thanks for the proposal. Apache Doris as a log storage backend is indeed not currently implemented in HertzBeat—only GreptimeDB exists for this purpose.
The good news is that the warehouse module is well-architected for this extension:
- Template available:
hertzbeat-warehouse/src/main/java/org/apache/hertzbeat/warehouse/store/history/tsdb/greptime/GreptimeDbDataStorage.javaprovides a complete reference implementation withsaveLogData(),queryLogsByMultipleConditions(),batchDeleteLogs(), etc. - Interface contracts:
HistoryDataReader.javaandHistoryDataWriter.javadefine the exact methods to implement - Data model:
LogEntry.java(OpenTelemetry standard) defines the log structure your table schema should map to
Suggested implementation path:
- Create
DorisDataStorage.javaextendingAbstractHistoryDataStorage - Use Doris Stream Load API for writes and MySQL JDBC for queries
- Add
DorisProperties.javafor configuration (JDBC URL, Stream Load URL, credentials, TTL) - Implement TTL via Doris table properties or application-level cleanup
A few clarifying questions:
- Should TTL be enforced database-side (Doris table properties) or application-side (scheduled tasks)?
- Any requirements for Doris-specific features like rollup tables for log aggregation?
- Should both standalone and cluster Doris modes be supported?
This would be a valuable addition given the 12 existing TSDB implementations in the codebase prove the architecture's extensibility.