https://github.com/jaxxstorm/met
Dynamically render prometheus compatible metrics in your terminal
https://github.com/jaxxstorm/met
Last synced: 3 months ago
JSON representation
Dynamically render prometheus compatible metrics in your terminal
- Host: GitHub
- URL: https://github.com/jaxxstorm/met
- Owner: jaxxstorm
- License: mit
- Created: 2025-01-29T00:42:49.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-03-13T22:34:12.000Z (4 months ago)
- Last Synced: 2025-03-27T18:12:42.459Z (3 months ago)
- Language: Go
- Size: 629 KB
- Stars: 17
- Watchers: 2
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Met
Met is a small CLI tool that will periodically scrape a metrics compatible endpoint and return the values interactively via [Bubbletea](https://github.com/charmbracelet/bubbletea)
Simply point it at an endpoint, and you'll get a nice periodically refreshed output.
Counter metrics will accumulate over time, whereas Gauge metrics will show the last returned value.

## Including and Excluding Metrics
`met` has flags for controlling the metrics you'd like to display.
`--include` does a substring match on metric names and _includes_ them.
`--exclude` does a substring match on metric names and _excludes_ them.
`--labels` will examine metric labels and only show the ones with a string match.### Examples
Given the following metrics
```
# TYPE tailscaled_advertised_routes gauge
# HELP tailscaled_advertised_routes Number of advertised network routes (e.g. by a subnet router)
tailscaled_advertised_routes 0
# TYPE tailscaled_approved_routes gauge
# HELP tailscaled_approved_routes Number of approved network routes (e.g. by a subnet router)
tailscaled_approved_routes 0
# TYPE tailscaled_inbound_bytes_total counter
# HELP tailscaled_inbound_bytes_total Counts the number of bytes received from other peers
tailscaled_inbound_bytes_total{path="derp"} 13972
tailscaled_inbound_bytes_total{path="direct_ipv4"} 13997076
tailscaled_inbound_bytes_total{path="direct_ipv6"} 74484000
# TYPE tailscaled_inbound_dropped_packets_total counter
# HELP tailscaled_inbound_dropped_packets_total Counts the number of dropped packets received by the node from other peers
# TYPE tailscaled_inbound_packets_total counter
# HELP tailscaled_inbound_packets_total Counts the number of packets received from other peers
tailscaled_inbound_packets_total{path="derp"} 101
tailscaled_inbound_packets_total{path="direct_ipv4"} 72229
tailscaled_inbound_packets_total{path="direct_ipv6"} 64962
# TYPE tailscaled_outbound_bytes_total counter
# HELP tailscaled_outbound_bytes_total Counts the number of bytes sent to other peers
tailscaled_outbound_bytes_total{path="derp"} 34988
tailscaled_outbound_bytes_total{path="direct_ipv4"} 9677128
tailscaled_outbound_bytes_total{path="direct_ipv6"} 10987440
# TYPE tailscaled_outbound_dropped_packets_total counter
# HELP tailscaled_outbound_dropped_packets_total Counts the number of packets dropped while being sent to other peers
tailscaled_outbound_dropped_packets_total{reason="error"} 0
# TYPE tailscaled_outbound_packets_total counter
# HELP tailscaled_outbound_packets_total Counts the number of packets sent to other peers
tailscaled_outbound_packets_total{path="derp"} 204
tailscaled_outbound_packets_total{path="direct_ipv4"} 69930
tailscaled_outbound_packets_total{path="direct_ipv6"} 22211
```#### Include only specific metrics
```
met --endpoint http://100.100.100.100/metrics --include advertised
Prometheus metrics from http://100.100.100.100/metrics (every 2s)+----------------------------------+-------+----------+------------+
| KEY | VALUE | INC DIFF | TOTAL DIFF |
+----------------------------------+-------+----------+------------+
| > tailscaled_advertised_routes{} | 0.00 | -- | -- |
+----------------------------------+-------+----------+------------+Page 1-1 of 1 total metrics
Use ↑/↓ to move selection, PgUp/PgDn to scroll.
Press q or Ctrl+C to quit.
```#### Exclude metrics
```
met --endpoint http://100.100.100.100/metrics --exclude inbound,outbound
Prometheus metrics from http://100.100.100.100/metrics (every 2s)+----------------------------------+-------+----------+------------+
| KEY | VALUE | INC DIFF | TOTAL DIFF |
+----------------------------------+-------+----------+------------+
| > tailscaled_advertised_routes{} | 0.00 | -- | -- |
| tailscaled_approved_routes{} | 0.00 | -- | -- |
+----------------------------------+-------+----------+------------+Page 1-2 of 2 total metrics
Use ↑/↓ to move selection, PgUp/PgDn to scroll.
Press q or Ctrl+C to quit.
```#### Labels
```
met --endpoint http://100.100.100.100/metrics --labels path=derp
Prometheus metrics from http://100.100.100.100/metrics (every 2s)+--------------------------------------------------+----------+-----------+------------+
| KEY | VALUE | INC DIFF | TOTAL DIFF |
+--------------------------------------------------+----------+-----------+------------+
| > tailscaled_inbound_bytes_total{path="derp"} | 13972.00 | +13972.00 | 34988.00 |
| tailscaled_inbound_packets_total{path="derp"} | 101.00 | +101.00 | 204.00 |
| tailscaled_outbound_bytes_total{path="derp"} | 34988.00 | +21016.00 | 34988.00 |
| tailscaled_outbound_packets_total{path="derp"} | 204.00 | +103.00 | 204.00 |
+--------------------------------------------------+----------+-----------+------------+
```