Skip to content

SI-18: Extract torrust-metrics to a standalone repository #1882

@josecelano

Description

@josecelano

Goal

Move the torrust-metrics crate out of the torrust-tracker workspace into its own standalone repository so that it can be maintained, versioned, and published independently of the tracker.

Background

The torrust-metrics package provides Prometheus metrics integration types for the tracker. Its relevant internal dependency is torrust-clock, which is already published on crates.io. After the torrust-tracker-metrics -> torrust-metrics rename (SI-08, #1819), extraction is unblocked. Publishing the renamed crate on crates.io is the first technical step of the extraction itself (T1b), following the project policy of deferring publication as late as possible.

Prerequisite: Metrics rename subissue (#1819) complete (SI-08 all tasks done).

This issue is a subissue of EPIC #1669 (Overhaul: Packages).

Scope

In Scope

  • Create a new standalone repository torrust/torrust-metrics in the Torrust GitHub organization.
  • Move packages/metrics/ to the new repository, preserving git history (using git filter-repo).
  • Verify the standalone repository builds and tests pass independently.
  • Set up CI in the new repository (mirror the relevant CI workflows from the tracker repo).
  • Update all 7 workspace consumers to reference torrust-metrics as a crates.io version dependency instead of a path dependency (see list below).
  • Update the root Cargo.toml workspace dep registration for torrust-metrics.
  • Remove packages/metrics from the workspace members list in root Cargo.toml.
  • Delete the packages/metrics/ directory from the tracker repository.
  • Update prose references in packages/AGENTS.md, AGENTS.md, and docs/packages.md (move torrust-metrics to the "Extracted" section).

Out of Scope

  • Changes to the crate's API or behaviour.
  • Updating downstream repositories outside the Torrust organization.

Workspace consumers to migrate

The following 7 packages must have their torrust-metrics dep changed from a path dep to a crates.io version dep:

  • packages/swarm-coordination-registry/Cargo.toml
  • packages/rest-tracker-api-core/Cargo.toml
  • packages/udp-tracker-core/Cargo.toml
  • packages/axum-rest-tracker-api-server/Cargo.toml
  • packages/udp-tracker-server/Cargo.toml
  • packages/tracker-core/Cargo.toml
  • packages/http-tracker-core/Cargo.toml

Acceptance Criteria

  • A standalone repository torrust/torrust-metrics exists on GitHub.
  • The repository contains the full git history for packages/metrics/.
  • CI in the new repository passes.
  • No Cargo.toml in the tracker workspace references torrust-metrics with a path dep.
  • packages/metrics is absent from the [workspace] members list in root Cargo.toml.
  • The packages/metrics/ directory no longer exists in the tracker repository.
  • cargo build --workspace in the tracker repository succeeds with zero errors.
  • cargo test --workspace in the tracker repository passes with zero failures.
  • linter all exits with code 0.
  • packages/AGENTS.md, AGENTS.md, and docs/packages.md reflect the extraction.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions