Skip to content

Conversation

@zqr10159
Copy link
Member

Make greptime available as a grafana data source.
image

Checklist

  • I have read the Contributing Guide
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Add or update API

  • I have added the necessary e2e tests and all cases have passed.

zqr10159 added 30 commits April 23, 2024 10:35
zqr10159 added 5 commits May 23, 2025 15:55
…ource support for GreptimeDB

- Update dashboard creation to remove 'id' field and handle errors more gracefully
- Enhance dashboard deletion to check for success and handle not found errors
- Add support for creating datasources with additional configuration for GreptimeDB
- Refactor datasource creation to use a new DatasourceRequest class
- Update GreptimeDB table naming convention and add database parameter to queries
- Remove unused code and comments
- Consolidate Prometheus collection logic- Add TODO for future refactoring consideration
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

license-eye has checked 3235 files.

Valid Invalid Ignored Fixed
1649 1 1585 0
Click to see the invalid file list
  • hertzbeat-collector/hertzbeat-collector-basic/src/main/java/org/apache/hertzbeat/collector/collect/prometheus/PrometheusCollect.java
Use this command to fix any missing license headers
```bash

docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

</details>

zqr10159 and others added 3 commits May 26, 2025 16:35
…g/apache/hertzbeat/collector/collect/prometheus/PrometheusCollect.java

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Logic <[email protected]>
- Remove unused code and comments
- Consolidate Prometheus collection logic- Add TODO for future refactoring consideration
Calvin979 and others added 5 commits May 27, 2025 12:11
- Enhance code readability in DashboardService by formatting and simplifying URL construction
- Add class-level documentation for DatasourceService and DatasourceRequest
- Update method-level documentation in DatasourceService
- Add class-level documentation for PrometheusProxyConfig
- Remove unused import statements
@tomsun28
Copy link
Member

👍hi, what the different between PrometheusProxyCollectImpl and PrometheusAutoCollectImpl, can you share the design of this piece??

@zqr10159
Copy link
Member Author

👍hi, what the different between PrometheusProxyCollectImpl and PrometheusAutoCollectImpl, can you share the design of this piece??

  1. Auto Mode (PrometheusAutoCollectImpl)
    How it works:
    HertzBeat’s collector directly scrapes the Prometheus-compatible endpoints (such as node_exporter, blackbox_exporter, or custom Prometheus endpoints).
    Use case:
    Use this mode for standard Prometheus monitoring scenarios, where HertzBeat collects metrics directly from the target application or exporter.
    Mechanism:
    The collector parses the Prometheus metrics format and processes the data itself.
  2. Proxy Mode (PrometheusProxyCollectImpl)
    How it works:
    HertzBeat acts as a proxy that forwards requests to a time-series database backend (like GreptimeDB or VictoriaMetrics) that supports the Prometheus API. Instead of scraping exporters directly, it queries historical or real-time metrics from the database via API.
    Use case:
    Use this mode when integrating with large-scale metric storage (such as GreptimeDB or VictoriaMetrics). It's especially useful if you want to use HertzBeat as a unified data source for Grafana dashboards, querying through the database rather than directly from exporters.
    Mechanism:
    HertzBeat does not parse/export data itself, but relays requests and responses between Grafana (or another client) and the backend database.

Currently, the proxy code is marked as todo because for the current architecture, although proxy can reduce the load on hertzbeat, direct forwarding to the database makes alerting impossible. I'm sure he'll be useful as a future feature for lossless collection of metrics!

Copy link
Member

@tomsun28 tomsun28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zqr10159 zqr10159 merged commit e1affb1 into master Jun 3, 2025
3 checks passed
@zqr10159 zqr10159 deleted the greptime-grafana branch June 3, 2025 15:37
@github-project-automation github-project-automation bot moved this from To do to Done in Apache HertzBeat Jun 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants