Metadata-Version: 2.1
Name: alpacloud_promls
Version: 0.2.0
Summary: A visualiser for available Prometheus metrics
Author: Daniel Goldman
License: Round Robin 2.0.0
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Utilities
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: click>=8.0.3
Requires-Dist: mypy~=1.16.1
Requires-Dist: requests~=2.32
Requires-Dist: textual~=5.2.0
Requires-Dist: types-PyYAML
Requires-Dist: types-requests

# promls : Explore Prometheus metrics

`promls` lets you explore prometheus metrics for your services. Target the metrics endpoint of your service and search for relevant metrics.

## Usage

### CLI

`promls` has cli modes. Filter for metrics by name, path, any field, or a fuzzy match.

```shell
> promls name --filter cpu http://localhost:9402/metrics
process_cpu_seconds_total (counter) Total user and system CPU time spent in seconds.
```

You can output the metrics in several formats:
- flat: a compact list, useful for humans
  ```text
  process_cpu_seconds_total (counter) Total user and system CPU time spent in seconds.
  ```
- json: for scripting
  ```json
  {
  "process_cpu_seconds_total": {
      "name": "process_cpu_seconds_total",
      "help": "Total user and system CPU time spent in seconds.",
      "type": "counter"
    }
  }
  ```
- tree: use the words as nodes in a tree
  ```text
  process
    cpu
      seconds
        total : process_cpu_seconds_total (counter) Total user and system CPU time spent in seconds.
  ```
- full: like the prometheus metric format
  ```text
  # HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
  # TYPE process_cpu_seconds_total counter
  process_cpu_seconds_total

  ```

### TUI

Interactively filter and explore the metrics.
![browse.png](browse.png)

## Bibliography

- [Prometheus metric format](https://docs.google.com/document/d/1ZjyKiKxZV83VI9ZKAXRGKaUKK2BIWCT7oiGBKDBpjEY/mobilebasic) : Actual grammar for Prometheus metrics
