Skip to content

Commit 56f2c6c

Browse files
committed
refactor(metrics): rename crate from torrust-tracker-metrics to torrust-metrics
Closes torrust#1819. Subissue SI-08 of EPIC torrust#1669. - Rename `name` in `packages/metrics/Cargo.toml` to `torrust-metrics`. - Update dependency key in 7 dependent `Cargo.toml` files. - Update all Rust source `torrust_tracker_metrics::` references to `torrust_metrics::`. - Update prose in `AGENTS.md` and `packages/metrics/README.md` to remove tracker-specific framing. - Update EPIC torrust#1669 Package Inventory and Desired Package State tables; mark SI-08 DONE.
1 parent 3b9875d commit 56f2c6c

48 files changed

Lines changed: 173 additions & 172 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ All packages live under `packages/`. The workspace version is `3.0.0-develop`.
7070
| `http-protocol` | `bittorrent-http-tracker-protocol` | `*-protocol` | HTTP tracker protocol (BEP 3/23) parsing |
7171
| `http-tracker-core` | `bittorrent-http-tracker-core` | `*-core` | HTTP-specific tracker domain logic |
7272
| `located-error` | `torrust-tracker-located-error` | utilities | Diagnostic errors with source locations |
73-
| `metrics` | `torrust-tracker-metrics` | domain | Prometheus metrics integration |
73+
| `metrics` | `torrust-metrics` | domain | Prometheus metrics integration |
7474
| `peer-id` | `bittorrent-peer-id` | domain | Peer ID parsing and formatting utilities |
7575
| `primitives` | `torrust-tracker-primitives` | domain | Core domain types (InfoHash, PeerId, ...) |
7676
| `rest-tracker-api-client` | `torrust-tracker-rest-api-client` | client tools | REST API client library |

Cargo.lock

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/issues/open/1669-overhaul-packages/EPIC.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ The workspace currently contains **27 packages** (including the root `torrust-tr
6060

6161
| Published on crates.io | Crate Name | Folder |
6262
| ---------------------- | ------------------------ | ---------------- |
63+
| No | `torrust-metrics` | `metrics` |
6364
| No | `torrust-net-primitives` | `net-primitives` |
6465
| No | `torrust-server-lib` | `server-lib` |
6566

@@ -77,7 +78,6 @@ The workspace currently contains **27 packages** (including the root `torrust-tr
7778
| Yes | `torrust-tracker-contrib-bencode` | `contrib/bencode` |
7879
| No | `torrust-tracker-events` | `events` |
7980
| Yes | `torrust-tracker-located-error` | `located-error` |
80-
| No | `torrust-tracker-metrics` | `metrics` |
8181
| Yes | `torrust-tracker-primitives` | `primitives` |
8282
| No | `torrust-tracker-rest-api-client` | `rest-tracker-api-client` |
8383
| No | `torrust-tracker-rest-api-core` | `rest-tracker-api-core` |
@@ -120,7 +120,7 @@ destination group with a "Renamed from …" note.
120120
| Yes | `torrust-clock` | `clock` | Renamed from `torrust-tracker-clock` |
121121
| Yes | `torrust-located-error` | `located-error` | Renamed from `torrust-tracker-located-error` |
122122
| Yes | `torrust-net-primitives` | `net-primitives` | New package (created by SI-05) |
123-
| No | `torrust-metrics` | `metrics` | Renamed from `torrust-tracker-metrics` |
123+
| No | `torrust-metrics` | `metrics` | |
124124

125125
### `torrust-tracker-` prefix
126126

@@ -214,7 +214,7 @@ Status: TODO unless noted. `SI-XX` = recommended implementation sequence number.
214214
- [x] SI-05 — [#1797](https://github.com/torrust/torrust-tracker/issues/1797) Create `torrust-net-primitives` and move `ServiceBinding` from `torrust-tracker-primitives` _(Rule M + new package; no blockers)_
215215
- [x] SI-06 — [#1813](https://github.com/torrust/torrust-tracker/issues/1813) Resolve `bittorrent-tracker-core``torrust-tracker-rest-api-client` layer violation _(Rule M; prerequisite for `bittorrent-tracker-core` extraction)_
216216
- [x] SI-07 — [#1816](https://github.com/torrust/torrust-tracker/issues/1816) Align `torrust-` prefix: rename 7 tracker-specific packages to `torrust-tracker-` _(Rule U; no blockers)_
217-
- [ ] SI-08 — [#1819](https://github.com/torrust/torrust-tracker/issues/1819) Rename `torrust-tracker-metrics` to `torrust-metrics` _(Rule U; no blockers)_
217+
- [x] SI-08 — [#1819](https://github.com/torrust/torrust-tracker/issues/1819) Rename `torrust-tracker-metrics` to `torrust-metrics` _(Rule U; no blockers)_
218218
- [ ] SI-09 — Rename `torrust-tracker-clock` to `torrust-clock` _(Rule P; no blockers)_
219219
- [ ] SI-10 — Rename `torrust-tracker-located-error` to `torrust-located-error` _(Rule P; no blockers)_
220220
- [ ] SI-11 — Update all package READMEs _(documentation; after SI-07–SI-10; before SI-12)_
@@ -234,7 +234,7 @@ Details:
234234
| SI-05 | [#1797](https://github.com/torrust/torrust-tracker/issues/1797) — Create `torrust-net-primitives` and move `ServiceBinding` from `torrust-tracker-primitives` | [docs/issues/open/1797-1669-05-create-torrust-net-primitives-and-move-service-binding.md](../../open/1797-1669-05-create-torrust-net-primitives-and-move-service-binding.md) | TODO | Rule M + new package; generic networking type; breaks server-lib → tracker-primitives dep |
235235
| SI-06 | [#1813](https://github.com/torrust/torrust-tracker/issues/1813) — Resolve `bittorrent-tracker-core``torrust-tracker-rest-api-client` layer violation | [docs/issues/closed/1813-1669-06-resolve-bittorrent-tracker-core-rest-api-layer-violation.md](../../closed/1813-1669-06-resolve-bittorrent-tracker-core-rest-api-layer-violation.md) | DONE | Rule M; stale unused dev dep removed in PR #1804; unblocks `bittorrent-tracker-core` extraction |
236236
| SI-07 | [#1816](https://github.com/torrust/torrust-tracker/issues/1816) — Align `torrust-` prefix: rename 7 tracker-specific packages to `torrust-tracker-` | [docs/issues/open/1816-1669-07-align-torrust-prefix-rename-tracker-specific-packages.md](../../open/1816-1669-07-align-torrust-prefix-rename-tracker-specific-packages.md) | DONE | Rule U; none of the 7 are published; pure workspace rename; no blockers |
237-
| SI-08 | [#1819](https://github.com/torrust/torrust-tracker/issues/1819) — Rename `torrust-tracker-metrics` to `torrust-metrics` | [docs/issues/open/1819-1669-08-rename-torrust-tracker-metrics-to-torrust-metrics.md](../../open/1819-1669-08-rename-torrust-tracker-metrics-to-torrust-metrics.md) | TODO | Rule U; not yet published; no blockers; prerequisite for SI-14 |
237+
| SI-08 | [#1819](https://github.com/torrust/torrust-tracker/issues/1819) — Rename `torrust-tracker-metrics` to `torrust-metrics` | [docs/issues/open/1819-1669-08-rename-torrust-tracker-metrics-to-torrust-metrics.md](../../open/1819-1669-08-rename-torrust-tracker-metrics-to-torrust-metrics.md) | DONE | Rule U; not yet published; no blockers; prerequisite for SI-14 |
238238
| SI-09 | #TBD — Rename `torrust-tracker-clock` to `torrust-clock` | [docs/issues/drafts/1669-09-rename-torrust-tracker-clock-to-torrust-clock.md](../../drafts/1669-09-rename-torrust-tracker-clock-to-torrust-clock.md) | TODO | Rule P; published on crates.io; no blockers; prerequisite for SI-13 |
239239
| SI-10 | #TBD — Rename `torrust-tracker-located-error` to `torrust-located-error` | [docs/issues/drafts/1669-10-rename-torrust-tracker-located-error-to-torrust-located-error.md](../../drafts/1669-10-rename-torrust-tracker-located-error-to-torrust-located-error.md) | TODO | Rule P; published on crates.io; no blockers |
240240
| SI-11 | #TBD — Update all package READMEs | [docs/issues/drafts/1669-11-update-all-package-readmes.md](../../drafts/1669-11-update-all-package-readmes.md) | TODO | Documentation; requires SI-07–SI-10; before SI-12 |

docs/issues/open/1819-1669-08-rename-torrust-tracker-metrics-to-torrust-metrics.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.
7676

7777
| ID | Status | Task | Notes / Expected Output |
7878
| --- | ------ | --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
79-
| T1 | TODO | Rename `name` in `packages/metrics/Cargo.toml` | `name = "torrust-metrics"` |
80-
| T2 | TODO | Update root `Cargo.toml` workspace dependency key | `torrust-metrics = { version = ..., path = "packages/metrics" }` |
81-
| T3 | TODO | Update all dependent package `Cargo.toml` files (7 packages) | Replace `torrust-tracker-metrics` key with `torrust-metrics` |
82-
| T4 | TODO | Update Rust source `use` / path references (`torrust_tracker_metrics::``torrust_metrics::`) | Affects package sources and integration tests |
83-
| T5 | TODO | Update prose in `packages/AGENTS.md`, `AGENTS.md`, `docs/packages.md`, `packages/metrics/README.md` | Crate name and any inline code snippets |
84-
| T6 | TODO | Run `cargo build --workspace` and `cargo test --workspace` | Clean build and all tests pass |
85-
| T7 | TODO | Run `linter all` | Exit code `0` |
86-
| T8 | TODO | Update EPIC #1669 `Package Inventory` and `Desired Package State` tables | Move `torrust-metrics` from `torrust-tracker-` to `torrust-`; drop `Renamed from` note |
79+
| T1 | DONE | Rename `name` in `packages/metrics/Cargo.toml` | `name = "torrust-metrics"` |
80+
| T2 | DONE | Update root `Cargo.toml` workspace dependency key | `torrust-metrics = { version = ..., path = "packages/metrics" }` |
81+
| T3 | DONE | Update all dependent package `Cargo.toml` files (7 packages) | Replace `torrust-tracker-metrics` key with `torrust-metrics` |
82+
| T4 | DONE | Update Rust source `use` / path references (`torrust_tracker_metrics::``torrust_metrics::`) | Affects package sources and integration tests |
83+
| T5 | DONE | Update prose in `packages/AGENTS.md`, `AGENTS.md`, `docs/packages.md`, `packages/metrics/README.md` | Crate name and any inline code snippets |
84+
| T6 | DONE | Run `cargo build --workspace` and `cargo test --workspace` | Clean build and all tests pass |
85+
| T7 | DONE | Run `linter all` | Exit code `0` |
86+
| T8 | DONE | Update EPIC #1669 `Package Inventory` and `Desired Package State` tables | Move `torrust-metrics` from `torrust-tracker-` to `torrust-`; drop `Renamed from` note |
8787

8888
**Dependent packages to update in T3** (7 files):
8989

@@ -103,8 +103,8 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.
103103
- [x] Spec reviewed and approved by user/maintainer
104104
- [x] GitHub issue created and issue number added to this spec
105105
- [x] Spec moved to `docs/issues/open/` with issue number prefix
106-
- [ ] Implementation completed
107-
- [ ] Automatic verification completed (`linter all`, `cargo test --workspace`)
106+
- [x] Implementation completed
107+
- [x] Automatic verification completed (`linter all`, `cargo test --workspace`)
108108
- [ ] Manual verification scenarios executed and recorded
109109
- [ ] Acceptance criteria reviewed after implementation and updated with evidence
110110
- [ ] EPIC #1669 Active Subissues table updated to `DONE`
@@ -114,17 +114,18 @@ Status values: `TODO`, `IN_PROGRESS`, `BLOCKED`, `DONE`.
114114

115115
- 2026-05-15 12:00 UTC - josecelano - Spec drafted as subissue of EPIC #1669
116116
- 2026-05-21 UTC - josecelano - GitHub issue #1819 created; spec moved to open/
117+
- 2026-05-21 UTC - josecelano - Implementation complete; build and tests pass; linter all passes
117118

118119
## Acceptance Criteria
119120

120-
- [ ] `packages/metrics/Cargo.toml` declares `name = "torrust-metrics"`.
121-
- [ ] No `Cargo.toml` file in the workspace references `torrust-tracker-metrics`.
122-
- [ ] No Rust source file in the workspace uses `torrust_tracker_metrics::`.
123-
- [ ] `cargo build --workspace` succeeds with zero errors.
124-
- [ ] `cargo test --workspace` passes with zero failures.
125-
- [ ] `linter all` exits with code `0`.
126-
- [ ] `packages/AGENTS.md`, `AGENTS.md`, `docs/packages.md`, and `packages/metrics/README.md` reflect the new crate name.
127-
- [ ] EPIC #1669 `Desired Package State` table lists `torrust-metrics` in the `torrust-` section.
121+
- [x] `packages/metrics/Cargo.toml` declares `name = "torrust-metrics"`.
122+
- [x] No `Cargo.toml` file in the workspace references `torrust-tracker-metrics`.
123+
- [x] No Rust source file in the workspace uses `torrust_tracker_metrics::`.
124+
- [x] `cargo build --workspace` succeeds with zero errors.
125+
- [x] `cargo test --workspace` passes with zero failures.
126+
- [x] `linter all` exits with code `0`.
127+
- [x] `packages/AGENTS.md`, `AGENTS.md`, `docs/packages.md`, and `packages/metrics/README.md` reflect the new crate name.
128+
- [x] EPIC #1669 `Desired Package State` table lists `torrust-metrics` in the `torrust-` section.
128129

129130
## Verification Plan
130131

packages/axum-rest-tracker-api-server/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ torrust-tracker-rest-api-core = { version = "3.0.0-develop", path = "../rest-tra
3636
torrust-server-lib = { version = "3.0.0-develop", path = "../server-lib" }
3737
torrust-tracker-clock = { version = "3.0.0-develop", path = "../clock" }
3838
torrust-tracker-configuration = { version = "3.0.0-develop", path = "../configuration" }
39-
torrust-tracker-metrics = { version = "3.0.0-develop", path = "../metrics" }
39+
torrust-metrics = { version = "3.0.0-develop", path = "../metrics" }
4040
torrust-net-primitives = { version = "3.0.0-develop", path = "../net-primitives" }
4141
torrust-tracker-primitives = { version = "3.0.0-develop", path = "../primitives" }
4242
torrust-tracker-swarm-coordination-registry = { version = "3.0.0-develop", path = "../swarm-coordination-registry" }

packages/axum-rest-tracker-api-server/src/v1/context/stats/resources.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! API resources for the [`stats`](crate::v1::context::stats)
22
//! API context.
33
use serde::{Deserialize, Serialize};
4-
use torrust_tracker_metrics::metric_collection::MetricCollection;
4+
use torrust_metrics::metric_collection::MetricCollection;
55
use torrust_tracker_rest_api_core::statistics::services::{TrackerLabeledMetrics, TrackerMetrics};
66

77
/// It contains all the statistics generated by the tracker.

packages/axum-rest-tracker-api-server/src/v1/context/stats/responses.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//! API responses for the [`stats`](crate::v1::context::stats)
22
//! API context.
33
use axum::response::{IntoResponse, Json, Response};
4-
use torrust_tracker_metrics::prometheus::PrometheusSerializable;
4+
use torrust_metrics::prometheus::PrometheusSerializable;
55
use torrust_tracker_rest_api_core::statistics::services::{TrackerLabeledMetrics, TrackerMetrics};
66

77
use super::resources::{LabeledStats, Stats};

0 commit comments

Comments
 (0)