frontend

command
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2022 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
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.

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