A simple OTEL-instrumented Python Flask app that generates traces, metrics, and logs for observability testing.
- OpenTelemetry tracing via OTLP gRPC
- Metrics exported to Prometheus-compatible OTLP endpoint
- Structured logs exported via OTLP
- Exposes several endpoints for testing behavior
| Path | Description |
|---|---|
/ |
Root message - Randomly fails (HTTP 500 or timeout) |
/0/ |
Emits OTEL trace, metric & log |
/health |
Health check (200 OK) |
- A trace span (
generate-trace-span) - Metric:
dummy_requests_total - Log messages via OTLP
Built for Kubernetes observability pipelines with Grafana Alloy or any OTLP-compatible collector.
You must have Grafana Alloy (or any OTLP-compatible receiver) running and accessible at the configured endpoint.
In a Grafana Cloud Kubernetes Monitoring setup, this is usually:
grpc://grafana-k8s-monitoring-alloy-metrics.<namespace>.svc.cluster.local:4317
Alloy must support:
- OTLP/gRPC (
4317) - Prometheus metric scraping (via
k8s.grafana.com/scrape: "true"annotation) - Stdout logs (if Alloy is configured to collect pod logs)
Prebuilt multi-architecture Docker images are available on GitHub Container Registry (GHCR):
docker run -p 8000:8000 \
-e OTEL_EXPORTER_OTLP_ENDPOINT=http://your-otel-collector:4317 \
-e OTEL_EXPORTER_OTLP_PROTOCOL=grpc \
ghcr.io/marinnedea/dummy-otel:latestPlatforms Supported
- linux/amd64
- linux/arm64
Pull Specific Version
docker pull ghcr.io/marinnedea/dummy-otel:latestdocker build -t dummy-otel .
docker run -p 8000:8000 \
-e OTEL_EXPORTER_OTLP_ENDPOINT=grpc://<your-alloy-host>:4317 \
-e OTEL_EXPORTER_OTLP_PROTOCOL=grpc \
dummy-otelThen:
curl http://localhost:8000
curl http://localhost:8000/metricsOr use the included poll-dummy-otel.sh script into a cronjob to run every minute and append output to a local log file.
Make it executable:
chmod +x $HOME/dummy-otel/poll-dummy-otel.shThen create a cronjob for it:
crontab -eWarning
Make sure to replace kubectl with the full path (e.g., /usr/local/bin/kubectl) when used in cron jobs.
Also, cron doesn’t run your shell profile (like .bashrc or .profile), so variables like $HOME may not be defined the way you expect in crontab -e.
Use the full absolute path instead of $HOME!
* * * * * /home/your_user/dummy-otel/poll-dummy-otel.sh >> /path/to/dummy-otel/poll.log 2>&1
Use a Deployment like this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: dummy-otel
namespace: dummy-otel
spec:
replicas: 1
selector:
matchLabels:
app: dummy-otel
template:
metadata:
labels:
app: dummy-otel
annotations:
k8s.grafana.com/scrape: "true"
spec:
containers:
- name: dummy-otel
image: ghcr.io/marinnedea/dummy-otel:latest
ports:
- containerPort: 8000
env:
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: grpc://grafana-k8s-monitoring-alloy-metrics.my-pi-namespace.svc.cluster.local:4317
- name: OTEL_EXPORTER_OTLP_PROTOCOL
value: grpcDesigned and tested on:
- Raspberry Pi 5/ ARM64
- K3s and Kubernetes
- Grafana Alloy and Grafana Cloud
To be used with:
- Grafana Alloy
- Grafana Tempo
- Grafana Loki
- Prometheus-compatible backend (via OTLP)
Metrics:
Logs:
