Skip to content

Commit 3eb96f9

Browse files
committed
docs: [#238] refactor user guide to extract Prometheus content into service-specific guide
- Created docs/user-guide/services/ directory for service documentation - Moved Prometheus configuration and usage details to services/prometheus.md - Added services/README.md explaining the directory structure and purpose - Updated main user guide to remove Prometheus-specific content - Added Services section to user guide with links to service guides - Simplified configuration examples to show only core fields This improves maintainability by: - Keeping generic deployment workflow in main guide - Isolating service-specific details in dedicated guides - Making it easier to add/remove services from the stack - Following DRY principle established in E2E testing docs
1 parent 254a9a8 commit 3eb96f9

File tree

3 files changed

+420
-29
lines changed

3 files changed

+420
-29
lines changed

docs/user-guide/README.md

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Welcome to the Torrust Tracker Deployer user guide! This guide will help you get
1010
- [Available Commands](#available-commands)
1111
- [Basic Workflows](#basic-workflows)
1212
- [Configuration](#configuration)
13+
- [Services](#services)
1314
- [Troubleshooting](#troubleshooting)
1415
- [Additional Resources](#additional-resources)
1516

@@ -236,9 +237,6 @@ The environment configuration file is in JSON format:
236237
"public_key_path": "/path/to/public/key",
237238
"username": "ssh-username",
238239
"port": 22
239-
},
240-
"prometheus": {
241-
"scrape_interval": 15
242240
}
243241
}
244242
```
@@ -274,55 +272,46 @@ The environment configuration file is in JSON format:
274272
- SSH port number
275273
- Default: `22`
276274

277-
**prometheus.scrape_interval** (optional):
275+
For service-specific configuration (Prometheus, MySQL, etc.), see the [Services](#services) section below.
278276

279-
- Metrics collection interval in seconds
280-
- Default: `15` (included in generated templates)
281-
- Prometheus service enabled by default for monitoring
282-
- To disable: Remove the entire `prometheus` section from config
277+
## Services
283278

284-
### Monitoring with Prometheus
279+
The Torrust Tracker Deployer supports optional services that can be enabled in your deployment:
285280

286-
The deployer includes Prometheus for metrics collection by default. Prometheus automatically scrapes metrics from the tracker's HTTP API endpoints.
281+
### Available Services
287282

288-
**Default Behavior**:
283+
- **[Prometheus Monitoring](services/prometheus.md)** - Metrics collection and monitoring (enabled by default)
284+
- Automatic metrics scraping from tracker API
285+
- Web UI on port 9090
286+
- Configurable scrape intervals
287+
- Can be disabled by removing from configuration
289288

290-
- Prometheus is **enabled by default** in generated environment templates
291-
- Metrics collected from both `/api/v1/stats` and `/api/v1/metrics` endpoints
292-
- Accessible via web UI on port `9090`
289+
### Adding or Removing Services
293290

294-
**Configuration**:
291+
Services are configured in your environment JSON file. To enable a service, include its configuration section. To disable it, remove the section.
292+
293+
**Example with Prometheus**:
295294

296295
```json
297296
{
297+
"environment": { "name": "my-env" },
298+
"ssh_credentials": { ... },
298299
"prometheus": {
299300
"scrape_interval": 15
300301
}
301302
}
302303
```
303304

304-
**Disabling Prometheus**:
305-
306-
To deploy without Prometheus monitoring, remove the entire `prometheus` section from your environment config:
305+
**Example without Prometheus**:
307306

308307
```json
309308
{
310309
"environment": { "name": "my-env" },
311310
"ssh_credentials": { ... }
312-
// No prometheus section = monitoring disabled
313311
}
314312
```
315313

316-
**Accessing Prometheus**:
317-
318-
After deployment, access the Prometheus UI at `http://<vm-ip>:9090` where you can:
319-
320-
- View current metrics from tracker endpoints
321-
- Query historical data
322-
- Check target health status
323-
- Explore available metrics
324-
325-
See [Prometheus Verification Guide](../e2e-testing/manual/prometheus-verification.md) for detailed verification steps.
314+
See individual service guides for detailed configuration options and verification steps.
326315

327316
### Logging Configuration
328317

docs/user-guide/services/README.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Services Documentation
2+
3+
This directory contains detailed documentation for optional services that can be included in your Torrust Tracker deployments.
4+
5+
## Purpose
6+
7+
The services documentation provides comprehensive guides for each optional service, including:
8+
9+
- Configuration options and examples
10+
- Enabling/disabling instructions
11+
- Verification and testing procedures
12+
- Troubleshooting common issues
13+
- Architecture and deployment details
14+
15+
## Available Services
16+
17+
- **[Prometheus Monitoring](prometheus.md)** - Metrics collection and monitoring service
18+
- Automatic metrics scraping from tracker API endpoints
19+
- Web UI for querying and visualizing metrics
20+
- Configurable scrape intervals
21+
- Enabled by default, can be disabled
22+
23+
## Service Organization
24+
25+
Each service guide follows a consistent structure:
26+
27+
1. **Overview** - Purpose and capabilities
28+
2. **Default Behavior** - Out-of-the-box configuration
29+
3. **Configuration** - How to configure the service
30+
4. **Disabling** - How to remove the service from deployment
31+
5. **Accessing** - How to interact with the service after deployment
32+
6. **Verification** - How to verify the service is working correctly
33+
7. **Troubleshooting** - Common issues and solutions
34+
8. **Architecture** - Technical details about deployment structure
35+
36+
## How Services Work
37+
38+
Services in the deployer are:
39+
40+
- **Optional** - Include only what you need
41+
- **Configuration-based** - Enable by adding a section to your environment JSON
42+
- **Containerized** - Each service runs in its own Docker container
43+
- **Integrated** - Automatically configured to work with the tracker
44+
45+
### Adding a Service
46+
47+
To include a service in your deployment, add its configuration section to your environment JSON file:
48+
49+
```json
50+
{
51+
"environment": {
52+
"name": "my-env"
53+
},
54+
"ssh_credentials": {
55+
"private_key_path": "~/.ssh/id_rsa",
56+
"public_key_path": "~/.ssh/id_rsa.pub",
57+
"username": "torrust"
58+
},
59+
"prometheus": {
60+
"scrape_interval": 15
61+
}
62+
}
63+
```
64+
65+
### Removing a Service
66+
67+
To exclude a service from your deployment, simply remove its configuration section:
68+
69+
```json
70+
{
71+
"environment": {
72+
"name": "my-env"
73+
},
74+
"ssh_credentials": {
75+
"private_key_path": "~/.ssh/id_rsa",
76+
"public_key_path": "~/.ssh/id_rsa.pub",
77+
"username": "torrust"
78+
}
79+
// No prometheus section = service not deployed
80+
}
81+
```
82+
83+
## Future Services
84+
85+
As the deployer evolves, additional optional services may be added to this directory:
86+
87+
- Database services (MySQL, PostgreSQL)
88+
- Reverse proxy services (Nginx, Traefik)
89+
- Logging aggregation (Loki, Elasticsearch)
90+
- Alerting services (Alertmanager)
91+
- Visualization services (Grafana)
92+
93+
## Related Documentation
94+
95+
- **[User Guide](../README.md)** - Main user guide with general configuration
96+
- **[Quick Start Guide](../quick-start.md)** - Getting started with deployments
97+
- **[Configuration Reference](../configuration/)** - Environment configuration details
98+
- **[Manual Testing Guides](../../e2e-testing/manual/)** - Service verification procedures
99+
100+
## Contributing
101+
102+
When adding new service documentation:
103+
104+
1. Follow the established structure outlined above
105+
2. Include practical examples and commands
106+
3. Provide verification steps
107+
4. Document common troubleshooting scenarios
108+
5. Update this README to list the new service
109+
6. Add cross-references to related documentation
110+
111+
See [Contributing Guidelines](../../contributing/README.md) for more details.

0 commit comments

Comments
 (0)