Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <[email protected]>
  • Loading branch information
petewall committed Oct 31, 2024
1 parent 6782311 commit cfb1e64
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 575 deletions.
6 changes: 6 additions & 0 deletions charts/feature-auto-instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,9 @@ Actual integration testing in a live environment should be done in the main [k8s
|-----|------|---------|-------------|
| global.maxCacheSize | int | `100000` | Sets the max_cache_size for every prometheus.relabel component. ([docs](https://grafana.com/docs/alloy/latest/reference/components/prometheus.relabel/#arguments)) This should be at least 2x-5x your largest scrape target or samples appended rate. |
| global.scrapeInterval | string | `"60s"` | How frequently to scrape metrics. |

### Other Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| beyla.traces.endpoint | string | `""` | |
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{{- define "feature.autoInstrumentation.config.beyla" }}
{{- $clusterName := dict "attributes" (dict "kubernetes" (dict "cluster_name" .Values.cluster.name)) }}
{{- $endpoint := dict }}
{{- if .Values.receivers.grpc.enabled }}
{{- $endpoint = dict "otel_traces_export" (dict "endpoint" (include "kubernetes_monitoring.receiver.grpc" . | trim))}}
{{- else if .Values.receivers.http.enabled }}
{{- $endpoint = dict "otel_traces_export" (dict "endpoint" (include "kubernetes_monitoring.receiver.http" . | trim))}}
{{- if .Values.beyla.traces.endpoint }}
{{- $endpoint = dict "otel_traces_export" (dict "endpoint" .Values.beyla.traces.endpoint)}}
{{- end }}
{{- $preset := dict }}
{{- if and (eq .Values.beyla.preset "network") (not .Values.beyla.config.data.network) }}
Expand All @@ -13,7 +10,7 @@
{{- if and (eq .Values.beyla.preset "application") (not .Values.beyla.config.data.discovery) }}
{{- $preset = dict "discovery" (dict "services" (list (dict "k8s_namespace" ".")))}}
{{- end }}
{{- merge .Values.beyla.config.data $clusterName $endpoint $preset | toYaml }}
{{- merge .Values.beyla.config.data $endpoint $preset | toYaml }}
{{- end }}
---
apiVersion: v1
Expand Down
77 changes: 76 additions & 1 deletion charts/feature-auto-instrumentation/tests/beyla_config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,79 @@ tests:
of: ConfigMap
- equal:
path: data["beyla-config.yml"]
value: ""
value: |-
attributes:
kubernetes:
enable: true
select:
beyla_network_flow_bytes:
include:
- k8s.src.owner.type
- k8s.dst.owner.type
- direction
discovery:
services:
- k8s_namespace: .
filter:
network:
k8s_dst_owner_name:
not_match: '{kube*,*jaeger-agent*,*prometheus*,*promtail*,*grafana-agent*}'
k8s_src_owner_name:
not_match: '{kube*,*jaeger-agent*,*prometheus*,*promtail*,*grafana-agent*}'
internal_metrics:
prometheus:
path: /internal/metrics
port: 9090
prometheus_export:
features:
- application
- network
- application_service_graph
- application_span
path: /metrics
port: 9090
- it: sets the otel_traces_export endpoint if provided
set:
deployAsConfigMap: true
beyla:
traces:
endpoint: http://alloy-receiver.default.svc.cluster.local:4318
asserts:
- isKind:
of: ConfigMap
- equal:
path: data["beyla-config.yml"]
value: |-
attributes:
kubernetes:
enable: true
select:
beyla_network_flow_bytes:
include:
- k8s.src.owner.type
- k8s.dst.owner.type
- direction
discovery:
services:
- k8s_namespace: .
filter:
network:
k8s_dst_owner_name:
not_match: '{kube*,*jaeger-agent*,*prometheus*,*promtail*,*grafana-agent*}'
k8s_src_owner_name:
not_match: '{kube*,*jaeger-agent*,*prometheus*,*promtail*,*grafana-agent*}'
internal_metrics:
prometheus:
path: /internal/metrics
port: 9090
otel_traces_export:
endpoint: http://alloy-receiver.default.svc.cluster.local:4318
prometheus_export:
features:
- application
- network
- application_service_graph
- application_span
path: /metrics
port: 9090
8 changes: 8 additions & 0 deletions charts/feature-auto-instrumentation/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@
},
"scrapeInterval": {
"type": "string"
},
"traces": {
"type": "object",
"properties": {
"endpoint": {
"type": "string"
}
}
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions charts/feature-auto-instrumentation/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ beyla:
# @section -- Beyla
maxCacheSize:

traces:
endpoint: ""

config:
# @ignored -- This allows this chart to create the ConfigMap while also keeping the default name
skipConfigMapCheck: true
Expand Down
Loading

0 comments on commit cfb1e64

Please sign in to comment.