Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Perfloop relay

A small program you run inside your network so Perfloop can read a
Prometheus, VictoriaMetrics, or Loki that the public internet cannot reach.
This repository is the complete source of what runs there. The image Perfloop
publishes is built from it, by the workflow in this repository, and is tagged
with the commit it was built from.
A small program you run inside your network so Perfloop can read the
telemetry you keep there: metrics, logs, and profiles from providers the
public internet cannot reach. This repository is the complete source of what
runs there. The image Perfloop publishes is built from it, by the workflow in
this repository, and is tagged with the commit it was built from.

Sources the relay reads today: Prometheus, VictoriaMetrics, and Loki. Go
pprof and Pyroscope are next. Each kind is one table of read routes in
`routes.go`, and a kind the relay does not know is refused when it starts.

756 lines of Go outside tests, three runtime dependencies (`coder/websocket`,
`go.yaml.in/yaml/v3`, `golang.org/x/net`): read it in an afternoon.
Expand Down
3 changes: 2 additions & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ type Upstream struct {
// Name is the `relay://<name>` endpoint that Setup registers. It is one
// lowercase DNS label.
Name string `yaml:"name"`
// Kind is prometheus, victoriametrics, or loki. It selects the read
// Kind selects the read routes the relay permits; routes.go lists the
// kinds (today prometheus, victoriametrics, and loki). It selects the read
// routes the relay permits.
Kind string `yaml:"kind"`
// URL is the provider base: scheme, host, port, and an optional path
Expand Down
3 changes: 2 additions & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ upstreams:
# lowercase DNS label: a-z, 0-9, and -, up to 63 characters, no
# leading or trailing -. Names must be unique in the file.
name: vm
# prometheus, victoriametrics, or loki. Selects the read routes
# One of the kinds routes.go lists: today prometheus, victoriametrics,
# or loki. Selects the read routes
# (docs/security.md, "What the relay forwards").
kind: victoriametrics
# The provider base: scheme, host, port, and an optional path prefix.
Expand Down
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Collect these before starting. Nothing else is needed.
| `<tenant>` | Your Perfloop tenant name, the segment after `/t/` in the app URL. |
| `<namespace>` | The Kubernetes namespace the relay will run in. |
| `<upstream-name>` | A name you choose for the source, one lowercase DNS label, for example `vm`. |
| `<kind>` | `prometheus`, `victoriametrics`, or `loki`. |
| `<kind>` | One of the kinds `routes.go` lists: today `prometheus`, `victoriametrics`, or `loki`. |
| `<upstream-url>` | The provider base URL as reachable from inside the cluster, for example `http://vmselect.monitoring.svc:8481/select/0/prometheus`. No trailing slash. |
| `<upstream-read-token>` | A read-only token for that upstream, if it needs one. Query-scoped. |
| `<digest>` | The relay image digest to pin. See "Choose the image" below. |
Expand Down
2 changes: 1 addition & 1 deletion examples/kubernetes/relay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data:
token: ${PERFLOOP_RELAY_TOKEN}
upstreams:
- name: <upstream-name>
kind: <prometheus|victoriametrics|loki>
kind: <kind> # one of the kinds routes.go lists: prometheus, victoriametrics, loki
url: http://<upstream-service>.<upstream-namespace>.svc:<upstream-port>
headers:
Authorization: Bearer ${UPSTREAM_READ_TOKEN}
Expand Down
Loading