Metadata-Version: 2.4
Name: prescale-agent
Version: 0.2.1
Summary: Metrics collection agent for Prescale - Predictive Infrastructure Intelligence Platform
Author-email: Prescale Platform <maintainers@prescale.dev>
License: Apache-2.0
Project-URL: Homepage, https://github.com/pyjeebz/prescale
Project-URL: Repository, https://github.com/pyjeebz/prescale
Keywords: kubernetes,metrics,monitoring,prometheus,observability
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.24.0
Requires-Dist: click>=8.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: psutil>=5.9.0
Provides-Extra: prometheus
Requires-Dist: prometheus-client>=0.17.0; extra == "prometheus"
Provides-Extra: datadog
Requires-Dist: datadog-api-client>=2.0.0; extra == "datadog"
Provides-Extra: aws
Requires-Dist: boto3>=1.26.0; extra == "aws"
Provides-Extra: azure
Requires-Dist: azure-identity>=1.12.0; extra == "azure"
Requires-Dist: azure-mgmt-monitor>=6.0.0; extra == "azure"
Provides-Extra: gcp
Requires-Dist: google-cloud-monitoring>=2.15.0; extra == "gcp"
Provides-Extra: kubernetes
Requires-Dist: kubernetes>=28.0.0; extra == "kubernetes"
Provides-Extra: all
Requires-Dist: prescale-agent[aws,azure,datadog,gcp,kubernetes,prometheus]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"

# Prescale Agent

Metrics collection agent for [Prescale](https://github.com/pyjeebz/prescale) - Predictive Infrastructure Intelligence Platform.

## Installation

```bash
# Base installation (system metrics + Prometheus)
pip install prescale-agent

# With specific backends
pip install prescale-agent[gcp]      # + GCP Cloud Monitoring
pip install prescale-agent[aws]      # + AWS CloudWatch
pip install prescale-agent[azure]    # + Azure Monitor
pip install prescale-agent[datadog]  # + Datadog
pip install prescale-agent[all]      # All backends
```

## Quick Start

```bash
# Generate configuration file
prescale-agent init

# List available metric sources
prescale-agent sources

# Test configured sources
prescale-agent test

# Run the agent
prescale-agent run --config prescale-agent.yaml
```

## Configuration

Create a `prescale-agent.yaml` file:

```yaml
agent:
  collection_interval: 60
  log_level: INFO

sources:
  # System metrics (always available)
  - type: system
    enabled: true
    config:
      collect_cpu: true
      collect_memory: true

  # GCP Cloud Monitoring
  - type: gcp-monitoring
    enabled: true
    config:
      project_id: your-gcp-project
      metrics:
        - kubernetes.io/container/cpu/limit_utilization
        - kubernetes.io/container/memory/limit_utilization

  # Prometheus
  - type: prometheus
    enabled: false
    config:
      url: http://prometheus:9090
      queries:
        - name: cpu_usage
          query: rate(container_cpu_usage_seconds_total[5m])

prescale:
  endpoint: http://prescale-inference:8080
```

## Supported Sources

| Source | Description | Extra Install |
|--------|-------------|---------------|
| `system` | Local CPU, memory, disk via psutil | Built-in |
| `prometheus` | Query Prometheus server | Built-in |
| `gcp-monitoring` | GCP Cloud Monitoring | `[gcp]` |
| `cloudwatch` | AWS CloudWatch | `[aws]` |
| `azure-monitor` | Azure Monitor | `[azure]` |
| `datadog` | Datadog API | `[datadog]` |

## CLI Commands

```bash
prescale-agent init              # Generate config file
prescale-agent run               # Start collecting metrics
prescale-agent run --once        # Single collection (testing)
prescale-agent run --deployment my-deployment  # Associate with deployment
prescale-agent sources           # List available sources
prescale-agent test              # Test source connections
prescale-agent status            # Show agent status
```

## Environment Variables

| Variable | Description |
|----------|-------------|
| `PRESCALE_CONFIG_FILE` | Path to config file (default: `./prescale-agent.yaml`) |
| `PRESCALE_ENDPOINT` | Prescale inference endpoint |
| `PRESCALE_API_KEY` | API key for authentication |

## License

Apache 2.0 - See [LICENSE](../LICENSE)
