You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename the Cargo crate torrust-tracker-metrics to torrust-metrics to reflect that it is a generic Prometheus metrics integration that can be used by any Rust project, not only the tracker.
Background
The metrics package (folder packages/metrics) provides Prometheus metrics support. It contains no tracker-specific domain logic and its usefulness extends beyond this repository — for example, torrust-index could benefit from the same metrics infrastructure rather than reinventing it.
The torrust-tracker- prefix implies a tracker-only scope that does not reflect the crate's actual purpose. The rename:
Makes the crate identity match its scope.
Signals to downstream users that it is reusable outside the tracker.
Prepares it for potential extraction to a standalone repository in a future cycle (see the SI-14 subissue of EPIC Overhaul: Packages #1669).
The current crate name torrust-tracker-metrics is not published on crates.io (as of May 2026), so the rename does not require handling a previously published name.
This issue is a subissue of EPIC #1669 (Overhaul: Packages), SI-08.
Scope
In Scope
Rename the crate name field in packages/metrics/Cargo.toml.
Update all Cargo.toml files in the workspace that reference torrust-tracker-metrics as a dependency (root Cargo.toml + all dependent packages).
Update all Rust source files that use the crate by its underscore-converted identifier (torrust_tracker_metrics::) to use torrust_metrics::.
Update prose references in packages/AGENTS.md, AGENTS.md, docs/packages.md, and the metrics package README.md.
Verify the workspace builds and all tests pass.
Out of Scope
Moving the crate to a separate repository (see SI-14).
Changes to the crate's API or behaviour.
Publishing the crate on crates.io.
Updating downstream repositories.
Implementation Plan
ID
Task
Notes / Expected Output
T1
Rename name in packages/metrics/Cargo.toml
name = "torrust-metrics"
T2
Update root Cargo.toml workspace dependency key
torrust-metrics = { version = ..., path = "packages/metrics" }
T3
Update all dependent package Cargo.toml files (7 packages)
Replace torrust-tracker-metrics key with torrust-metrics
T4
Update Rust source use / path references (torrust_tracker_metrics:: → torrust_metrics::)
Affects package sources and integration tests
T5
Update prose in packages/AGENTS.md, AGENTS.md, docs/packages.md, packages/metrics/README.md
Crate name and any inline code snippets
T6
Run cargo build --workspace and cargo test --workspace
Clean build and all tests pass
T7
Run linter all
Exit code 0
T8
Update EPIC #1669Package Inventory and Desired Package State tables
Move torrust-metrics to torrust- section; drop Renamed from note
Dependent packages to update in T3 (7 files):
packages/axum-rest-tracker-api-server/Cargo.toml
packages/http-tracker-core/Cargo.toml
packages/rest-tracker-api-core/Cargo.toml
packages/swarm-coordination-registry/Cargo.toml
packages/tracker-core/Cargo.toml
packages/udp-tracker-core/Cargo.toml
packages/udp-tracker-server/Cargo.toml
Acceptance Criteria
packages/metrics/Cargo.toml declares name = "torrust-metrics".
No Cargo.toml file in the workspace references torrust-tracker-metrics.
No Rust source file in the workspace uses torrust_tracker_metrics::.
cargo build --workspace succeeds with zero errors.
cargo test --workspace passes with zero failures.
linter all exits with code 0.
packages/AGENTS.md, AGENTS.md, docs/packages.md, and packages/metrics/README.md reflect the new crate name.
EPIC Overhaul: Packages #1669Desired Package State table lists torrust-metrics in the torrust- section.
Goal
Rename the Cargo crate
torrust-tracker-metricstotorrust-metricsto reflect that it is a generic Prometheus metrics integration that can be used by any Rust project, not only the tracker.Background
The
metricspackage (folderpackages/metrics) provides Prometheus metrics support. It contains no tracker-specific domain logic and its usefulness extends beyond this repository — for example,torrust-indexcould benefit from the same metrics infrastructure rather than reinventing it.The
torrust-tracker-prefix implies a tracker-only scope that does not reflect the crate's actual purpose. The rename:The current crate name
torrust-tracker-metricsis not published on crates.io (as of May 2026), so the rename does not require handling a previously published name.This issue is a subissue of EPIC #1669 (Overhaul: Packages), SI-08.
Scope
In Scope
namefield inpackages/metrics/Cargo.toml.Cargo.tomlfiles in the workspace that referencetorrust-tracker-metricsas a dependency (rootCargo.toml+ all dependent packages).torrust_tracker_metrics::) to usetorrust_metrics::.packages/AGENTS.md,AGENTS.md,docs/packages.md, and themetricspackageREADME.md.Out of Scope
Implementation Plan
nameinpackages/metrics/Cargo.tomlname = "torrust-metrics"Cargo.tomlworkspace dependency keytorrust-metrics = { version = ..., path = "packages/metrics" }Cargo.tomlfiles (7 packages)torrust-tracker-metricskey withtorrust-metricsuse/ path references (torrust_tracker_metrics::→torrust_metrics::)packages/AGENTS.md,AGENTS.md,docs/packages.md,packages/metrics/README.mdcargo build --workspaceandcargo test --workspacelinter all0Package InventoryandDesired Package Statetablestorrust-metricstotorrust-section; dropRenamed fromnoteDependent packages to update in T3 (7 files):
packages/axum-rest-tracker-api-server/Cargo.tomlpackages/http-tracker-core/Cargo.tomlpackages/rest-tracker-api-core/Cargo.tomlpackages/swarm-coordination-registry/Cargo.tomlpackages/tracker-core/Cargo.tomlpackages/udp-tracker-core/Cargo.tomlpackages/udp-tracker-server/Cargo.tomlAcceptance Criteria
packages/metrics/Cargo.tomldeclaresname = "torrust-metrics".Cargo.tomlfile in the workspace referencestorrust-tracker-metrics.torrust_tracker_metrics::.cargo build --workspacesucceeds with zero errors.cargo test --workspacepasses with zero failures.linter allexits with code0.packages/AGENTS.md,AGENTS.md,docs/packages.md, andpackages/metrics/README.mdreflect the new crate name.Desired Package Statetable liststorrust-metricsin thetorrust-section.Related to #1669