Skip to content

Commit c06771c

Browse files
committed
Add smoke test for OpenTelemetry demo integration and enhance Helm chart configuration
- Introduced a new `smoke-otel-demo` target in the Makefile to run integration tests. - Added `sheaft` configuration options in `values.yaml` for co-locating with `bering`. - Updated Helm templates to support new configuration options for `bering` and `sheaft`. - Modified collector snippets to use OTLP/HTTP for Bering ingestion. - Enhanced documentation for the OpenTelemetry demo integration flow and installation instructions. - Added a new script for smoke testing the integration without a live Kubernetes cluster.
1 parent 2177913 commit c06771c

27 files changed

Lines changed: 1031 additions & 92 deletions

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
PYTHON ?= python
22

3-
.PHONY: lint validate package-assets chart-package release-dry-run stack-manifest
3+
.PHONY: lint validate smoke-otel-demo package-assets chart-package release-dry-run stack-manifest
44

55
lint:
66
$(PYTHON) scripts/tasks.py lint
77

88
validate:
99
$(PYTHON) scripts/tasks.py validate
1010

11+
smoke-otel-demo:
12+
$(PYTHON) scripts/tasks.py smoke-otel-demo
13+
1114
package-assets:
1215
$(PYTHON) scripts/tasks.py package-assets
1316

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
schema_version: "1.0"
2+
seed: 42
3+
trials: 6000
4+
sampling_mode: independent_service
5+
failure_probability: 0.03
6+
profiles:
7+
- name: steady-state
8+
sampling_mode: independent_replica
9+
failure_probability: 0.02
10+
- name: service-fault
11+
sampling_mode: independent_service
12+
failure_probability: 0.05
13+
gate:
14+
mode: warn
15+
default_action: warn
16+
evaluation_rule: all_profiles
17+
global_threshold: 0.94

charts/mb3r-otel-addon/templates/NOTES.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
mb3r-stack installs integration-layer assets only.
22

33
- It does not vendor or replace upstream Bering or Sheaft source code.
4-
- Use values to enable Bering and Sheaft deployments explicitly.
5-
- Use collector snippets only when you want to patch an existing collector deployment.
4+
- Bering runs in upstream `serve --config` mode with an explicit config file and snapshot sink.
5+
- When both Bering and Sheaft are enabled, Sheaft is co-located with Bering by default and watches the shared artifact volume automatically.
6+
- Collector snippets are OTLP/HTTP-first and default to traces-only wiring.
67

78
{{- if and .Values.collector.snippets.enabled (or .Values.collector.targetEndpoint .Values.bering.enabled) }}
89
Collector snippets ConfigMap:

charts/mb3r-otel-addon/templates/_helpers.tpl

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,51 @@ app.kubernetes.io/instance: {{ .Release.Name }}
4545
{{- end -}}
4646
{{- end -}}
4747

48+
{{- define "mb3r-otel-addon.beringConfigMapName" -}}
49+
{{- if .Values.bering.config.existingConfigMap -}}
50+
{{- .Values.bering.config.existingConfigMap -}}
51+
{{- else -}}
52+
{{- printf "%s-bering-config" (include "mb3r-otel-addon.fullname" .) -}}
53+
{{- end -}}
54+
{{- end -}}
55+
56+
{{- define "mb3r-otel-addon.sheaftConfigMapName" -}}
57+
{{- if .Values.sheaft.config.existingConfigMap -}}
58+
{{- .Values.sheaft.config.existingConfigMap -}}
59+
{{- else -}}
60+
{{- printf "%s-sheaft-config" (include "mb3r-otel-addon.fullname" .) -}}
61+
{{- end -}}
62+
{{- end -}}
63+
64+
{{- define "mb3r-otel-addon.artifactPVCName" -}}
65+
{{- printf "%s-artifacts" (include "mb3r-otel-addon.fullname" .) -}}
66+
{{- end -}}
67+
68+
{{- define "mb3r-otel-addon.artifactVolumeSource" -}}
69+
{{- if eq .Values.artifacts.volume.type "persistentVolumeClaim" -}}
70+
persistentVolumeClaim:
71+
claimName: {{ default (include "mb3r-otel-addon.artifactPVCName" .) .Values.artifacts.volume.existingClaim }}
72+
{{- else -}}
73+
emptyDir: {}
74+
{{- end -}}
75+
{{- end -}}
76+
77+
{{- define "mb3r-otel-addon.beringHttpListenAddress" -}}
78+
{{- default (printf ":%v" (.Values.bering.service.ports.http.targetPort | int)) .Values.bering.config.server.listenAddress -}}
79+
{{- end -}}
80+
81+
{{- define "mb3r-otel-addon.beringGrpcListenAddress" -}}
82+
{{- if .Values.bering.service.ports.grpc.enabled -}}
83+
{{- default (printf ":%v" (.Values.bering.service.ports.grpc.targetPort | int)) .Values.bering.config.server.grpcListenAddress -}}
84+
{{- else -}}
85+
{{- default "" .Values.bering.config.server.grpcListenAddress -}}
86+
{{- end -}}
87+
{{- end -}}
88+
4889
{{- define "mb3r-otel-addon.beringEndpoint" -}}
4990
{{- if .Values.collector.targetEndpoint -}}
5091
{{ .Values.collector.targetEndpoint }}
5192
{{- else -}}
52-
{{ printf "%s-bering:%v" (include "mb3r-otel-addon.fullname" .) (.Values.bering.service.port | int) }}
93+
{{ printf "http://%s-bering:%v" (include "mb3r-otel-addon.fullname" .) (.Values.bering.service.ports.http.port | int) }}
5394
{{- end -}}
5495
{{- end -}}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{{- if and (eq .Values.artifacts.volume.type "persistentVolumeClaim") (not .Values.artifacts.volume.existingClaim) }}
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: {{ include "mb3r-otel-addon.artifactPVCName" . }}
6+
labels:
7+
{{- include "mb3r-otel-addon.labels" . | nindent 4 }}
8+
spec:
9+
accessModes:
10+
{{- toYaml .Values.artifacts.volume.accessModes | nindent 4 }}
11+
resources:
12+
requests:
13+
storage: {{ .Values.artifacts.volume.size }}
14+
{{- with .Values.artifacts.volume.storageClassName }}
15+
storageClassName: {{ . | quote }}
16+
{{- end }}
17+
{{- end }}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{{- if and .Values.bering.enabled (not .Values.bering.config.existingConfigMap) }}
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: {{ include "mb3r-otel-addon.beringConfigMapName" . }}
6+
labels:
7+
{{- include "mb3r-otel-addon.labels" . | nindent 4 }}
8+
app.kubernetes.io/component: bering
9+
data:
10+
{{ .Values.bering.config.fileName }}: |
11+
server:
12+
listen_address: {{ include "mb3r-otel-addon.beringHttpListenAddress" . | quote }}
13+
grpc_listen_address: {{ include "mb3r-otel-addon.beringGrpcListenAddress" . | quote }}
14+
max_request_bytes: {{ .Values.bering.config.server.maxRequestBytes | int }}
15+
runtime:
16+
flush_interval: {{ .Values.bering.config.runtime.flushInterval | quote }}
17+
window_size: {{ .Values.bering.config.runtime.windowSize | quote }}
18+
max_in_memory_spans: {{ .Values.bering.config.runtime.maxInMemorySpans }}
19+
late_span_policy: {{ .Values.bering.config.runtime.lateSpanPolicy | quote }}
20+
sink:
21+
directory: {{ .Values.bering.config.sink.directory | quote }}
22+
latest_path: {{ .Values.bering.config.sink.latestPath | quote }}
23+
logging:
24+
structured: {{ .Values.bering.config.logging.structured }}
25+
{{- if .Values.bering.config.overlays }}
26+
overlays:
27+
{{ toYaml .Values.bering.config.overlays | nindent 6 }}
28+
{{- else }}
29+
overlays: []
30+
{{- end }}
31+
{{- end }}

charts/mb3r-otel-addon/templates/bering-deployment.yaml

Lines changed: 104 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,134 @@ spec:
1111
selector:
1212
matchLabels:
1313
{{- include "mb3r-otel-addon.selectorLabels" . | nindent 6 }}
14-
app.kubernetes.io/component: bering
14+
mb3r.io/has-bering: "true"
1515
template:
1616
metadata:
1717
labels:
1818
{{- include "mb3r-otel-addon.selectorLabels" . | nindent 8 }}
1919
app.kubernetes.io/component: bering
20-
{{- with .Values.global.commonAnnotations }}
20+
mb3r.io/has-bering: "true"
21+
{{- if and .Values.sheaft.enabled .Values.sheaft.coLocateWithBering }}
22+
mb3r.io/has-sheaft: "true"
23+
{{- end }}
24+
{{- with .Values.bering.podLabels }}
25+
{{- toYaml . | nindent 8 }}
26+
{{- end }}
27+
{{- if or .Values.global.commonAnnotations .Values.bering.podAnnotations }}
2128
annotations:
29+
{{- with .Values.global.commonAnnotations }}
30+
{{- toYaml . | nindent 8 }}
31+
{{- end }}
32+
{{- with .Values.bering.podAnnotations }}
2233
{{- toYaml . | nindent 8 }}
34+
{{- end }}
2335
{{- end }}
2436
spec:
2537
{{- with .Values.global.imagePullSecrets }}
2638
imagePullSecrets:
2739
{{- toYaml . | nindent 8 }}
2840
{{- end }}
41+
securityContext:
42+
{{- toYaml .Values.bering.podSecurityContext | nindent 8 }}
2943
containers:
3044
- name: bering
3145
image: {{ include "mb3r-otel-addon.resolveImage" (dict "root" . "image" .Values.bering.image) | quote }}
3246
imagePullPolicy: {{ .Values.bering.image.pullPolicy }}
47+
args:
48+
- serve
49+
- --config
50+
- {{ printf "/etc/bering/%s" .Values.bering.config.fileName | quote }}
51+
{{- range .Values.bering.extraArgs }}
52+
- {{ . | quote }}
53+
{{- end }}
3354
ports:
55+
- name: http
56+
containerPort: {{ .Values.bering.service.ports.http.targetPort }}
57+
protocol: TCP
58+
{{- if .Values.bering.service.ports.grpc.enabled }}
3459
- name: otlp-grpc
35-
containerPort: {{ .Values.bering.service.port }}
36-
- name: metrics
37-
containerPort: {{ .Values.bering.service.metricsPort }}
38-
{{- with .Values.bering.extraArgs }}
60+
containerPort: {{ .Values.bering.service.ports.grpc.targetPort }}
61+
protocol: TCP
62+
{{- end }}
63+
livenessProbe:
64+
httpGet:
65+
path: /healthz
66+
port: http
67+
readinessProbe:
68+
httpGet:
69+
path: /readyz
70+
port: http
71+
securityContext:
72+
{{- toYaml .Values.bering.securityContext | nindent 12 }}
73+
volumeMounts:
74+
- name: bering-config
75+
mountPath: /etc/bering
76+
readOnly: true
77+
- name: shared-artifacts
78+
mountPath: /var/lib/mb3r
79+
{{- with .Values.bering.env }}
80+
env:
81+
{{- toYaml . | nindent 12 }}
82+
{{- end }}
83+
{{- with .Values.bering.envFrom }}
84+
envFrom:
85+
{{- toYaml . | nindent 12 }}
86+
{{- end }}
87+
resources:
88+
{{- toYaml .Values.bering.resources | nindent 12 }}
89+
{{- if and .Values.sheaft.enabled .Values.sheaft.coLocateWithBering }}
90+
- name: sheaft
91+
image: {{ include "mb3r-otel-addon.resolveImage" (dict "root" . "image" .Values.sheaft.image) | quote }}
92+
imagePullPolicy: {{ .Values.sheaft.image.pullPolicy }}
3993
args:
94+
- serve
95+
- --config
96+
- {{ printf "/etc/sheaft/%s" .Values.sheaft.config.fileNames.serve | quote }}
97+
{{- range .Values.sheaft.extraArgs }}
98+
- {{ . | quote }}
99+
{{- end }}
100+
ports:
101+
- name: sheaft-http
102+
containerPort: {{ .Values.sheaft.service.port }}
103+
protocol: TCP
104+
livenessProbe:
105+
httpGet:
106+
path: /healthz
107+
port: sheaft-http
108+
readinessProbe:
109+
httpGet:
110+
path: /readyz
111+
port: sheaft-http
112+
{{- with .Values.sheaft.securityContext }}
113+
securityContext:
40114
{{- toYaml . | nindent 12 }}
41115
{{- end }}
42-
{{- with .Values.bering.env }}
116+
volumeMounts:
117+
- name: sheaft-config
118+
mountPath: /etc/sheaft
119+
readOnly: true
120+
- name: shared-artifacts
121+
mountPath: /var/lib/mb3r
122+
{{- with .Values.sheaft.env }}
43123
env:
44124
{{- toYaml . | nindent 12 }}
45125
{{- end }}
126+
{{- with .Values.sheaft.envFrom }}
127+
envFrom:
128+
{{- toYaml . | nindent 12 }}
129+
{{- end }}
46130
resources:
47-
{{- toYaml .Values.bering.resources | nindent 12 }}
131+
{{- toYaml .Values.sheaft.resources | nindent 12 }}
132+
{{- end }}
133+
volumes:
134+
- name: bering-config
135+
configMap:
136+
name: {{ include "mb3r-otel-addon.beringConfigMapName" . }}
137+
- name: shared-artifacts
138+
{{ include "mb3r-otel-addon.artifactVolumeSource" . | nindent 10 }}
139+
{{- if and .Values.sheaft.enabled .Values.sheaft.coLocateWithBering }}
140+
- name: sheaft-config
141+
configMap:
142+
name: {{ include "mb3r-otel-addon.sheaftConfigMapName" . }}
143+
{{- end }}
48144
{{- end }}

charts/mb3r-otel-addon/templates/bering-service.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
{{- if .Values.prometheusScrapeHooks.enabled }}
1111
prometheus.io/scrape: "true"
1212
prometheus.io/path: /metrics
13-
prometheus.io/port: {{ .Values.bering.service.metricsPort | quote }}
13+
prometheus.io/port: {{ .Values.bering.service.ports.http.port | quote }}
1414
{{- end }}
1515
{{- with .Values.bering.prometheus.annotations }}
1616
{{- toYaml . | nindent 4 }}
@@ -22,12 +22,14 @@ spec:
2222
type: {{ .Values.bering.service.type }}
2323
selector:
2424
{{- include "mb3r-otel-addon.selectorLabels" . | nindent 4 }}
25-
app.kubernetes.io/component: bering
25+
mb3r.io/has-bering: "true"
2626
ports:
27+
- name: http
28+
port: {{ .Values.bering.service.ports.http.port }}
29+
targetPort: http
30+
{{- if .Values.bering.service.ports.grpc.enabled }}
2731
- name: otlp-grpc
28-
port: {{ .Values.bering.service.port }}
32+
port: {{ .Values.bering.service.ports.grpc.port }}
2933
targetPort: otlp-grpc
30-
- name: metrics
31-
port: {{ .Values.bering.service.metricsPort }}
32-
targetPort: metrics
34+
{{- end }}
3335
{{- end }}

charts/mb3r-otel-addon/templates/collector-snippets-configmap.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ metadata:
99
data:
1010
exporter.yaml: |
1111
exporters:
12-
otlp/bering:
12+
otlphttp/bering:
1313
endpoint: {{ include "mb3r-otel-addon.beringEndpoint" . }}
1414
tls:
1515
insecure: {{ .Values.collector.snippets.tlsInsecure }}
@@ -19,7 +19,7 @@ data:
1919
pipelines:
2020
traces:
2121
exporters:
22-
- otlp/bering
22+
- otlphttp/bering
2323
{{ else }}
2424
# Disabled by values.collector.snippets.includeTracesPipeline=false
2525
{{ end }}
@@ -29,7 +29,7 @@ data:
2929
pipelines:
3030
metrics:
3131
exporters:
32-
- otlp/bering
32+
- otlphttp/bering
3333
{{ else }}
3434
# Disabled by values.collector.snippets.includeMetricsPipeline=false
3535
{{ end }}
@@ -39,7 +39,7 @@ data:
3939
pipelines:
4040
logs:
4141
exporters:
42-
- otlp/bering
42+
- otlphttp/bering
4343
{{ else }}
4444
# Disabled by values.collector.snippets.includeLogsPipeline=false
4545
{{ end }}
@@ -52,7 +52,13 @@ data:
5252
- job_name: {{ .Values.prometheusScrapeHooks.jobNames.bering | quote }}
5353
static_configs:
5454
- targets:
55-
- {{ printf "%s-bering:%v" (include "mb3r-otel-addon.fullname" .) (.Values.bering.service.metricsPort | int) | quote }}
55+
- {{ printf "%s-bering:%v" (include "mb3r-otel-addon.fullname" .) (.Values.bering.service.ports.http.port | int) | quote }}
56+
{{- if .Values.sheaft.enabled }}
57+
- job_name: {{ .Values.prometheusScrapeHooks.jobNames.sheaft | quote }}
58+
static_configs:
59+
- targets:
60+
- {{ printf "%s-sheaft:%v" (include "mb3r-otel-addon.fullname" .) (.Values.sheaft.service.port | int) | quote }}
61+
{{- end }}
5662
{{ else }}
5763
# Disabled by values.collector.snippets.includePrometheusReceiver=false
5864
{{ end }}

0 commit comments

Comments
 (0)