rustfs-obs 0.0.3

Observability and monitoring tools for RustFS, providing metrics, logging, and tracing capabilities.
Documentation
[![RustFS](https://rustfs.com/images/rustfs-github.png)](https://rustfs.com)

# RustFS Obs - Observability & Monitoring

<p align="center">
  <strong>Comprehensive observability and monitoring solution for RustFS distributed object storage</strong>
</p>

<p align="center">
  <a href="https://github.com/rustfs/rustfs/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/rustfs/rustfs/actions/workflows/ci.yml/badge.svg" /></a>
  <a href="https://docs.rustfs.com/en/">๐Ÿ“– Documentation</a>
  ยท <a href="https://github.com/rustfs/rustfs/issues">๐Ÿ› Bug Reports</a>
  ยท <a href="https://github.com/rustfs/rustfs/discussions">๐Ÿ’ฌ Discussions</a>
</p>

---

## ๐Ÿ“– Overview

**RustFS Obs** provides comprehensive observability and monitoring capabilities for the [RustFS](https://rustfs.com)
distributed object storage system. It includes metrics collection, distributed tracing, logging, alerting, and
performance monitoring to ensure optimal system operation and troubleshooting.

> **Note:** This is a critical operational submodule of RustFS that provides essential observability capabilities for
> the distributed object storage system. For the complete RustFS experience, please visit
> the [main RustFS repository]https://github.com/rustfs/rustfs.

## โœจ Features

### ๐Ÿ“Š Metrics Collection

- **Prometheus Integration**: Native Prometheus metrics export
- **Custom Metrics**: Application-specific performance metrics
- **System Metrics**: CPU, memory, disk, and network monitoring
- **Business Metrics**: Storage usage, request rates, and error tracking

### ๐Ÿ” Distributed Tracing

- **OpenTelemetry Support**: Standard distributed tracing
- **Request Tracking**: End-to-end request lifecycle tracking
- **Performance Analysis**: Latency and bottleneck identification
- **Cross-Service Correlation**: Trace requests across microservices

### ๐Ÿ“ Structured Logging

- **JSON Logging**: Machine-readable structured logs
- **Log Levels**: Configurable log levels and filtering
- **Context Propagation**: Request context in all logs
- **Log Aggregation**: Centralized log collection support

### ๐Ÿšจ Alerting & Notifications

- **Rule-Based Alerts**: Configurable alerting rules
- **Multiple Channels**: Email, Slack, webhook notifications
- **Alert Escalation**: Tiered alerting and escalation policies
- **Alert Correlation**: Group related alerts together

## ๐Ÿ“ฆ Installation

Add this to your `Cargo.toml`:

```toml
[dependencies]
rustfs-obs = "0.0.3"
```

## ๐Ÿ”ง Usage

## ๐Ÿ—๏ธ Architecture

### Observability Architecture

```
Observability Architecture:
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    Observability API                        โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚   Metrics     โ”‚   Tracing     โ”‚   Logging    โ”‚   Alerting   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚              Data Collection & Processing                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Prometheus   โ”‚  OpenTelemetry โ”‚  Structured  โ”‚  Alert Mgr  โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚              External Integrations                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
```

### Monitoring Stack

| Component  | Purpose             | Integration                   |
|------------|---------------------|-------------------------------|
| Prometheus | Metrics storage     | Pull-based metrics collection |
| Jaeger     | Distributed tracing | OpenTelemetry traces          |
| Grafana    | Visualization       | Dashboards and alerts         |
| ELK Stack  | Log aggregation     | Structured log processing     |

## ๐Ÿงช Testing

Run the test suite:

```bash
# Run all tests
cargo test

# Test metrics collection
cargo test metrics

# Test tracing functionality
cargo test tracing

# Test alerting
cargo test alerting

# Integration tests
cargo test --test integration
```

## ๐Ÿ“‹ Requirements

- **Rust**: 1.70.0 or later
- **Platforms**: Linux, macOS, Windows
- **External Services**: Prometheus, Jaeger (optional)
- **Network**: HTTP endpoint exposure capability

## ๐ŸŒ Related Projects

This module is part of the RustFS ecosystem:

- [RustFS Main]https://github.com/rustfs/rustfs - Core distributed storage system
- [RustFS Common]../common - Common types and utilities
- [RustFS Config]../config - Configuration management

## ๐Ÿ“š Documentation

For comprehensive documentation, visit:

- [RustFS Documentation]https://docs.rustfs.com
- [Obs API Reference]https://docs.rustfs.com/obs/
- [Monitoring Guide]https://docs.rustfs.com/monitoring/

## ๐Ÿ”— Links

- [Documentation]https://docs.rustfs.com - Complete RustFS manual
- [Changelog]https://github.com/rustfs/rustfs/releases - Release notes and updates
- [GitHub Discussions]https://github.com/rustfs/rustfs/discussions - Community support

## ๐Ÿค Contributing

We welcome contributions! Please see
our [Contributing Guide](https://github.com/rustfs/rustfs/blob/main/CONTRIBUTING.md) for details.

## ๐Ÿ“„ License

Licensed under the Apache License, Version 2.0. See [LICENSE](https://github.com/rustfs/rustfs/blob/main/LICENSE) for
details.

---

<p align="center">
  <strong>RustFS</strong> is a trademark of RustFS, Inc.<br>
  All other trademarks are the property of their respective owners.
</p>

<p align="center">
  Made with ๐Ÿ“Š by the RustFS Team
</p>