diff --git a/README.md b/README.md index 7f7cd75..733eb70 100644 --- a/README.md +++ b/README.md @@ -268,7 +268,7 @@ values which are defined [here](https://github.com/grafana/helm-charts/tree/main | global.telemetry.profiling.scrape_interval | string | `"60s"` | how often the collector will scrape pprof endpoints | | global.telemetry.profiling.scrape_timeout | string | `"60s"` | how long a request will be allowed to wait before being canceled | | global.zone | string | `"svc"` | | -| grafana-agent.agent.clustering.enabled | bool | `false` | | +| grafana-agent.agent.clustering.enabled | bool | `true` | | | grafana-agent.agent.configMap.create | bool | `false` | | | grafana-agent.agent.configMap.key | string | `"config.river"` | | | grafana-agent.agent.configMap.name | string | `"collector-config"` | | diff --git a/TESTING_KIND.md b/TESTING_KIND.md index 0c7b03e..6a3e1f3 100644 --- a/TESTING_KIND.md +++ b/TESTING_KIND.md @@ -1,5 +1,12 @@ # Using kind to test observability +
+ If using nix + + `nix-shell -p kind kubernetes-helm kubectl` + +
+ To test the observability chart locally without a kubernetes cluster, you can use [`kind` (Kubernetes in Docker)](https://kind.sigs.k8s.io/). This allows you to create a local Kubernetes cluster that can be used for testing purposes. ```bash @@ -86,7 +93,7 @@ helm install --namespace coder-observability --create-namespace observe . ## To update ```bash -helm upgrade --namespace coder-observability -force --create-namespace observe . +helm upgrade --namespace coder-observability --create-namespace observe . ``` Sometimes the config maps do not take. A quick way to reset the helm installation is just to uninstall and install. diff --git a/coder-observability/templates/_collector-config.tpl b/coder-observability/templates/_collector-config.tpl index cac6b31..1e3e4e7 100644 --- a/coder-observability/templates/_collector-config.tpl +++ b/coder-observability/templates/_collector-config.tpl @@ -210,6 +210,10 @@ pyroscope.scrape "pods" { scrape_interval = "{{ .Values.global.telemetry.profiling.scrape_interval }}" scrape_timeout = "{{ .Values.global.telemetry.profiling.scrape_timeout }}" + + clustering { + enabled = true + } } pyroscope.write "pods" { diff --git a/coder-observability/values.yaml b/coder-observability/values.yaml index b561cac..7aea2df 100644 --- a/coder-observability/values.yaml +++ b/coder-observability/values.yaml @@ -186,7 +186,7 @@ grafana-agent: key: config.river create: false clustering: - enabled: false + enabled: true extraArgs: - --disable-reporting=true mounts: diff --git a/compiled/resources.yaml b/compiled/resources.yaml index a2788a9..44b35b9 100644 --- a/compiled/resources.yaml +++ b/compiled/resources.yaml @@ -10100,6 +10100,33 @@ subjects: name: grafana namespace: coder-observability --- +# Source: coder-observability/charts/grafana-agent/templates/cluster_service.yaml +apiVersion: v1 +kind: Service +metadata: + name: grafana-agent-cluster + labels: + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: coder-observability + app.kubernetes.io/managed-by: Helm +spec: + type: ClusterIP + clusterIP: 'None' + selector: + app.kubernetes.io/name: grafana-agent + app.kubernetes.io/instance: coder-observability + ports: + # Do not include the -metrics suffix in the port name, otherwise metrics + # can be double-collected with the non-headless Service if it's also + # enabled. + # + # This service should only be used for clustering, and not metric + # collection. + - name: http + port: 80 + targetPort: 80 + protocol: "TCP" +--- # Source: coder-observability/charts/grafana-agent/templates/service.yaml apiVersion: v1 kind: Service @@ -10728,6 +10755,8 @@ spec: - --storage.path=/tmp/agent - --server.http.listen-addr=0.0.0.0:80 - --server.http.ui-path-prefix=/ + - --cluster.enabled=true + - --cluster.join-addresses=grafana-agent-cluster - --disable-reporting=true env: - name: AGENT_MODE