Maple Observability Platform

repository·main·Indexed 23 days ago

https://github.com/mapletechlabs/maple

An open-source observability platform for traces, logs, and metrics built on OpenTelemetry and ClickHouse. The project features a monorepo architecture with an Effect-based backend, a TanStack Router SPA frontend, and AI-driven components including @maple/chat-flue for headless triage and investigations, and an MCP server with deterministic and LLM-based evaluation layers.

Tokens
245.3K
Snippets
344
Records
1K
Agent score
81%

What's inside Maple

  1. Overview of @maple/unitflow

    main

    @maple/unitflow is a vendored and ported version of the unitflow library. It includes both @unitflow/core and @unitflow/react functionality, specifically adapted to work with the workspace's version of effect.

    Because the upstream library requires a specific version of effect that may conflict with the workspace's bun-patched version, this package is maintained as a vendored copy to ensure compatibility and stability across effect beta releases.

  2. Overview of Maple v2 Public API Resources

    main

    The Maple v2 API is a structured, two-tier API surface. It uses snake_case for wire schemas and provides access to various resources including authentication, observability, and alerting.

    Key Resource Groups:

    • Authentication: api_keys (pilot), ingest_keys.
    • Observability (Telemetry): traces, logs, metrics, services, service_map, session_replays.
    • Alerting: alerts/rules, alerts/destinations, alerts/incidents, alerts/deliveries.
    • Operations & Monitoring: dashboards, investigations, anomalies, error_issues, scrape_targets, instrumentation/audit.
    • Configuration: attribute_mappings, organization, integrations/slack.
  3. Overview of @maple/slack-agent

    main

    The @maple/slack-agent is a general-purpose Slack agent built on the eve framework. It is designed to be self-deployed to Railway (not Vercel) and supports multi-workspace distribution.

    Key capabilities include:

    • Responding to @mentions and Direct Messages (DMs).
    • Running tools and maintaining durable multi-turn sessions.
    • Multi-workspace support: A single Slack app can be distributed to multiple workspaces, each linked to a specific Maple organization. The agent resolves per-team credentials (bot token + Maple API key) via the Maple API.
    • Observability: Connects to Maple's MCP server for observability tools.
  4. Overview of @maple/chat-flue

    main

    @maple/chat-flue is Maple's AI chat and headless triage system. It is built on the Flue framework and runs on Cloudflare Workers AI. It powers three primary surfaces:

    1. General Chat: Accessible via /chat and the global chat sheet for general telemetry questions.
    2. Investigations: Durable 'war rooms' per incident at /investigations/*. apps/api initiates the first autonomous turn, and the browser can join the same agent instance to continue it.
    3. Headless Triage: A workflow invoked by apps/api when an incident opens to handle automated triage.
  5. Introduction to Maple Observability

    main

    Maple is an open-source observability platform built on OpenTelemetry designed for distributed systems. It provides a unified interface for exploring:

    • Traces: Visualize request flows via flamegraphs and span hierarchies. Includes automatic service-to-service dependency detection and interactive service maps.
    • Logs: Searchable logs that are automatically correlated with traces. Clicking a log line allows you to jump directly to the producing trace and span.
    • Metrics: Real-time charts for throughput, error rates, and latency. Maple handles probability-based sampling to extrapolate accurate throughput from sampled data.
    • Service Map: An interactive visualization of service connections showing call rates, error rates, and latency to identify bottlenecks.
    • AI-Powered Queries: Natural language querying via MCP integration to diagnose errors and explore system health without manual query writing.
  6. Overview of Maple SDKs

    main

    Maple SDKs are opinionated wrappers around OpenTelemetry (OTel) designed to auto-detect platform conventions. They automatically capture metadata such as commit SHAs, deployment environments (e.g., Vercel, Cloudflare, Railway), and runtime details. This allows you to ship traces, logs, and metrics with minimal configuration, typically via a single layer() call.

    Key features of an official Maple SDK include:

    • Automatic Metadata Detection: Picks up environment variables from major cloud providers automatically.
    • Safe No-ops: If the MAPLE_ENDPOINT is not configured, the SDK becomes a no-op, allowing local development without a Maple project.
    • Platform-Specific Entry Points: Optimized builds for server, browser, and serverless runtimes.
    • API Synchronization: SDKs are updated to match new resource attributes or signal types added to the Maple ingest API.
  7. OpenTelemetry Specification Map file overview

    main

    The OpenTelemetry Specification Map is a collection of documentation files used for spec-compliance checks, best-practice generation, and fact-checking.

    FileScope
    traces.mdTrace API & SDK: span model, SpanKind, status, samplers, processors, span limits, ID generators
    metrics.mdMetrics API, SDK & data model: instruments, temporality, exemplars, views, exponential histograms, cardinality
    logs.mdLog data model, severity, bridge API, SDK, events-as-logs
    context-propagation.mdContext, W3C traceparent/tracestate, baggage, B3/Jaeger interop
    otlp.mdOTLP protocol: transports, partial success, retry semantics, JSON encoding, exporter env vars
    resource-and-config.mdResource spec & merge rules, resource semconv, consolidated SDK env-var table, declarative config, entities
    semantic-conventions.mdNaming rules, requirement levels, HTTP/DB/messaging/RPC/exceptions/code/gen-ai domains, schema-URL migrations
    stability-and-compliance.mdStability taxonomies, versioning guarantees, compliance matrix, error-handling & performance principles, instrumentation guidelines
    emerging-and-compat.mdProfiles signal, telemetry schemas deep-dive, Prometheus/OpenMetrics interop, OpenTracing/OpenCensus shims
  8. Understand the Maple product purpose and user personas

    main

    Maple is an open-source OpenTelemetry observability platform designed for high-speed incident triage, capacity review, and service-health checks. It surfaces traces, logs, metrics, errors, alerts, infrastructure, and service maps.

    Key Features

    • OpenTelemetry Native: No vendor lock-in or specific OTel dialects to manage.
    • Cost Transparency: Surfaces ingest cost, retention, and sampling consequences directly in the UI where engineers make decisions.
    • Sovereign Hosting: Designed to be self-hosted under Apache 2.0.
    • Performance Focused: Optimized for speed, aiming to allow engineers to reach an offending span from a page alert in under 10 seconds.

    Target Users

    • On-call Engineers (SRE, Backend, Platform): Users who need to find slow spans, broken logs, or misbehaving services quickly during high-pressure incidents.
    • Platform Teams: Users self-hosting Maple who require a tool that feels like a peer-built utility rather than a commercial vendor product.
  9. Use the bench-queries CLI for ClickHouse benchmarking

    main

    bench-queries is a CLI tool used to measure the performance cost of dashboard queries by replaying exact SQL captured from production traces. It allows you to mine recent queries from Tinybird, replay them against a ClickHouse target, inspect execution plans, and compare performance metrics (p95 wall-time, read bytes, and memory) between different runs to validate optimizations.

    By default, output JSON files are saved to apps/api/scripts/.bench/ (this directory is gitignored).

    # Commands
    
    bun bench:fetch    [--context name] [--profile name] [--since 24h] [--top 20] [--out path] [--org id]
    bun bench:run      <file> [--runs 5] [--warmup 1] [--out path]
    bun bench:inspect  <file>
    bun bench:compare  <a.json> <b.json>
  10. Compare Maple ingest options for ClickHouse

    main

    Choose the best ingestion method based on your deployment needs:

    OptionDescriptionBest For
    Option A: Maple OTel CollectorCustom otelcol-contrib with mapleexporter.Recommended; easiest setup, k8s metadata support.
    Option B: Tinybird exporter + shimUses standard Tinybird exporter pointing to a custom shim service.Advanced users who want to write their own shim.
    Option C: Tinybird-LocalA Tinybird-API-compatible local server backed by ClickHouse.Users who want the Tinybird UI side-by-side.
    Option D: Direct INSERTsApplication sends INSERT INTO traces FORMAT JSONEachRow directly.Small, well-defined ingest paths via custom SDKs.
  11. What is included in the maple-otel deployment?

    main

    The maple-otel deployment consists of:

    • OpenTelemetry Collector: A custom build using the image ghcr.io/makisuo/maple/otel-collector-maple:<chart appVersion>.
    • Receivers: Supports OTLP via both gRPC and HTTP.
    • Processors: Includes memory_limiter, batch, and an optional k8sattributes processor (enabled by default, which uses cluster-scoped RBAC to look up pod/namespace/deployment metadata).
    • Exporter: The mapleexporter which writes to the following Maple schema tables: traces, logs, metrics_sum, metrics_gauge, metrics_histogram, and metrics_exponential_histogram.
    • Ingress (Optional): Can expose OTLP traffic externally using TLS via a namespace-scoped HTTP01 ACME Issuer (Let's Encrypt).