Datadog integration

Fauna’s Datadog integration sends Fauna logs to Datadog in near real time. You can send logs for specific databases, including child databases, or entire region groups.

You can then visualize and monitor the logs in Datadog for better debugging and observability.

Datadog dashboard

Requirements

  • The integration requires the Fauna logs feature. To use Fauna logs, you must have a Pro or Enterprise plan.

  • A Datadog account

Set up the integration

  1. Log in to the Fauna Dashboard and go to the Integrations page.

  2. Click Configure your Fauna integration in Datadog.

    Fauna integrations page

    If prompted, log in to Datadog. The Fauna integration tile is displayed in Datadog.

  3. In the tile’s Configure tab, click Connect Accounts.

  4. In the Create Fauna Integration page, select one or more region groups and databases. You can select a mix of region groups and databases.

    Create Fauna integration page

    If you select a region group, the integration sends Fauna logs for each database in the region group to Datadog. This includes new databases created after integration setup.

  5. Click Save.

    The page redirects to a Datadog authorization page.

  6. Authorize the integration.

    A success message is displayed. The page then redirects to the Fauna Dashboard’s Integrations page.

    Fauna Dashboard’s Integrations page

View Fauna logs in Datadog

Once connected, you can view your Fauna logs in Datadog.

Integration dashboard

The integration also includes a dashboard you can use to monitor query volume, performance, costs, responses, and failures.

Datadog dashboard

The dashboard also includes widgets containing the logs.

Datadog dashboard logs

Log Explorer

You can also view Fauna logs in Datadog’s Log Explorer.

Datadog logs explorer

You can also create log monitors and add log widgets to your custom dashboards. See Datadog’s Log Explorer docs.

Log record format

To allow filtering, Fauna logs sent to Datadog use a different format than the standard log format used by the Fauna Dashboard or the Fauna Logs HTTP API endpoints.

{
  "id": "abc123",
  "content": {
    "attributes": {
      "API_VERSION": "10",
      "DATABASE": ["ECommerce"],
      "FQL_SHAPE": "Database.all().order(.name.toLowerCase())\n",
      "REGION_GROUP": "us-std",
      "REQUEST_HEADERS": "{\"x_forwarded_for\":\"174.61.154.32, 10.1.0.246\",\"user_agent\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36\",\"driver_env\":\"driver=javascript-2.0.1; env=browser; os=Mac OS X-10_15_7; runtime=Chrome-126.0.0.0\"}",
      "REQUEST_METHOD": "POST",
      "RESPONSE_CODE": "200",
      "TRACEPARENT": "00-1c4d6aa5c44f3c20426e8dd0517a0e56-328d6d4805ffb87f-00",
      "TS": "2099-08-07T17:29:35.740Z",
      "duration": 114000000,
      "fauna": {
        "BYTES_IN": 114,
        "BYTES_OUT": 311,
        "BYTE_READ_OPS": 8,
        "BYTE_WRITE_OPS": 0,
        "COMPUTE_OPS": 1,
        "QUERY_TIME_MS": 114,
        "TXN_RETRIES": 0
      },
      "http": {
        "status_category": "OK",
        "status_code": 200
      },
      "service": "fauna"
    },
    "service": "fauna",
    "tags": ["source:fauna", "datadog.submission_auth:api_key"],
    "timestamp": "2099-08-07T17:29:35.740Z"
  }
}

Most properties correspond to a property in the standard Fauna log record format:

Property Description

id

Unique identifier for the log entry in Datadog.

content.attributes.API_VERSION

FQL version used in the query. FQL v10 uses 10. FQL v4 uses 4.

content.attributes.DATABASE

Array of database paths.

content.attributes.FQL_SHAPE

FQL query with authentication-related information redacted.

Equivalent to FQL_SHAPE in the Fauna log record format.

content.attributes.REGION_GROUP

Region group for the query.

Equivalent to REGION_GROUP in the Fauna log record format.

content.attributes.REQUEST_HEADERS

Headers included with the HTTP request.

Equivalent to REQUEST_HEADERS in the Fauna log record format.

content.attributes.REQUEST_METHOD

HTTP method of the request.

Equivalent to REQUEST_METHOD in the Fauna log record format.

content.attributes.RESPONSE_CODE

HTTP response code for the request:

HTTP status Description

200

Successful query.

201

Query created a collection.

2xx

Query nearing rate limit.

429

Rate limited. Query exceeds plan limit or service protection if there are no plan limits.

Equivalent to RESPONSE_CODE in the Fauna log record format.

content.attributes.TAGS

Query tags included with the query.

If the query included no tags, this field is omitted.

content.attributes.TRACEPARENT

Query W3C-compliant traceparent identifier. See Traces.

Equivalent to TRACEPARENT in the Fauna log record format.

content.attributes.TS

Query processing timestamp in UTC.

Equivalent to TS in the Fauna log record format.

content.attributes.duration

Query processing time in nanoseconds.

A nanosecond version of QUERY_TIME_MS in the Fauna log record format.

content.attributes.fauna.BYTES_IN

Number of bytes in the request.

Equivalent to BYTES_IN in the Fauna log record format.

content.attributes.fauna.BYTES_OUT

Number of bytes in the response.

Equivalent to BYTES_OUT in the Fauna log record format.

content.attributes.fauna.BYTE_READ_OPS

Number of write operations consumed by the query.

Equivalent to BYTE_READ_OPS in the Fauna log record format.

content.attributes.fauna.BYTE_WRITE_OPS

Number of write operations consumed by the query.

Equivalent to BYTE_WRITE_OPS in the Fauna log record format.

content.attributes.fauna.COMPUTE_OPS

Number of compute operations consumed by the query.

Equivalent to COMPUTE_OPS in the Fauna log record format.

content.attributes.fauna.QUERY_TIME_MS

Query processing time, in milliseconds.

Equivalent to QUERY_TIME_MS in the Fauna log record format.

content.attributes.fauna.TXN_RETRIES

Retry count. A value greater than zero indicates contention.

Equivalent to TXN_RETRIES in the Fauna log record format.

content.attributes.http.status_category

Category of the response’s HTTP status code.

content.attributes.http.status_code

HTTP response code for the response:

HTTP status Description

200

Successful query.

201

Query created a collection.

2xx

Query nearing rate limit.

429

Rate limited. Query exceeds plan limit or service protection if there are no plan limits.

Equivalent to RESPONSE_CODE in the Fauna log record format.

content.attributes.service

Attribute used for search and as a filterable facet in Datadog. Value is fauna.

content.service

Identifies the originating service in Datadog. Value is fauna.

content.tags

Array of tags used for search and as filterable facets in Datadog. Includes source:fauna.

content.timestamp

Query processing timestamp, precise to the millisecond, in UTC.

The integration does not send logs for queries that populate the Fauna Dashboard UI. For example, the integration doesn’t send logs for queries used to display a list of existing collections or documents in the Dashboard.

The integration does send logs for:

  • Dashboard queries that create or write to resources, such as databases, collections, or documents.

  • User-provided queries run through the Dashboard Shell.

Change integration settings

You can change which Fauna region groups and databases send logs to Datadog by updating the integration settings. Updating the integration settings does not affect existing Fauna logs in Datadog.

  1. Log in to the Dashboard and click Integration in the left navigation.

  2. Click the edit icon for the Datadog integration.

    Edit Datadog integration

    This opens the Manage Datadog Integration modal.

  3. In the modal, add or delete region groups and databases as desired.

    Manage Datadog integration modal

    You can change the Active toggle to pause the integration.

  4. When you’re done, click Okay.

Billing

The integration consumes Transactional Compute Ops (TCOs) based on the number of Fauna log entries sent to Datadog per month:

Number of log entries sent per month TCOs consumed per month

Fewer than 100,000

49,500 TCOs (flat rate)

100,000 or more

0.495 TCOs per log entry

Limitations

  • A Fauna account can have one Datadog integration. The integration can only connect to one Datadog account.

  • Fauna logs in Datadog may be delayed by up to two minutes.

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!