Skip to content

Commit b4fd225

Browse files
Gandemfelixge
authored andcommitted
initial bench setup
1 parent 2036eb7 commit b4fd225

File tree

14 files changed

+896
-0
lines changed

14 files changed

+896
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM alpine:3.19 AS certs
2+
3+
RUN apk --update add ca-certificates
4+
5+
6+
FROM golang:1.25 AS build-stage
7+
8+
WORKDIR /build
9+
10+
COPY ./builder-manifest.yaml builder-manifest.yaml
11+
12+
RUN --mount=type=cache,target=/root/.cache/go-build GO111MODULE=on go install go.opentelemetry.io/collector/cmd/[email protected]
13+
RUN --mount=type=cache,target=/root/.cache/go-build builder --config builder-manifest.yaml
14+
15+
16+
FROM alpine:3.19
17+
18+
RUN apk --no-cache add ca-certificates util-linux
19+
20+
ARG USER_UID=10001
21+
RUN adduser -D -u ${USER_UID} otel
22+
USER ${USER_UID}
23+
24+
COPY --chmod=755 --from=build-stage /build/dist/otelcol-ebpf-profiler-custom /otelcol/otelcol-ebpf-profiler-custom
25+
26+
ENTRYPOINT ["/otelcol/otelcol-ebpf-profiler-custom"]
27+
CMD ["--config", "/conf/relay.yaml"]
28+
29+
EXPOSE 4317 4318 13133 14250 14268 6831 9411

otlp-bench/bench-setup/README.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# OTLP Profiling Benchmark Setup
2+
3+
This setup captures real-world OTLP profiling data to measure the impact of protocol changes on in-memory and wire size.
4+
5+
## Overview
6+
7+
We run two workloads on a single-node minikube cluster:
8+
9+
- **[OpenTelemetry Demo](https://github.com/open-telemetry/opentelemetry-demo)** (Astronomy Shop): A fictional e-commerce application composed of ~15 microservices written in Go, Java, Python, .NET, Node.js, Rust, PHP, and more. Generates diverse profiling data across different runtimes and frameworks.
10+
- **[NetBox](https://github.com/netbox-community/netbox)**: A network infrastructure management platform (IPAM/DCIM) built with Django. Runs as a gunicorn WSGI application that spawns multiple worker processes—useful for evaluating profiler behavior with forking Python processes.
11+
12+
A custom OpenTelemetry Collector with the [eBPF profiler](https://github.com/open-telemetry/opentelemetry-ebpf-profiler) captures profiles from all processes on the node and writes them to disk.
13+
14+
## Prerequisites
15+
16+
- Ubuntu 24.04 VM (tested on AWS c6a.8xlarge: 32 vCPUs, 64 GiB)
17+
- Sudo access
18+
19+
## Setup
20+
21+
### 1. Install dependencies
22+
23+
```bash
24+
./install.sh
25+
```
26+
27+
This installs Docker, minikube, kubectl, helm, and configures the system for Kubernetes.
28+
29+
After installation, either log out and back in, or run `newgrp docker` to activate Docker group membership.
30+
31+
### 2. Start the cluster
32+
33+
```bash
34+
minikube start --driver=none
35+
```
36+
37+
### 3. Deploy workloads
38+
39+
**OpenTelemetry Demo:**
40+
41+
```bash
42+
kubectl create namespace otel-demo
43+
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
44+
helm install otel-demo open-telemetry/opentelemetry-demo -n otel-demo --values k8s/opentelemetry-demo/values.yaml
45+
```
46+
47+
**NetBox:**
48+
49+
```bash
50+
kubectl create namespace netbox-bench
51+
helm install netbox-bench oci://ghcr.io/netbox-community/netbox-chart/netbox -n netbox-bench
52+
```
53+
54+
NetBox takes ~10 minutes to start (database migrations). Wait for all pods to be ready:
55+
56+
```bash
57+
kubectl get pods -n netbox-bench -w
58+
```
59+
60+
Then start the load generator:
61+
62+
```bash
63+
kubectl apply -f k8s/netbox/load-generator.yaml
64+
```
65+
66+
### 4. Deploy the collector
67+
68+
Build a custom collector pinned to a specific commit of the eBPF profiler:
69+
70+
```bash
71+
./build-custom-collector.sh
72+
```
73+
74+
Deploy it:
75+
76+
```bash
77+
kubectl create namespace otel
78+
kubectl apply -f k8s/opentelemetry-collector/
79+
```
80+
81+
## Output
82+
83+
Profiles are written to `/var/lib/otel-profiles/profiles.proto` in the [file exporter format](https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/fileexporter#file-format).
84+
85+
## Notes
86+
87+
- The collector runs as a DaemonSet with privileged access (required for eBPF).
88+
- We use a custom Kubernetes manifest because the collector Helm charts don't yet support the profiling distribution.
89+
- The `builder-manifest.yaml` pins the eBPF profiler to a [specific commit](https://github.com/open-telemetry/opentelemetry-ebpf-profiler/tree/fd60ef3f4a81577e4269bf821b11b38b81fadb52) for reproducibility. It includes [#889](https://github.com/open-telemetry/opentelemetry-ebpf-profiler/pull/889) which makes collector logs more configurable.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Configuration
5+
IMAGE_NAME="otelcol-ebpf-profiler-custom"
6+
IMAGE_TAG="${IMAGE_TAG:-latest}"
7+
8+
# Verify we're using minikube with driver=none
9+
if ! kubectl config current-context 2>/dev/null | grep -q "minikube"; then
10+
echo "❌ Error: Not using minikube context"
11+
echo "This script only supports minikube with driver=none"
12+
exit 1
13+
fi
14+
15+
MINIKUBE_DRIVER=$(minikube profile list -o json 2>/dev/null | grep -o '"Driver":"[^"]*"' | cut -d'"' -f4 || echo "")
16+
if [ "$MINIKUBE_DRIVER" != "none" ]; then
17+
echo "❌ Error: Minikube is using driver: $MINIKUBE_DRIVER"
18+
echo "This script only supports minikube with driver=none"
19+
echo ""
20+
echo "To use driver=none:"
21+
echo " sudo minikube delete"
22+
echo " sudo minikube start --driver=none"
23+
exit 1
24+
fi
25+
26+
echo "Building custom OpenTelemetry Collector..."
27+
echo "Image: ${IMAGE_NAME}:${IMAGE_TAG}"
28+
echo "Driver: none (using host Docker daemon)"
29+
echo ""
30+
31+
# Build with host Docker daemon
32+
docker build -f Dockerfile.custom -t ${IMAGE_NAME}:${IMAGE_TAG} .
33+
34+
echo ""
35+
echo "✅ Build complete!"
36+
echo ""
37+
echo "Deploy with:"
38+
echo " kubectl create namespace otel # if not exists"
39+
echo " kubectl apply -f k8s/opentelemetry-collector/"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
dist:
2+
name: otelcol-ebpf-profiler-custom
3+
description: Custom OpenTelemetry Collector with eBPF Profiler
4+
version: latest
5+
output_path: ./dist
6+
otelcol_version: latest
7+
8+
extensions:
9+
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension v0.139.0
10+
11+
exporters:
12+
- gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.139.0
13+
- gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.139.0
14+
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.139.0
15+
- gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.139.0
16+
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter v0.139.0
17+
18+
processors:
19+
- gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.139.0
20+
- gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.139.0
21+
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.139.0
22+
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.139.0
23+
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.139.0
24+
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.139.0
25+
26+
receivers:
27+
- gomod: go.opentelemetry.io/ebpf-profiler fd60ef3f4a81577e4269bf821b11b38b81fadb52
28+
import: go.opentelemetry.io/ebpf-profiler/collector
29+
30+
providers:
31+
- gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.45.0
32+
- gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.45.0
33+
- gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v1.45.0
34+
- gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.45.0
35+
- gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.45.0
36+
37+
# When adding a replace, add a comment before it to document why it's needed and when it can be removed
38+
replaces:
39+
# see https://github.com/openshift/api/pull/1515
40+
- github.com/openshift/api => github.com/openshift/api v0.0.0-20230726162818-81f778f3b3ec

0 commit comments

Comments
 (0)