Skip to content

Commit 7fb4c40

Browse files
committed
feat: Add pyroscope-monitoring helm
This contains a fully fledged observability deployment for Pyroscope OSS monitoring Over time I would like to consolidate our internal dashboards and alerts into this helm chart. This also allows us to test/debug Pyroscope OSS in a local kind deployment.
1 parent b1824a1 commit 7fb4c40

File tree

910 files changed

+37853
-115059
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

910 files changed

+37853
-115059
lines changed

Makefile

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ fmt: $(BIN)/golangci-lint $(BIN)/buf $(BIN)/tk ## Automatically fix some lint er
209209
$(BIN)/golangci-lint run --fix
210210
cd api/ && $(BIN)/buf format -w .
211211
cd pkg && $(BIN)/buf format -w .
212-
$(BIN)/tk fmt ./operations/pyroscope/jsonnet/ tools/monitoring/
212+
$(BIN)/tk fmt ./operations/pyroscope/jsonnet/
213213

214214
.PHONY: check/unstaged-changes
215215
check/unstaged-changes:
@@ -236,10 +236,15 @@ define deploy
236236
--set pyroscope.image.repository=$(IMAGE_PREFIX)pyroscope \
237237
--set pyroscope.podAnnotations.image-digest=$(shell cat .docker-image-digest-pyroscope) \
238238
--set pyroscope.service.port_name=http-metrics \
239-
--set pyroscope.podAnnotations."profiles\.grafana\.com\/memory\.port_name"=http-metrics \
240-
--set pyroscope.podAnnotations."profiles\.grafana\.com\/cpu\.port_name"=http-metrics \
241-
--set pyroscope.podAnnotations."profiles\.grafana\.com\/goroutine\.port_name"=http-metrics \
242-
--set pyroscope.extraEnvVars.JAEGER_AGENT_HOST=jaeger.monitoring.svc.cluster.local. \
239+
--set-string pyroscope.podAnnotations."profiles\.grafana\.com/memory\.port_name"=http-metrics \
240+
--set-string pyroscope.podAnnotations."profiles\.grafana\.com/cpu\.port_name"=http-metrics \
241+
--set-string pyroscope.podAnnotations."profiles\.grafana\.com/goroutine\.port_name"=http-metrics \
242+
--set-string pyroscope.podAnnotations."k8s\.grafana\.com/scrape"=true \
243+
--set-string pyroscope.podAnnotations."k8s\.grafana\.com/metrics\.portName"=http-metrics \
244+
--set-string pyroscope.podAnnotations."k8s\.grafana\.com/metrics\.scrapeInterval"=15s \
245+
--set-string pyroscope.extraEnvVars.JAEGER_AGENT_HOST=pyroscope-monitoring-alloy-receiver \
246+
--set pyroscope.extraEnvVars.JAEGER_SAMPLER_TYPE=const \
247+
--set pyroscope.extraEnvVars.JAEGER_SAMPLER_PARAM=1 \
243248
--set pyroscope.extraArgs."pyroscopedb\.max-block-duration"=5m
244249
endef
245250

@@ -394,15 +399,17 @@ $(BIN)/helm-docs: Makefile go.mod
394399

395400
.PHONY: cve/check
396401
cve/check:
397-
docker run -t -i --rm --volume "$(CURDIR)/:/repo" -u "$(shell id -u)" aquasec/trivy:0.45.1 filesystem --cache-dir /repo/.cache/trivy --scanners vuln --skip-dirs .tmp/ --skip-dirs node_modules/ --skip-dirs tools/monitoring/vendor/ /repo
402+
docker run -t -i --rm --volume "$(CURDIR)/:/repo" -u "$(shell id -u)" aquasec/trivy:0.45.1 filesystem --cache-dir /repo/.cache/trivy --scanners vuln --skip-dirs .tmp/ --skip-dirs node_modules/ /repo
398403

399404
.PHONY: helm/lint
400405
helm/lint: $(BIN)/helm
401-
$(BIN)/helm lint ./operations/pyroscope/helm/pyroscope/
406+
$(BIN)/helm lint ./operations/pyroscope/helm/pyroscope
407+
$(BIN)/helm lint ./operations/pyroscope/helm/pyroscope-monitoring
402408

403409
.PHONY: helm/docs
404410
helm/docs: $(BIN)/helm-docs
405411
$(BIN)/helm-docs -c operations/pyroscope/helm/pyroscope
412+
$(BIN)/helm-docs -c operations/pyroscope/helm/pyroscope-monitoring
406413

407414
.PHONY: goreleaser/lint
408415
goreleaser/lint: $(BIN)/goreleaser
@@ -442,6 +449,9 @@ helm/check: $(BIN)/kubeconform $(BIN)/helm
442449
cat operations/pyroscope/helm/pyroscope/values.yaml \
443450
| go run ./tools/yaml-to-json \
444451
> ./operations/pyroscope/jsonnet/values.json
452+
# Generate dashboards and rules
453+
$(BIN)/helm template pyroscope-monitoring --show-only templates/dashboards.yaml --show-only templates/rules.yaml operations/pyroscope/helm/pyroscope-monitoring \
454+
| go run ./tools/monitoring-chart-extractor
445455

446456
.PHONY: deploy
447457
deploy: $(BIN)/kind $(BIN)/helm docker-image/pyroscope/build
@@ -460,16 +470,9 @@ deploy-micro-services-v1: $(BIN)/kind $(BIN)/helm docker-image/pyroscope/build
460470
$(call deploy,pyroscope-micro-services,$(HELM_FLAGS_V1_MICROSERVICES))
461471

462472
.PHONY: deploy-monitoring
463-
deploy-monitoring: $(BIN)/tk $(BIN)/kind tools/monitoring/environments/default/spec.json
464-
kubectl --context="kind-$(KIND_CLUSTER)" create namespace monitoring --dry-run=client -o yaml | kubectl --context="kind-$(KIND_CLUSTER)" apply -f -
465-
$(BIN)/tk apply tools/monitoring/environments/default/main.jsonnet
466-
467-
.PHONY: tools/monitoring/environments/default/spec.json # This is a phony target for now as the cluster might be not already created.
468-
tools/monitoring/environments/default/spec.json: $(BIN)/tk $(BIN)/kind
473+
deploy-monitoring: $(BIN)/kind $(BIN)/helm
469474
$(BIN)/kind export kubeconfig --name $(KIND_CLUSTER) || $(BIN)/kind create cluster --name $(KIND_CLUSTER)
470-
pushd tools/monitoring/ && rm -Rf vendor/ lib/ environments/default/spec.json && PATH=$(BIN):$(PATH) $(BIN)/tk init -f
471-
echo "import 'monitoring.libsonnet'" > tools/monitoring/environments/default/main.jsonnet
472-
$(BIN)/tk env set tools/monitoring/environments/default --server=$(shell $(BIN)/kind get kubeconfig --name pyroscope-dev | grep server: | sed 's/server://g' | xargs) --namespace=monitoring
475+
$(BIN)/helm upgrade --install pyroscope-monitoring ./operations/pyroscope/helm/pyroscope-monitoring
473476

474477
include Makefile.examples
475478

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ require (
8585
go.uber.org/atomic v1.11.0
8686
go.uber.org/automaxprocs v1.6.0
8787
go.uber.org/goleak v1.3.0
88+
go.yaml.in/yaml/v3 v3.0.4
8889
golang.org/x/exp v0.0.0-20250106191152-7588d65b2ba8
8990
golang.org/x/mod v0.27.0
9091
golang.org/x/net v0.45.0
@@ -105,7 +106,6 @@ require (
105106
require (
106107
github.com/Masterminds/semver/v3 v3.4.0 // indirect
107108
go.yaml.in/yaml/v2 v2.4.2 // indirect
108-
go.yaml.in/yaml/v3 v3.0.4 // indirect
109109
)
110110

111111
require (

0 commit comments

Comments
 (0)