Skip to content

Commit

Permalink
Add alloy instead of agent (#3381)
Browse files Browse the repository at this point in the history
* Add alloy instead of agent

Agent is now disabled by default and replaced with alloy

Fixes #3282

* Also update test to use alloy instead of river
  • Loading branch information
simonswine authored Jun 24, 2024
1 parent 17534d5 commit c0fb2b0
Show file tree
Hide file tree
Showing 16 changed files with 569 additions and 198 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/grafana/pyroscope

go 1.21
go 1.21.0

require (
connectrpc.com/connect v1.16.2
Expand All @@ -27,13 +27,13 @@ require (
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.0
github.com/grafana/alloy/syntax v0.1.0
github.com/grafana/dskit v0.0.0-20231221015914-de83901bf4d6
github.com/grafana/jfr-parser/pprof v0.0.0-20240228024232-8abcb81c304c
github.com/grafana/pyroscope-go v1.0.3
github.com/grafana/pyroscope-go/godeltaprof v0.1.7
github.com/grafana/pyroscope/api v0.4.0
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db
github.com/grafana/river v0.3.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/json-iterator/go v1.1.12
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/grafana/alloy/syntax v0.1.0 h1:+1xQakvQPH6N0y9+q2Fu5QePyzrve6i1wMNuXdWd1rQ=
github.com/grafana/alloy/syntax v0.1.0/go.mod h1:8H9ToCc1M8F6A+je4rIH6saIe1MUCmjSk+Uje+LNLEo=
github.com/grafana/dskit v0.0.0-20231221015914-de83901bf4d6 h1:Z78JZ7pa6InQ5BcMB27M+NMTZ7LV+MXgOd3dZPfEdG4=
github.com/grafana/dskit v0.0.0-20231221015914-de83901bf4d6/go.mod h1:kkWM4WUV230bNG3urVRWPBnSJHs64y/0RmWjftnnn0c=
github.com/grafana/jfr-parser v0.8.1-0.20240228024232-8abcb81c304c h1:vNY68kvB3UYSeh7zHehOpfqk6CCpLYmuYKnF53GTpSk=
Expand All @@ -386,8 +388,6 @@ github.com/grafana/pyroscope-go/godeltaprof v0.1.7 h1:C11j63y7gymiW8VugJ9ZW0pWfx
github.com/grafana/pyroscope-go/godeltaprof v0.1.7/go.mod h1:Tk376Nbldo4Cha9RgiU7ik8WKFkNpfds98aUzS8omLE=
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db h1:7aN5cccjIqCLTzedH7MZzRZt5/lsAHch6Z3L2ZGn5FA=
github.com/grafana/regexp v0.0.0-20221123153739-15dc172cd2db/go.mod h1:M5qHK+eWfAv8VR/265dIuEpL3fNfeC21tXXp9itM24A=
github.com/grafana/river v0.3.0 h1:6TsaR/vkkcppUM9I0muGbPIUedCtpPu6OWreE5+CE6g=
github.com/grafana/river v0.3.0/go.mod h1:icSidCSHYXJUYy6TjGAi/D+X7FsP7Gc7cxvBUIwYMmY=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0 h1:Wqo399gCIufwto+VfwCSvsnfGpF/w5E9CNxSwbpD6No=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.0/go.mod h1:qmOFXW2epJhM0qSnUUYpldc7gVz2KMQwJ/QYCDIa7XU=
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645/go.mod h1:6iZfnjpejD4L/4DwD7NryNaJyCQdzwWwH2MWhCA90Kw=
Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.21
go 1.21.0

use (
.
Expand Down
2 changes: 2 additions & 0 deletions go.work.sum
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,8 @@ github.com/oauth2-proxy/tools/reference-gen v0.0.0-20210118095127-56ffd7384404 h
github.com/oauth2-proxy/tools/reference-gen v0.0.0-20210118095127-56ffd7384404/go.mod h1:YpORG8zs14vNlpXvuHYnnDvWazIRaDk02MaY8lafqdI=
github.com/ohler55/ojg v1.19.3 h1:rFmEc33aZOvlwb7tibAmwVGEiPfMZkgvurK0YDDr1HI=
github.com/ohler55/ojg v1.19.3/go.mod h1:uHcD1ErbErC27Zhb5Df2jUjbseLLcmOCo6oxSr3jZxo=
github.com/ohler55/ojg v1.20.1 h1:Io65sHjMjYPI7yuhUr8VdNmIQdYU6asKeFhOs8xgBnY=
github.com/ohler55/ojg v1.20.1/go.mod h1:uHcD1ErbErC27Zhb5Df2jUjbseLLcmOCo6oxSr3jZxo=
github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA=
github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU=
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"testing"

"github.com/google/go-cmp/cmp"
"github.com/grafana/river/diag"
"github.com/grafana/river/parser"
"github.com/grafana/river/printer"
"github.com/grafana/alloy/syntax/diag"
"github.com/grafana/alloy/syntax/parser"
"github.com/grafana/alloy/syntax/printer"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
)
Expand All @@ -26,12 +26,12 @@ func Test_FormatAgentRiverConfig(t *testing.T) {
configString := ``
dec := yaml.NewDecoder(fdata)
for dec.Decode(&values) == nil {
if values["metadata"].(map[string]interface{})["name"] == "grafana-agent-config-pyroscope" {
configString = values["data"].(map[string]interface{})["config.river"].(string)
if values["metadata"].(map[string]interface{})["name"] == "alloy-config-pyroscope" {
configString = values["data"].(map[string]interface{})["config.alloy"].(string)
break
}
}
fileName := fmt.Sprintf("%s/config.river", t.TempDir())
fileName := fmt.Sprintf("%s/config.alloy", t.TempDir())
require.NoError(t, os.WriteFile(fileName, []byte(configString), 0o644))
fi, err := os.Stat(fileName)
require.NoError(t, err)
Expand Down
7 changes: 5 additions & 2 deletions operations/pyroscope/helm/pyroscope/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ dependencies:
- name: grafana-agent
repository: https://grafana.github.io/helm-charts
version: 0.25.0
- name: alloy
repository: https://grafana.github.io/helm-charts
version: 0.3.2
- name: minio
repository: https://charts.min.io/
version: 4.0.12
digest: sha256:ac1a9529d0b7f81d81909bdd6cebb0b61cb28e039fa21a719f73626a5efc86be
generated: "2023-09-26T17:22:21.02154+01:00"
digest: sha256:8219331a0958f700ac918d7ebc18f15ad6086feb6299d27d3592c95ffd65a725
generated: "2024-06-21T15:57:39.754373+01:00"
5 changes: 5 additions & 0 deletions operations/pyroscope/helm/pyroscope/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ dependencies:
version: "0.25.0"
repository: https://grafana.github.io/helm-charts
condition: agent.enabled
- name: alloy
alias: alloy
version: "0.3.2"
repository: https://grafana.github.io/helm-charts
condition: alloy.enabled
- name: minio
alias: minio
version: 4.0.12
Expand Down
4 changes: 3 additions & 1 deletion operations/pyroscope/helm/pyroscope/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
| Repository | Name | Version |
|------------|------|---------|
| https://charts.min.io/ | minio(minio) | 4.0.12 |
| https://grafana.github.io/helm-charts | alloy(alloy) | 0.3.2 |
| https://grafana.github.io/helm-charts | agent(grafana-agent) | 0.25.0 |

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| agent | object | `{"agent":{"clustering":{"enabled":true},"configMap":{"create":false,"name":"grafana-agent-config-pyroscope"}},"controller":{"podAnnotations":{"profiles.grafana.com/cpu.port_name":"http-metrics","profiles.grafana.com/cpu.scrape":"true","profiles.grafana.com/goroutine.port_name":"http-metrics","profiles.grafana.com/goroutine.scrape":"true","profiles.grafana.com/memory.port_name":"http-metrics","profiles.grafana.com/memory.scrape":"true"},"replicas":1,"type":"statefulset"},"enabled":true}` | ----------------------------------- |
| agent | object | `{"agent":{"clustering":{"enabled":true},"configMap":{"create":false,"name":"grafana-agent-config-pyroscope"}},"controller":{"podAnnotations":{"profiles.grafana.com/cpu.port_name":"http-metrics","profiles.grafana.com/cpu.scrape":"true","profiles.grafana.com/goroutine.port_name":"http-metrics","profiles.grafana.com/goroutine.scrape":"true","profiles.grafana.com/memory.port_name":"http-metrics","profiles.grafana.com/memory.scrape":"true"},"replicas":1,"type":"statefulset"},"enabled":false}` | ----------------------------------- |
| alloy | object | `{"alloy":{"clustering":{"enabled":true},"configMap":{"create":false,"name":"alloy-config-pyroscope"},"stabilityLevel":"public-preview"},"controller":{"podAnnotations":{"profiles.grafana.com/cpu.port_name":"http-metrics","profiles.grafana.com/cpu.scrape":"true","profiles.grafana.com/goroutine.port_name":"http-metrics","profiles.grafana.com/goroutine.scrape":"true","profiles.grafana.com/memory.port_name":"http-metrics","profiles.grafana.com/memory.scrape":"true"},"replicas":1,"type":"statefulset"},"enabled":true}` | ----------------------------------- |
| ingress.className | string | `""` | |
| ingress.enabled | bool | `false` | |
| minio | object | `{"buckets":[{"name":"grafana-pyroscope-data","policy":"none","purge":false}],"drivesPerNode":2,"enabled":false,"persistence":{"size":"5Gi"},"podAnnotations":{"phlare.grafana.com/port":"9000","phlare.grafana.com/scrape":"true"},"replicas":1,"resources":{"requests":{"cpu":"100m","memory":"128Mi"}},"rootPassword":"supersecret","rootUser":"grafana-pyroscope"}` | ----------------------------------- |
Expand Down
Binary file not shown.
Loading

0 comments on commit c0fb2b0

Please sign in to comment.