ui

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

UI

Our goal is to provide the upstream Prometheus UI with the only change that it queries data from Google Cloud Prometheus Engine and with support for pages other than /graph removed.

Since the UI is not a public NPM package, importing the specific React components for a custom apps is very difficult. Thus we use a simpler approach where we load the upstream UI at a given version and apply a minimal set of overrides files.

How it works

Development

The sync.sh script syncs the upstream repository into build/ at a fixed git tag. All files and directories provided in override/ are copied to the web/ui/react-app path of the upstream checkout.

Invoking the sync script ensures this synchronization and runs any following command in the web/ui/react-app directory.

To initialize:

./sync.sh yarn

To run the UI locally:

./sync.sh yarn start

The webserver will proxy requests to http://localhost:9090. During development a local Prometheus server or the frontend can be run under this address for manual testing.

At build time the app is statically compiled into the ui Go package. Binaries including the UI must also host a Prometheus-compatible read API as expected by the React app.

Building

The final app is statically compiled into the Go binary for release. To generate the static asset Go file run:

./build.sh

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Assets = http.Dir("static/")

Serve assets from a static directory if they have not been compiled into the binary.

It always attempts to serve anything "static/" in the current working directory as this is for development purposes only.

Functions

func Handler

func Handler() http.Handler

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL