Skip to content

Commit 6782311

Browse files
committed
WIP: Adding beyla config map
Signed-off-by: Pete Wall <[email protected]>
1 parent 3637d15 commit 6782311

18 files changed

+787
-7
lines changed

charts/feature-annotation-autodiscovery/templates/_notes.tpl

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
{{- define "feature.annotationAutodiscovery.notes.deployments" }}
2-
* Grafana Beyla (Daemonset)
3-
{{- end }}
1+
{{- define "feature.annotationAutodiscovery.notes.deployments" }}{{- end }}
42

53
{{- define "feature.annotationAutodiscovery.notes.task" }}
6-
Automatically instrument applications and services running in the cluster with Grafana Beyla
4+
Scrape metrics from pods and services with the "{{.Values.annotations.scrape}}: true" annotation
75
{{- end }}
86

97
{{- define "feature.annotationAutodiscovery.notes.actions" }}{{- end }}

charts/feature-auto-instrumentation/templates/_notes.tpl

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
{{- define "feature.autoInstrumentation.notes.deployments" }}{{- end }}
1+
{{- define "feature.autoInstrumentation.notes.deployments" }}
2+
* Grafana Beyla (Daemonset)
3+
{{- end }}
24

35
{{- define "feature.autoInstrumentation.notes.task" }}
4-
Scrape metrics from pods and services with the "{{.Values.annotations.scrape}}: true" annotation
6+
Automatically instrument applications and services running in the cluster with Grafana Beyla
57
{{- end }}
68

79
{{- define "feature.autoInstrumentation.notes.actions" }}{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{- define "feature.autoInstrumentation.config.beyla" }}
2+
{{- $clusterName := dict "attributes" (dict "kubernetes" (dict "cluster_name" .Values.cluster.name)) }}
3+
{{- $endpoint := dict }}
4+
{{- if .Values.receivers.grpc.enabled }}
5+
{{- $endpoint = dict "otel_traces_export" (dict "endpoint" (include "kubernetes_monitoring.receiver.grpc" . | trim))}}
6+
{{- else if .Values.receivers.http.enabled }}
7+
{{- $endpoint = dict "otel_traces_export" (dict "endpoint" (include "kubernetes_monitoring.receiver.http" . | trim))}}
8+
{{- end }}
9+
{{- $preset := dict }}
10+
{{- if and (eq .Values.beyla.preset "network") (not .Values.beyla.config.data.network) }}
11+
{{- $preset = dict "network" (dict "enable" true)}}
12+
{{- end }}
13+
{{- if and (eq .Values.beyla.preset "application") (not .Values.beyla.config.data.discovery) }}
14+
{{- $preset = dict "discovery" (dict "services" (list (dict "k8s_namespace" ".")))}}
15+
{{- end }}
16+
{{- merge .Values.beyla.config.data $clusterName $endpoint $preset | toYaml }}
17+
{{- end }}
18+
---
19+
apiVersion: v1
20+
kind: ConfigMap
21+
metadata:
22+
name: {{ include "beyla.fullname" .Subcharts.beyla }}
23+
namespace: {{ include "beyla.namespace" .Subcharts.beyla }}
24+
labels:
25+
{{- include "beyla.labels" .Subcharts.beyla | nindent 4 }}
26+
app.kubernetes.io/component: config
27+
{{- with .Values.beyla.annotations }}
28+
annotations:
29+
{{- toYaml . | nindent 4 }}
30+
{{- end }}
31+
data:
32+
beyla-config.yml: |-
33+
{{- include "feature.autoInstrumentation.config.beyla" . | nindent 4 }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# yamllint disable rule:document-start rule:line-length rule:trailing-spaces
2+
suite: Test Beyla config values
3+
templates:
4+
- beyla-config.yaml
5+
tests:
6+
- it: creates a ConfigMap for Beyla
7+
set:
8+
deployAsConfigMap: true
9+
asserts:
10+
- isKind:
11+
of: ConfigMap
12+
- equal:
13+
path: data["beyla-config.yml"]
14+
value: ""

charts/k8s-monitoring/Chart.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ dependencies:
4242
repository: https://grafana.github.io/helm-charts
4343
version: 0.9.1
4444
digest: sha256:56dd043a4fdf5eb79550e1e449aad71f4e0cd52eedf5b2d775d69d2a3b5d2191
45-
generated: "2024-10-31T14:21:42.881831-05:00"
45+
generated: "2024-10-31T14:30:07.675908-05:00"
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
(NOTE: Do not edit README.md directly. It is a generated file!)
3+
( To make changes, please modify values.yaml or description.txt and run `make examples`)
4+
-->
5+
# Example: features/auto-instrumentation/beyla-metrics/values.yaml
6+
7+
## Values
8+
9+
```yaml
10+
---
11+
cluster:
12+
name: annotation-autodiscovery-cluster
13+
14+
destinations:
15+
- name: prometheus
16+
type: prometheus
17+
url: http://prometheus.prometheus.svc:9090/api/v1/write
18+
19+
autoInstrumentation:
20+
enabled: true
21+
22+
alloy-metrics:
23+
enabled: true
24+
```

charts/k8s-monitoring/docs/examples/features/auto-instrumentation/beyla-metrics/alloy-metrics.alloy

+127
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)