A Prometheus exporter for Cisco Meraki Dashboard API metrics with OpenTelemetry tracing support.
- Complete device coverage: Collects metrics from all Meraki device types (MS, MR, MV, MT, MX, MG)
- Organization-level metrics: API usage, licenses, device counts, network health alerts
- Device-specific metrics: Status, performance, sensor readings, port statistics
- Webhook receiver: Real-time event processing from Meraki Dashboard alerts
- Client tracking: Optional DNS-enhanced client identification and monitoring (disabled by default)
- Cardinality monitoring: Built-in
/cardinalityUI and/api/metrics/cardinalityJSON API
- High-performance collection: Parallel organization processing with bounded concurrency
- Shared inventory caching: Reduces duplicate org/network/device lookups with tier-aware TTLs
- Automatic metric expiration: Prevents stale metrics for offline/removed devices
- Retry-aware API client: Exponential backoff on rate limits with per-endpoint latency metrics
- Prometheus metrics:
/metricsendpoint for scraping - Distributed tracing: Full request tracing with OpenTelemetry instrumentation
- Structured logging: logfmt output with trace correlation and contextual information
- Cardinality monitoring: Built-in tracking and warning metrics for metric growth
- Health monitoring: Collector health metrics with success rates, failure streaks, and last success timestamps
- Docker support with health checks and multi-stage builds
- Configurable collection intervals (fast/medium/slow tiers)
- Environment-based configuration with validation
- Regional API endpoint support
-
Copy
.env.exampleto.envand add your Meraki API key:cp .env.example .env # Edit .env and set: MERAKI_EXPORTER_MERAKI__API_KEY=your_api_key_here -
Run with Docker Compose:
docker compose up -d
-
Access metrics at http://localhost:9099/metrics
If you need to build the Docker image from source:
# Build the image
docker build -t meraki-dashboard-exporter .
# Run the container
docker run -d \
-e MERAKI_EXPORTER_MERAKI__API_KEY=your_api_key_here \
-p 9099:9099 \
meraki-dashboard-exporterThe exporter provides OpenTelemetry tracing when enabled:
Tracing: Distributed tracing for all operations
- Every Meraki API call is traced with timing and metadata
- Automatic instrumentation of HTTP, threading, and logging
- Configurable sampling rates for production use
- Correlation with logs via trace IDs
Logs: Structured logging with trace correlation
- Automatic trace context injection (trace_id, span_id)
- All logs include trace context when within a span
- Structured log fields preserved for easy parsing
- Compatible with log aggregation systems
Benefits:
- Prometheus metrics with traces and logs for correlation
- Debug slow API calls and identify bottlenecks
- Track request flow across the entire system
- Compatible with Jaeger, Tempo, Datadog, New Relic, etc.
Set these environment variables:
# Enable OTEL tracing
export MERAKI_EXPORTER_OTEL__ENABLED=true
# Set the OTEL collector endpoint
export MERAKI_EXPORTER_OTEL__ENDPOINT=http://localhost:4317
# Optional: Add resource attributes
export MERAKI_EXPORTER_OTEL__RESOURCE_ATTRIBUTES='{"environment":"production","region":"us-east"}'
# Optional: Configure trace sampling rate (default: 0.1 = 10%)
export MERAKI_EXPORTER_OTEL__SAMPLING_RATE=0.1services:
meraki-exporter:
image: meraki-dashboard-exporter
environment:
- MERAKI_EXPORTER_MERAKI__API_KEY=${MERAKI_EXPORTER_MERAKI__API_KEY}
- MERAKI_EXPORTER_OTEL__ENABLED=true
- MERAKI_EXPORTER_OTEL__ENDPOINT=http://otel-collector:4317
ports:
- "9099:9099"
otel-collector:
image: otel/opentelemetry-collector-contrib:latest
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
- "4317:4317" # OTLP gRPC receiverSee docs/observability/otel.md for detailed OpenTelemetry configuration and docs/observability/tracing.md for distributed tracing documentation.
The exporter can receive real-time webhook events from Meraki Dashboard, providing immediate notification of alerts, configuration changes, and other events.
# Enable webhook receiver
export MERAKI_EXPORTER_WEBHOOKS__ENABLED=true
# Set shared secret for validation (recommended)
export MERAKI_EXPORTER_WEBHOOKS__SHARED_SECRET=your_secret_here
# Optional: Require secret validation (default: true)
export MERAKI_EXPORTER_WEBHOOKS__REQUIRE_SECRET=true
# Optional: Maximum payload size in bytes (default: 1MB)
export MERAKI_EXPORTER_WEBHOOKS__MAX_PAYLOAD_SIZE=1048576- Navigate to Network-wide > Configure > Alerts
- Add a webhook receiver pointing to:
http://your-exporter:9099/api/webhooks/meraki - Set the shared secret to match your configuration
- Select which alert types to send
meraki_webhook_events_received_total: Total webhook events received by org and alert typemeraki_webhook_events_processed_total: Successfully processed webhook eventsmeraki_webhook_events_failed_total: Failed webhook event processingmeraki_webhook_processing_duration_seconds: Time spent processing webhook eventsmeraki_webhook_validation_failures_total: Validation failures by error type
All configuration is done via environment variables. See .env.example for all available options.
MERAKI_EXPORTER_MERAKI__API_KEY: Your Meraki Dashboard API key
MERAKI_EXPORTER_MERAKI__ORG_ID: Specific org ID to monitor (monitors all orgs if not set)MERAKI_EXPORTER_LOGGING__LEVEL: Logging level (default: INFO)MERAKI_EXPORTER_MERAKI__API_BASE_URL: API base URL for regional endpoints (default: https://api.meraki.com/api/v1)MERAKI_EXPORTER_API__TIMEOUT: API request timeout in seconds (default: 30)MERAKI_EXPORTER_API__MAX_RETRIES: Maximum API request retries (default: 3)MERAKI_EXPORTER_API__CONCURRENCY_LIMIT: Max parallel collector/org work (default: 5)MERAKI_EXPORTER_API__BATCH_SIZE: Default batch size for API operations (default: 20)MERAKI_EXPORTER_CLIENTS__ENABLED: Enable client collector and DNS resolution (default: false)MERAKI_EXPORTER_WEBHOOKS__ENABLED: Enable Meraki webhook receiver (default: false)
MERAKI_EXPORTER_UPDATE_INTERVALS__FAST: Fast tier interval in seconds (default: 60, range: 30-300)MERAKI_EXPORTER_UPDATE_INTERVALS__MEDIUM: Medium tier interval in seconds (default: 300, range: 300-1800)MERAKI_EXPORTER_UPDATE_INTERVALS__SLOW: Slow tier interval in seconds (default: 900, range: 600-3600)
For users in specific regions, use the appropriate API base URL:
- Global/Default:
https://api.meraki.com/api/v1 - Canada:
https://api.meraki.ca/api/v1 - China:
https://api.meraki.cn/api/v1 - India:
https://api.meraki.in/api/v1 - US Federal:
https://api.gov-meraki.com/api/v1
Example:
export MERAKI_EXPORTER_MERAKI__API_BASE_URL="https://api.meraki.ca/api/v1" # For Canada region- Organization & license metrics: API usage, device/network counts, licenses, configuration, and alerts
- Device metrics: Availability, status info, switch port health (including per-second error rates), AP performance, camera/sensor readings, and gateway connectivity
- Network health metrics: RF/channel utilization, connection stats, Bluetooth sightings, and data rates
- Client metrics (optional): Per-client status and usage when
MERAKI_EXPORTER_CLIENTS__ENABLED=true - Webhook metrics (optional): Event counts, validation failures, and processing duration for
POST /api/webhooks/meraki - Infrastructure metrics: Collector duration/error counts, parallel collection activity, API latency/counters, inventory cache hits/misses/size, and metric expiration tracking
- Cardinality monitoring:
/cardinalityHTML report and/api/metrics/cardinalityJSON API for top-k series growth
See the generated metrics reference for the authoritative metric list (kept in sync via uv run python scripts/generate_metrics_docs.py).
- Bounded concurrency: ManagedTaskGroup keeps parallel collectors/orgs within
MERAKI_EXPORTER_API__CONCURRENCY_LIMIT - Tiered scheduling: FAST/MEDIUM/SLOW tiers align with data volatility (60s/300s/900s by default)
- Inventory caching: Organization/network/device lookups cached per tier with TTL to reduce duplicate API calls
- Batch controls: Tunable batch sizes and delays (
MERAKI_EXPORTER_API__*BATCH_SIZE,MERAKI_EXPORTER_API__BATCH_DELAY) - Metric lifecycle: Automatic expiration cleans up stale series when devices disappear or go offline
uv run pytestuv run ruff check .
uv run mypy .MIT