Extended observability — pushing API logs to Grafana / Loki
April 27, 2023
We're excited to add another option for external observability: you can send API call logs from Unified.to directly to a Grafana Loki–compatible endpoint. directly to a Grafana Loki–compatible endpoint. This is the same class of logs we already support for Datadog; you choose where they go in your workspace settings.
Grafana Cloud and Grafana Loki are commonly used for log aggregation and querying. Unified delivers logs using Loki's standard HTTP push API.
Setting it up is easy! Here's how:
- Prepare your endpoint and credentials
- In Grafana Cloud, open your stack and note the logs / Loki ingest base URL (no path) — often
https://logs-prod-XX.grafana.net(your region may differ). If you use self-hosted Loki, use that base URL instead. - Create or copy a logs token (or the username + token pair your provider documents for Basic auth). Set
grafana_siteexplicitly for EU/regional Grafana Cloud stacks or self-hosted Loki; if you leave it blank, our API falls back to a default US Grafana Cloud logs host, which may not match your region.
- In Grafana Cloud, open your stack and note the logs / Loki ingest base URL (no path) — often
- Enter values in workspace settings
- Open Workspace settings (or use the Workspace API) and choose Grafana under external logging. Configure:
- Loki base URL (
grafana_site): Base URL only (for example https://logs-prod-XX.grafana.net) - Authentication: Basic (Grafana Cloud: user/instance id + token), Bearer (if your gateway expects a bearer token), or Legacy (single field — see below).
- Token / API key (
grafana_apikey): Your secret or legacyuser:tokenstring, depending on mode.
- Loki base URL (
- Open Workspace settings (or use the Workspace API) and choose Grafana under external logging. Configure:
- Confirm logs are flowing
- Make a sample call to the Unified API (for example, list an object on a connection). In Grafana Explore (or any Loki client), run LogQL such as
{job="unified-api"}. Log lines include JSON with the routepath,integration_type,status, and other API-call fields.
- Make a sample call to the Unified API (for example, list an object on a connection). In Grafana Explore (or any Loki client), run LogQL such as
Why does Grafana / Loki matter for Unified.to users?
By sending your logs directly to your own Loki stack or Grafana Cloud, you get immediate visibility into what's happening in your environment. This allows you to quickly debug issues, get notified about errors, and more. Currently, we support both inbound API calls and webhook calls.
However, we're constantly improving our product, and we're looking forward to supporting more log types in the future. So, please send us feedback so we can better understand what you need.
About Unified.to
If you're not familiar with Unified API, it's a single API that you can use to read and write data to third-party integrations using our unified data model. This makes it easy to integrate with multiple systems and eliminates the need for separate API calls for each integration.
We hope this new feature makes your life easier and your work more efficient!