Implement observability for Evernote integrations.
Use when setting up monitoring, logging, tracing,
or alerting for Evernote applications.
Trigger with phrases like "evernote monitoring", "evernote logging",
"evernote metrics", "evernote observability".
Comprehensive observability setup for Evernote integrations: Prometheus metrics for API call tracking, structured JSON logging, OpenTelemetry tracing, health check endpoints, and alerting rules.
Prerequisites
Monitoring infrastructure (Prometheus, Datadog, or CloudWatch)
Log aggregation (ELK, Loki, or CloudWatch Logs)
Alerting system (PagerDuty, Opsgenie, or Slack webhooks)
Instructions
Step 1: Metrics Collection
Track key metrics with Prometheus counters and histograms: evernote_api_calls_total (by method and status), evernote_api_duration_seconds (latency histogram), evernote_rate_limits_total (rate limit hits), evernote_quota_usage_bytes (upload quota consumption).
Wrap the NoteStore with a Proxy that automatically records metrics for every API call. Increment counters on success/failure, observe latency in histograms, and count rate limit events.
Step 3: Structured Logging
Use JSON-formatted logs with consistent fields: timestamp, level, method, duration, userId (hashed), noteGuid. Redact access tokens from all log output.
For incident handling, see evernote-incident-runbook.
Examples
Grafana dashboard: Display API call rate, p50/p95/p99 latency, error rate, rate limit frequency, and quota usage on a single dashboard. Set time range to last 24 hours.
Rate limit alerting: Alert on-call when rate limit hits exceed 5 per 10-minute window. Include runbook link to evernote-rate-limits in the alert annotation.