Skip to content

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

Open
317787106 wants to merge 5 commits intotronprotocol:developfrom
317787106:feature/delete_influxdb
Open

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

Conversation

@317787106
Copy link
Copy Markdown
Collaborator

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 #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 (excludes node.metrics) 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Drop InfluxDB support for metrics storage

2 participants