Skip to content

feat(metrics): delete influxdb storage for metrics#73

Open
317787106 wants to merge 2 commits intodevelopfrom
feature/delete_influxdb
Open

feat(metrics): delete influxdb storage for metrics#73
317787106 wants to merge 2 commits intodevelopfrom
feature/delete_influxdb

Conversation

@317787106
Copy link
Copy Markdown
Owner

@317787106 317787106 commented Apr 17, 2026

What does this PR do?

Removes InfluxDB as a metrics storage backend, along with all related configuration, dependencies, and code. Prometheus remains as the sole monitoring interface.

Closes tronprotocol#6665.

Why are these changes required?

java-tron currently maintains two parallel monitoring systems: Prometheus (org.tron.common.prometheus) and MetricsUtil + InfluxDB (org.tron.core.metrics.MetricsUtil). Keeping both creates fragmented metric definitions, duplicated maintenance, and operational overhead. InfluxDB support has the following specific drawbacks:

  1. Fragmented metrics: Two systems produce inconsistent metric definitions with different granularity and labelling, increasing cognitive burden for developers and operators.
  2. Incomplete coverage: MetricsUtil lacks dimensions such as per-peer, per-API, chain sync, DB, and JVM metrics that Prometheus already covers.
  3. Operational complexity: InfluxDB requires a separate deployment, has low community adoption compared to the Prometheus/Grafana ecosystem, and has no mature dashboards or alerting rules for java-tron.
  4. Stability risk: InfluxDB write failures could affect node stability; removing the dependency eliminates this external coupling entirely.

Prometheus, combined with tron-docker, provides a production-ready monitoring solution that supersedes InfluxDB for all known use cases.

Changes:

  • framework/build.gradle: Removed com.github.davidb:metrics-influxdb:0.8.2 dependency.
  • MetricsUtil: Deleted the init() method and all InfluxDB reporter logic (InfluxdbReporter, InfluxdbProtocols).
  • ApplicationImpl: Removed MetricsUtil.init() call from startup().
  • CommonParameter: Removed metricsStorageEnable, influxDbIp, influxDbPort, influxDbDatabase, and metricsReportInterval fields.
  • Args: Removed initRocksDbBackupProperty-style parsing of all METRICS_INFLUXDB_* and METRICS_STORAGE_ENABLE config keys.
  • ConfigKey: Removed METRICS_STORAGE_ENABLE, METRICS_INFLUXDB_IP, METRICS_INFLUXDB_PORT, METRICS_INFLUXDB_DATABASE, METRICS_REPORT_INTERVAL constants.
  • config.conf: Removed the storageEnable and influxdb { ... } block from node.metrics.
  • ParameterTest: Removed assertions for the deleted InfluxDB parameter fields.

Configuration change: The following config block is no longer read and should be removed from node config files:

node.metrics {
  storageEnable = false
  influxdb {
    ip = ""
    port = 8086
    database = ""
    metricsReportInterval = 10
  }
}

This PR has been tested by:

  • Unit Tests

Follow up

Operators currently using InfluxDB for metrics should migrate to Prometheus. The tron-docker metric_monitor provides a ready-to-use Prometheus + Grafana setup.

Extra details

The /wallet/monitor/getstatsinfo HTTP endpoint remains available as an auxiliary interface (served by MetricsUtil counters/meters/histograms via dropwizard metrics-core), but it is no longer the recommended primary monitoring path.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 17, 2026

📝 Walkthrough

Walkthrough

Removed InfluxDB/metrics storage integration: config keys, CommonParameter fields, reporter initialization and dependency were deleted; Prometheus-related metrics remain unchanged.

Changes

Cohort / File(s) Summary
Parameter Definitions
common/src/main/java/org/tron/common/parameter/CommonParameter.java
Deleted InfluxDB/metrics storage fields (metricsStorageEnable, influxDbIp, influxDbPort, influxDbDatabase, metricsReportInterval) and their accessors.
Config Keys & Loading
framework/src/main/java/org/tron/core/config/args/ConfigKey.java, framework/src/main/java/org/tron/core/config/args/Args.java
Removed InfluxDB-related ConfigKey constants and removed assignments that loaded those InfluxDB/metrics storage values from config.
Metrics Utility & Startup
framework/src/main/java/org/tron/core/metrics/MetricsUtil.java, framework/src/main/java/org/tron/common/application/ApplicationImpl.java
Removed MetricsUtil.init() and all InfluxDB reporter setup; removed call to initialize metrics reporter from application startup.
Build & Defaults
framework/build.gradle, framework/src/main/resources/config.conf
Removed metrics-influxdb dependency and deleted the node.metrics.storageEnable and node.metrics.influxdb { ... } configuration block.
Tests
framework/src/test/java/org/tron/common/ParameterTest.java
Removed assertions and setters validating the removed InfluxDB/metrics storage fields; remaining tests for other metrics fields unchanged.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through code with nimble feet,

Cleared the Influx weeds from every sheet,
Prometheus stays in morning light,
The code feels lighter — hop, delight! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(metrics): delete influxdb storage for metrics' clearly and specifically describes the main change: removal of InfluxDB-based metrics storage from the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/delete_influxdb

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 7 files

@317787106 317787106 changed the title feature(metrics): delete influxdb storage for metrics feat(metrics): delete influxdb storage for metrics Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Drop InfluxDB support for metrics storage

1 participant