hertzbeat icon indicating copy to clipboard operation
hertzbeat copied to clipboard

[Task]Support Apache Doris as a time-series database for log.

Open zqr10159 opened this issue 10 months ago • 3 comments

Description

Requirements:

  1. 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.
  2. Implement an optional automatic log data expiration feature.
  3. Implement identical log collection and query functionality to the existing Greptimedb, ensuring seamless user switching (module located in hertzbeat-log).
  4. 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 avatar Jan 09 '26 00:01 zqr10159

@zqr10159 Hi, I'd like to give it a try, could you please assign this issue to me? tks!

Saramanda9988 avatar Jan 09 '26 08:01 Saramanda9988

@Saramanda9988 Looking forward to your contribution

CrazyBeeline avatar Jan 09 '26 10:01 CrazyBeeline

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.java provides a complete reference implementation with saveLogData(), queryLogsByMultipleConditions(), batchDeleteLogs(), etc.
  • Interface contracts: HistoryDataReader.java and HistoryDataWriter.java define the exact methods to implement
  • Data model: LogEntry.java (OpenTelemetry standard) defines the log structure your table schema should map to

Suggested implementation path:

  1. Create DorisDataStorage.java extending AbstractHistoryDataStorage
  2. Use Doris Stream Load API for writes and MySQL JDBC for queries
  3. Add DorisProperties.java for configuration (JDBC URL, Stream Load URL, credentials, TTL)
  4. 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.

DanielCarter-stack avatar Jan 13 '26 12:01 DanielCarter-stack