observatorium / obsctl

A cli to interact with Observatorium instances.
Apache License 2.0
10 stars 14 forks source link

Add `obsctl metrics ui` command #43

Closed saswatamcode closed 2 years ago

saswatamcode commented 2 years ago

This PR adds a new command obsctl metrics ui, which starts up a proxy server using current "context".

The proxy server runs on localhost:8080 by default and proxies requests to the current "context" Observatorium API. And it prefixes /api/metrics/v1 path for each request it proxies. This ensures that Thanos Query UI is able to load all the information it needs to display by making requests to localhost.

Server is shutdown when a cancellation signal is received.

This can also be extended to other resource types like logs and traces later on!