Our goal is to start tracking product events in the backend to, potentially, increase quality of the data (richer context, tracking accuracy).
Our hypothesis is that we can piggyback on structured logging + OTel's event tracking by introducing an exporter that will push events to our analytics platform (Amplitude), and, later, to other interesting destinations.
Possible outcomes of this spike include:
Why now?
- We're working on improving our product analytics stack and data capabilities. We want to learn and evolve together with our customers, and see how we can improve the product analytics space.
- We'd like to try out a process where engineering thinks upfront about what kind of events their business logic should emit. OTel instrumentation model provides excellent developer experience for that — for free.
- Frontend tracking has accuracy issues + events emitted from backend provide richer context (feature flag states, segments, server-side logic)
- An increasing number of customers want (and implement) warehouse-native analytics. We are interested to see how we can contribute to this while continuing to use open standards.
- Amplitude costs are growing - we need better control over what we track.
Considerations
- Platform-agnosticism. Our target is Amplitude but the OTel Collector supports many exporters, allowing customers to route events to any CDP or data warehouse they use.
- Our users need to be able to self-host this, and integrate in their data infrastructure with little friction.
- GDPR compliance from the get-go: pseudonymise/prevent PII, event routing, consent.
What we'd like to validate as part of PoC
Product:
Tech:
Privacy/Compliance:
Developer Experience:
Non-Goals
- Replace frontend tracking. Backend events are complementary, providing enriched context for existing frontend analytics.
- Track high-volume events like flag evaluations or API calls.
- Implement full data warehouse pipeline. The focus on routing events to existing infrastructure.
- Create new Analytics product offering. This is for internal product analytics to understand our users better, not a customer-facing feature — yet.
Our goal is to start tracking product events in the backend to, potentially, increase quality of the data (richer context, tracking accuracy).
Our hypothesis is that we can piggyback on structured logging + OTel's event tracking by introducing an exporter that will push events to our analytics platform (Amplitude), and, later, to other interesting destinations.
Possible outcomes of this spike include:
Why now?
Considerations
What we'd like to validate as part of PoC
Product:
Tech:
Privacy/Compliance:
Developer Experience:
Non-Goals
Thanks @asaphko — addressed your feedback (see updated description), also added non-goals.
Addressing @matthewelwell's feedback from Slack, posting a rough architecture diagram for the PoC and a list of deliverables:
graph TB subgraph "structlog-OTel Integration" API[Flagsmith API] SL[structlog Logger] SCHEMA[Event Schema<br/>- event_name<br/>- category<br/>- properties<br/>- privacy_level] OTEL_SDK[OTel SDK<br/>Logs Bridge] API --> SL SL --> SCHEMA SCHEMA --> OTEL_SDK end subgraph "OTel Collector Pipeline" subgraph "Routing & PII Stripping" RECV[OTLP Receiver] PROC1[Transf…