Skip to content

Repository files navigation

Diffdash

PR-scoped observability dashboard generator.

Diffdash analyzes Ruby code changed in a Pull Request and generates dashboards for Grafana, Datadog, or Kibana — showing only the logs and metrics relevant to your changes.

No more searching through dashboards with thousands of metrics. See exactly what matters to your code.

Quick Start

gem install diffdash

Create diffdash.yml:

outputs:
- grafanagrafana:
url: https://myorg.grafana.netfolder_id: 42

Set your token and run:

export DIFFDASH_GRAFANA_TOKEN=glsa_xxxxxxxxxxxx
diffdash

Supported Backends

BackendOutputAPI Upload
GrafanaLoki logs, PromQL metrics
DatadogLog streams, timeseries
KibanaSaved searches, metrics
JSONRaw signal data

CLI

diffdash grafana # Generate Grafana dashboard
diffdash kibana # Generate Kibana dashboard 
diffdash datadog # Generate Datadog dashboard
diffdash json # Output raw signal JSON
diffdash grafana --dry-run # Generate without uploading
diffdash grafana folders # List Grafana folders
diffdash kibana folders # List Kibana spaces
diffdash lint # Check for observability best practices
diffdash lint --verbose # Show details for each issue
diffdash --list-signals # Show detected signals

What It Detects

Logs:

logger.info("user_created")Rails.logger.error("payment_failed")

Metrics:

StatsD.increment("orders.processed")Prometheus.counter(:requests_total).incrementHesiod.emit("cache.hit")# Also resolves centralized metric constants:Metrics::RequestTotal.increment# → "request_total"

GitHub Actions

name: Diffdash Dashboardon:
pull_request:
paths: ["**/*.rb", "!spec/**"]jobs:
dashboard:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v4with:
fetch-depth: 0
- uses: ruby/setup-ruby@v1
- run: gem install diffdash
- run: diffdash --verboseenv:
DIFFDASH_GRAFANA_URL: ${{ secrets.DIFFDASH_GRAFANA_URL }}DIFFDASH_GRAFANA_TOKEN: ${{ secrets.DIFFDASH_GRAFANA_TOKEN }}

Configuration

Environment variables always override config file values.

VariableDescription
DIFFDASH_GRAFANA_URLGrafana URL
DIFFDASH_GRAFANA_TOKENGrafana Service Account token
DIFFDASH_DATADOG_API_KEYDatadog API key
DIFFDASH_DATADOG_APP_KEYDatadog Application key
DIFFDASH_KIBANA_URLKibana URL
DIFFDASH_KIBANA_API_KEYKibana API key
DIFFDASH_OUTPUTSComma-separated outputs
DIFFDASH_INTERPOLATED_LOGSHow to handle interpolated logs (include, warn, exclude)

Signal Filtering

Control how interpolated logs are handled:

# diffdash.ymlsignals:
interpolated_logs: exclude # exclude noisy dynamic logs
ValueBehavior
includeInclude all logs (default)
warnInclude all, show CLI warning
excludeExclude interpolated logs from dashboard

See DOCS.md for full configuration reference.

Example

For a complete working example with CI integration, see: diffdash-test-app

Documentation

📖 Full Documentation — Configuration, signal detection, GitHub Actions, troubleshooting.

License

MIT

About

PR-scoped observability signal extractor and Grafana dashboard generator. Observability focused on the code you are shipping.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages