Instrumenting my espresso machine with OpenTelemetry
A Gaggia espresso machine running the GaggiMate ESP32 controller is instrumented with OpenTelemetry and shipped to ClickHouse Cloud via ClickStack, modelling each shot as a trace with phase child spans and fast-moving sensor state as gauge metrics. The embedded engineering is the core. A flattened OTLP protobuf subset preserves upstream field numbers to fit nanopb limits. A FreeRTOS export task is pinned to core 1 and uses a snapshot-under-mutex pattern so TLS never blocks the 50ms brew loop. Exports are held until NTP sets the clock, and protobuf message concatenation lets a 500ms-sampled ring buffer ship within size limits. Channeling is detected on-device via a constant-memory coefficient of variation, and per-shot IDs stored as Map attributes avoid the cardinality explosion a label-based TSDB would suffer.
Related posts
- Making Rust observability reliable at scale with OpenTelemetry
Datadog Engineering mediumAdeptDatadog built dd-trace-rs, an opinionated Rust tracer on top of the OpenTelemetry Rust SDK, to fix fragmented traces, inconsistent sampling and context loss across Rust services. Upstream, they rewrote OpenTelemetry's active-context slot as a stack that tolerates out-of-order and overlapping scopes, which made some context operations 2–4x faster. They also fixed the tracing-opentelemetry bridge and a tracing subscriber callback bug so OpenTelemetry spans attach correctly inside tracing spans. On the Datadog side, a custom sampler defers keep/drop decisions and a span processor flushes whole trace chunks, emitting statistics for dropped spans; together these cut ingestion volume 20x while tripling indexed spans per service.
- IBM Instana’s solution for monitoring ClickHouse performance
ClickHouse easyNovice
IBM Instana, which stores its telemetry in ClickHouse, built a custom span exporter to trace ClickHouse's own query execution without adding load or invasive changes to customer systems. Materialized views were rejected because they add overhead and complexity. Instead, the exporter is deployed through the auto-discovering Instana agent and polls ClickHouse's OpenTelemetry span table with a sliding window so no spans are missed. It filters and formats spans before sending them to the backend, which stitches them into end-to-end traces. Design goals included one-line installation, automatic reconfiguration, a minimal footprint, and future support for metrics and profiling.
- LLM observability with ClickStack, OpenTelemetry, and MCP
ClickHouse mediumAdept
LibreChat (Node.js) and the Python ClickHouse MCP server can be instrumented with OpenTelemetry and shipped to ClickStack (HyperDX UI, OTel collector, ClickHouse) to observe LLM interactions, MCP tool calls and token usage with minimal code changes. Node.js runs under @hyperdx/node-opentelemetry, while Python uses standard opentelemetry-instrument with the API key passed in OTLP headers. Structured JSON logs are written to files and picked up by a separate collector using filelog and Prometheus receivers, with trace/span IDs and conversation IDs parsed out. In HyperDX, prompts can be filtered by log attribute and tied to a TraceId to follow each interaction and its prompt and completion token counts.
- Observability as a superpower
incident.io mediumAdeptDistributed tracing with OpenTelemetry lets incident.io engineers spot bugs before customers report them, by showing each request's route as a tree of timed spans that exposes slow steps, N+1 queries and duplicate calls. The team gets spans for free from instrumented database and HTTP clients, follows a consistent span naming convention, and tags spans with metadata such as table names, row counts, query fingerprints and org IDs. In Go, an internal library plus a defer-with-named-return pattern records errors on spans automatically. Traces go to Cloud Trace locally and to Grafana Tempo in production, where TraceQL queries power debugging. Trace URLs are threaded into logs, Sentry errors and response headers, with a caution that span and attribute volume drives storage cost.
- Building an Observability Solution with ClickHouse - Part 2 - Traces
ClickHouse mediumAdept
Trace data from OpenTelemetry-instrumented services can be stored and queried in ClickHouse, treating spans as rows in a single analytics table and visualizing them in Grafana. The walkthrough uses a ClickHouse fork of the OpenTelemetry Demo, configuring the OTEL Collector's contrib ClickHouse exporter with batching (5s or 100k spans), retries, TTL-based retention and secure endpoints, deployable via Docker Compose or Helm. Practical caveats include the exporter's hard-coded schema (pre-create tables to control types and codecs), its alpha status, and the need to pre-create non-default databases, followed by tips on schema optimization for the otel_traces table.