Trifle: Open-Source Time-Series Analytics for Developers

Trifle: Open-Source Time-Series Analytics for Developers

Trifle is an open-source time-series analytics platform designed to simplify how developers track metrics by storing pre-aggregated "answers" rather than raw event logs. By rolling up data into time buckets at the point of write, Trifle reduces the infrastructure overhead typically associated with high-volume event tracking.

Pre-Aggregated Storage Model

Trifle optimizes data storage and query performance by aggregating metrics into time buckets as they are written to the database. This approach allows for instant querying at any resolution without the need to process millions of raw events during read time.

Implementation and Workflow

The data flow in Trifle consists of three primary stages:

  1. Data Ingestion: Metrics are sent via a single API call containing a key, a timestamp, and nested values. These are rolled up into time buckets immediately.
  2. Data Retrieval: Users can select a specific timeframe and granularity to retrieve timestamps and values.
  3. Visualization: The Trifle App reads directly from the database to convert these keys into dashboards, alerts, and digests.

Multi-Language Support and Use Cases

Trifle provides libraries for Ruby, Elixir, and Go, allowing developers to instrument their codebases with a single interface. The tool is designed for several specific technical and business use cases:

  • Revenue Tracking: Monitoring orders, conversion rates, and revenue across different channels and regions using hierarchical breakdowns.
  • Background Worker Monitoring: Tracking throughput and success rates for systems like Sidekiq or Oban.
  • Feature Usage: Measuring feature adoption and user segments without relying on third-party analytics providers.
  • Custom Code Insights: Instrumenting API response times, cache hit rates, and custom business logic.
  • Business KPIs: Creating dashboards for non-technical stakeholders to monitor churn rates and daily signups.
  • AI Agent Analytics: Providing a CLI and MCP (Model Context Protocol) integration that allows AI agents (such as Claude Code, Cursor, and Codex) to build and query local metrics databases.

Ecosystem and Integration

Trifle includes a library for data collection, a visualization dashboard, and a CLI. To support AI-driven development, Trifle offers "Agent Skills" that can be installed via npx -y @trifle-io/install, providing coding agents with best practices for metric payloads and execution tracing.

Community Discussion and Technical Considerations

Community feedback from Hacker News highlights several technical trade-offs inherent in the approach of storing aggregated data over raw events:

  • Data Granularity: Some users questioned the necessity of discarding raw event data, noting that disk space is relatively cheap and raw logs are often necessary for retrospective analysis when the original aggregation logic was incorrect.

  • Performance Impact: There are concerns regarding the potential impact of high-volume metric writes on the primary database and whether loading complex performance dashboards could affect application performance (e.g., interfering with a user's ability to complete a purchase).

  • Comparison to Prometheus: Users have compared Trifle's functionality to Prometheus and its associated time-series databases, specifically regarding how it handles statistics like p95 calculations.

Licensing and Availability

  • Libraries: Distributed under the MIT license.
  • App & CLI: Distributed under the ELv2 (Elastic License 2.0).
  • Cloud Pro: A hosted version is available for early adopters with a lifetime pricing tier.

Sources