Repository navigation
[ADD] : Observability foundation - Structured JSON logging, Fluent Bit/Loki, Distributed Tracing. Phase 6 - #13
Merged
Conversation
…, infra/business category split
…_setup.py, infra/business category split
….py, infra/business category split
…tup.py, infra/business category split
…tup.py, infra/business category split
AlexandreN8
force-pushed
the
feature/observability-retrofit
branch
from
July 17, 2026 21:34
013a9c1 to
fc6f81f
Compare
…etup.py, infra/business category split
…p.py, infra/business category split
…a datasource with Loki trace-to-log correlation
…traceparent propagated via payload's trace_context field
…ext received from iot_devices
…for two distinct operations
…nested in anomalie's original_message
…nested in dlq's original_message
…ng dependent services
…te_write to Prometheus
… Tempo's metrics-generator) + log volume by service/category
…rts overview, and navigation to the other 3 dashboards
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Structured JSON logging across all 9 services (edge + PaaS), Loki + Fluent Bit log aggregation, OpenTelemetry distributed tracing across the full pipeline, Tempo metrics-generator for RED metrics, and 5 new Grafana dashboards replacing the Phase 0 placeholder.
Why
print()made cross-service debugging nearly impossible, and gave no way to separate infra noise from business eventsChanges
logging_setup.py(duplicated per service, same pattern asheartbeat.py): JSON output withtimestamp,level,service,category(infra|business), dynamicfieldslog_driver: fluentd, forwarding to Fluent Bit's Forward protocol receiver;service/category/levelpromoted to real indexed Loki labels viaLabel_Keystracing_setup.py(duplicated per service): OTel SDK, W3C trace context.trace_contextpropagated in the JSON payload itself, not Kafka headers - avoids requiring two different extraction mechanisms depending on whether a message arrived via MQTT (no native headers) or Kafkaspan-metrics,service-graphs) derives RED metrics (Rate, Duration - Errors pending span-status instrumentation) from existing traces with no extra application code, remote-written to PrometheusDesign notes / issues found only through end-to-end validation
aggregator.flush_windowis a deliberately untethered span (no parent context) - a window aggregates many different messages/traces, so it can't legitimately belong to any single oneota_agentis not traced - no Kafka-forwarded event exists to correlate; a span here would only ever produce an isolated single-span trace with no real correlation value. RED metrics for it are deferred to a future Prometheus/metricsretrofit (noted as Phase 7.1 debt), not built herepre_tasks:is required to gate role deployment on Fluent Bit/OTel Collector's ports being ready. A barewait_foron Fluent Bit's port isn't fully sufficient either (Docker's fluentd log driver does a handshake beyond raw TCP connectivity)> bool 0), not a true per-service up/down - onlyerror_handlerexposes a real scraped/metricsendpoint todayHow it was tested
iot_devices→edge_processor(x2 spans) →cleaner→ parallelanomaly_detector/aggregator, both happy-path and DLQ-rejection branchestraces_spanmetrics_calls_total/latency_bucketconfirmed queryable in Prometheus with real values matching live traffic