Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

update log drain docs (#28396)

Inianf6f2af0f85eb
diff --git a/apps/docs/content/guides/platform/log-drains.mdx b/apps/docs/content/guides/platform/log-drains.mdx
index eeb5e42d351..78381929ca3 100644
--- a/apps/docs/content/guides/platform/log-drains.mdx
+++ b/apps/docs/content/guides/platform/log-drains.mdx
@@ -14,47 +14,77 @@ You can read about the initial announcement [here](https://github.com/orgs/supab
</Admonition>
-The following table lists the supported destinations and the required setup configuration:
+## Supported Destinations
-| Destination | Transport Method | Configuration |
-| ------------------ | ---------------- | ------------------------------------------------- |
-| Generic Webhook | HTTP | URL <br /> HTTP Version <br/> Gzip <br /> Headers |
-| Datadog | HTTP | API Key <br /> Region |
-| Loki | HTTP | URL <br /> Headers |
-| Elastic - Filebeat | HTTP | URL <br /> Username and Password |
+The following table lists the supported destinations and the required setup configuration:
-### Destinations And Behavior
+| Destination | Transport Method | Configuration |
+| --------------------- | ---------------- | ------------------------------------------------- |
+| Generic HTTP endpoint | HTTP | URL <br /> HTTP Version <br/> Gzip <br /> Headers |
+| Datadog | HTTP | API Key <br /> Region |
-HTTP requests are batched with a max of 250 items with at most 1 second intervals. Gzip compression will also be used if the 3rd party provider supports it.
+HTTP requests are batched with a max of 250 logs or 1 second intervals, whichever happens first. Logs are compressed via Gzip if the destination supports it.
-#### Generic Webhook
+### Generic HTTP endpoint
-Logs are sent as a JSON payload. Both HTTP1 and HTTP2 are supported. A preset configuration of Headers can be supplied for all requests.
+Logs are sent as a POST request with a JSON body. Both HTTP/1 and HTTP/2 protocols are supported.
+Custom headers can optionally be configured for all requests.
Note that requests are **unsigned**.
<Admonition type="note">
+ Unsigned requests to HTTP endpoints are temporary and all requests will signed in the near future.
+</Admonition>
-Unsigned webhook requests are temporary and signed requests will be supported soon.
+### Datadog
-</Admonition>
+Logs sent to Datadog have the name of the log source set on the `service` field of the event and the source set to `Supabase`. Logs are gzipped before they are sent to Datadog.
+
+The payload message is a JSON string of the raw log event, prefixed with the event timestamp.
+
+To setup Datadog log drain, generate a Datadog API key [here](https://app.datadoghq.com/organization-settings/api-keys) and the location of your Datadog site.
-#### Datadog
+<Accordion
+ type="default"
+ openBehaviour="multiple"
+>
+ <AccordionItem
+ header="Walkthrough"
+ id="walkthrough"
+ >
-Logs sent to Datadog have the name of the log source set on the `service` field of the event. The request body is gzipped.
+ 1. Generate API Key in [Datadog dashboard](https://app.datadoghq.com/organization-settings/api-keys)
+ 2. Create log drain in [Supabase dashboard](https://supabase.com/dashboard/project/_/settings/log-drains)
+ 3. Watch for events in the [Datadog Logs page](https://app.datadoghq.com/logs)
-The payload message are a stringified JSON of the raw log event, prefixed with the event timestamp.
+ </AccordionItem>
-#### Loki
+ <AccordionItem
+ header="Example destination configuration"
+ id="cfg"
+ >
-Logs are sent to a provided HTTP endpoint, see [documentation](https://grafana.com/docs/loki/latest/reference/loki-http-api/#ingest-logs) for `POST /loki/api/v1/push`.
+ [Grok parser](https://docs.datadoghq.com/service_management/events/pipelines_and_processors/grok_parser?tab=matchers) matcher for extracting the timestamp to a `date` field
+ ```
+ %{date("yyyy-MM-dd'T'HH:mm:ss.SSSSSSZZ"):date}
+ ```
-Events will get batched with multiple streams per request, with each log source having its own stream. The stream is labeled with the `source` key.
+ [Grok parser](https://docs.datadoghq.com/service_management/events/pipelines_and_processors/grok_parser?tab=matchers) matcher for converting stringified JSON to structured JSON on the `json` field.
+ ```
+ %{data::json}
+ ```
-Requests are in the form of a gzipped JSON body. The payload message is a stringified JSON of the raw log event. No custom structured JSON metadata is attached to stream values. It is recommended that an `Authorization` header is used for authentication at the destination.
+ [Remapper](https://docs.datadoghq.com/service_management/events/pipelines_and_processors/remapper) for setting the log level.
+ ```
+ metadata.parsed.error_severity, metadata.level
+ ```
-#### Elastic - Filebeat
+ [Remapper](https://docs.datadoghq.com/service_management/events/pipelines_and_processors/remapper) for setting the log event message.
+ ```
+ event_message
+ ```
+ </AccordionItem>
-Logs are sent to Filebeat server. See the [Filebeat documentation](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-http_endpoint.html) on how to set up the Filebeat HTTP server.
+</Accordion>
-The Filebeat server only handles HTTP1 requests. Basic Auth can be provided for optional user authentication.
+If you are interested in other log drains, upvote them [here](https://github.com/orgs/supabase/discussions/28324)