Skip to content

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

Closed
317787106 wants to merge 5 commits into
developfrom
feature/delete_influxdb
Closed

refactor(metrics): delete influxdb storage for metrics#73
317787106 wants to merge 5 commits into
developfrom
feature/delete_influxdb

Conversation

@317787106

@317787106 317787106 commented Apr 17, 2026

Copy link
Copy Markdown
Owner

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.

Summary by CodeRabbit

  • Refactor
    • Removed InfluxDB metrics storage integration, including dependencies, configuration options, and initialization code. Prometheus remains the supported metrics collection method.

@coderabbitai

coderabbitai Bot commented Apr 17, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@317787106 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 29 minutes and 28 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 125926bd-3234-43a0-a62a-cffac58b3180

📥 Commits

Reviewing files that changed from the base of the PR and between e054559 and 77c0305.

📒 Files selected for processing (1)
  • common/src/main/resources/reference.conf
📝 Walkthrough

Walkthrough

This pull request removes InfluxDB metrics storage integration from java-tron, eliminating associated configuration parameters, dependencies, and initialization logic. Prometheus metrics remain as the standardized monitoring interface.

Changes

Cohort / File(s) Summary
Parameter & Configuration Definitions
common/src/main/java/org/tron/common/parameter/CommonParameter.java, common/src/main/java/org/tron/core/config/args/MetricsConfig.java
Removed InfluxDB-related public fields including metricsStorageEnable, influxDbIp, influxDbPort, influxDbDatabase, metricsReportInterval, and the nested InfluxDbConfig class. Prometheus configuration remains unchanged.
Configuration Application
framework/src/main/java/org/tron/core/config/args/Args.java
Removed InfluxDB parameter propagation from applyMetricsConfig method; Prometheus settings continue to be applied.
Metrics Implementation
framework/src/main/java/org/tron/core/metrics/MetricsUtil.java
Removed public init() method that instantiated and scheduled InfluxDB ScheduledReporter, including HTTP client construction and metric filtering logic.
Application Startup
framework/src/main/java/org/tron/common/application/ApplicationImpl.java
Removed MetricsUtil import and MetricsUtil.init() invocation from startup() method.
Build Configuration
framework/build.gradle
Removed io.dropwizard.metrics:metrics-influxdb v0.8.2 implementation dependency.
Configuration Files
framework/src/main/resources/config.conf, common/src/main/resources/reference.conf
Removed storageEnable flag and entire influxdb configuration block (ip, port, database, metricsReportInterval) from node.metrics section; removed metricsEnable default flag from node section.
Tests
framework/src/test/java/org/tron/common/ParameterTest.java
Removed test assertions and setters for InfluxDB-related CommonParameter fields in testCommonParameter.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 InfluxDB bids farewell, no more tales to tell,
Prometheus takes the stage, our metrics' golden stage,
Configuration simplified, complexity pacified,
One monitoring solution—clean and bright,
Monitoring made right! 📊✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'refactor(metrics): delete influxdb storage for metrics' accurately summarizes the primary change: removing InfluxDB from the metrics system.
Linked Issues check ✅ Passed All code changes align with issue #6665 objectives: InfluxDB logic removed from MetricsUtil, configuration deleted, dependency removed, and Prometheus retained as the sole monitoring interface.
Out of Scope Changes check ✅ Passed All changes are directly in-scope and necessary for removing InfluxDB support; no unrelated modifications detected across all affected files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 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.

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

Copy link
Copy Markdown

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
@317787106 317787106 changed the title feat(metrics): delete influxdb storage for metrics refactor(metrics): delete influxdb storage for metrics Apr 25, 2026
@317787106 317787106 force-pushed the feature/delete_influxdb branch from 4d0eb4e to 20c0de8 Compare April 28, 2026 07:43
@317787106 317787106 closed this May 5, 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