Should you use a log or a metric?
Logs record what was true at a decision point so you can reconstruct an event while debugging. Metrics are questions you commit to in advance and track over time even when nothing is wrong. Using a signup flow in the Sentry JavaScript SDK, the post shows when traces suffice (timing, but sampled), when to log (per-user failures, email delivery status) and when to emit counters, gauges or distributions (signup trends, funnels, queue depth, time-to-verify across requests). Practical rules: set shared attributes and user on the scope once, use the same names and keys on logs and metrics, count existing logs for ad-hoc debugging but don't build dashboards on them, and filter what reaches Sentry with beforeSendLog or level lists.
Related posts
- Logs, Metrics, and Traces: What Does Each Signal Tell You?
Railway easyNoviceLogs, metrics and traces answer different questions: metrics show when behaviour changed, traces show where in the service graph a request slowed or failed, and logs explain why. A worked checkout incident follows a p99 latency alert to a slow fraud-check span and then to logs filtered by trace_id, which is why structured JSON logs should carry trace_id/span_id and services should propagate the W3C traceparent header. On Railway, logs and infrastructure metrics are collected natively, while traces need OpenTelemetry exported to a third-party backend.
- Shifting Metrics Right
Honeycomb mediumAdeptInstead of pre-aggregating metrics inside applications, generate them as late as responsibly possible in the telemetry pipeline, either in the OpenTelemetry Collector or in the backend from traces and logs. The argument separates measurements (questions you want answered) from metrics (a pre-aggregated storage type). It claims the accuracy loss from sampling is negligible: one customer's sampled, trace-derived metrics were within 0.001% of their pre-aggregated data at a fraction of the cost. In-app aggregation buffers data for 10 to 60 seconds and can silently lose datapoints on a crash. A signaltometrics connector config shows how to derive HTTP semantic-convention exponential histograms from spans using AdjustedCount to account for sampling.
- Building On-call: Our observability strategy
incident.io mediumAdeptincident.io structures observability for its on-call product as a consistent drill-down path. A Grafana overview dashboard works as a traffic light for each subsystem. From there, engineers move to per-subsystem dashboards (alerts, alert routing, escalations, notifications), then to structured event logs, and finally to traces linked through exemplars. Each layer tracks concrete signals: queue depth and oldest un-acked PubSub message, seconds of work per second, and outcome-labelled metrics such as rate_limited or new_incident. Treating dashboards as a product with a shared design system avoids "dashboard soup" and makes observability usable by the whole team during incidents.
- Own Your Observability: Supabase Metrics API
Supabase mediumAdeptSupabase's Metrics API exposes roughly 200 Postgres health and performance metrics per project in Prometheus exposition format at a privileged endpoint authenticated with service-role Basic Auth, refreshed every minute. It can be scraped by Grafana Cloud, Datadog, AWS Managed Prometheus or any Prometheus-compatible backend, so database telemetry can be correlated with existing application observability. Suggested signals and alerts include connection saturation, CPU/memory above 80%, disk I/O wait, replication lag and post-deploy query regressions, plus using PgBouncer for bursty connection patterns.
- From one switch to a control panel: meet `dataCollection`
Sentry mediumAdeptSentry's JavaScript SDK v11 replaces the all-or-nothing `sendDefaultPii` boolean with `dataCollection`, a per-category config covering user info, cookies, HTTP headers and bodies, query params, GenAI inputs/outputs, database queries and more. The new defaults collect more than v10 did, including user info, cookies, truncated request/response bodies, GenAI I/O and DB query data. Sensitive values such as tokens and passwords are still filtered by a built-in denylist, and manually attached data is always sent. Users who had `sendDefaultPii: true` can simply delete it, while those relying on the old restrictive default must set explicit allow/deny options. Because span streaming is now on by default, span filtering should move to `beforeSendSpan` and `ignoreSpans`.