frontend

command
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

README

Frontend

The frontend binary is a thin query frontend for Google Cloud Managed Service for Prometheus (GMP) that looks and feels like a regular Prometheus server. It primarily serves as a target URL for a Prometheus datasource in Grafana and to access GMP via the well-known Prometheus UI.

Currently, the following API endpoints are supported:

  • api/v1/query
  • api/v1/query_range
  • api/v1/label/__name__/values

Spinup

The frontend authenticates to GMP with credentials (typically a service account) and re-exposes the JSON/HTTP API unauthenticated (or for use with a custom authentication mechanism).

A frontend instance serves read traffic for a single Google Cloud Monitoring workspace, identified by the project.

PROJECT_ID=$(gcloud config get-value core/project)
# Default gcloud credentials. Substitute for service account key in production.
CREDENTIALS=$HOME/.config/gcloud/application_default_credentials.json

For example, from this directory:

bash ../../pkg/ui/build.sh # If you want to use UI.
go run main.go \
  --web.listen-address=:19090 \
  --query.credentials-file=$CREDENTIALS \
  --query.project-id=$PROJECT_ID

Access the frontend UI in your browser at http://localhost:19090.

Docker

You can also build a docker image from source using make frontend.

Authentication

The frontend supports incoming authentication using basic auth by providing a username and password on the incoming request. These are validated against the AUTH_USERNAME and AUTH_PASSWORD environment variables, which must be set on the frontend pod.

UI Development

Refer to pkg/ui for more information on how to develop or update UI.

Documentation

Overview

A proxy that forwards incoming requests to an HTTP endpoint while authenticating it with static service account credentials or the default service account on GCE instances. It's primarily intended to authenticate Prometheus queries coming from Grafana against GMP as Grafana has no option to configure OAuth2 credentials.

Jump to

Keyboard shortcuts

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