diff --git a/src/content/docs/workers/databases/connecting-to-databases.mdx b/src/content/docs/workers/databases/connecting-to-databases.mdx index a35b55a8a17c8d0..7294270429721ba 100644 --- a/src/content/docs/workers/databases/connecting-to-databases.mdx +++ b/src/content/docs/workers/databases/connecting-to-databases.mdx @@ -49,23 +49,16 @@ Serverless databases provide HTTP-based proxies and drivers, also known as serve By providing a way to query your database with HTTP, these serverless databases and drivers eliminate several roundtrips needed to establish a secure connection. -| Database | Integration | Library or Driver | Connection Method | -| --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------- | ----------------------- | -| [PlanetScale](https://planetscale.com/blog/introducing-the-planetscale-serverless-driver-for-javascript) | [Yes](/workers/databases/native-integrations/planetscale/) | [@planetscale/database](https://github.com/planetscale/database-js) | API via client library | -| [Supabase](https://github.com/supabase/supabase/tree/master/examples/with-cloudflare-workers) | [Yes](/workers/databases/native-integrations/supabase/) | [@supabase/supabase-js](https://github.com/supabase/supabase-js) | API via client library | -| [Prisma](https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-cloudflare-workers) | No | [prisma](https://github.com/prisma/prisma) | API via client library | -| [Neon](https://blog.cloudflare.com/neon-postgres-database-from-workers/) | [Yes](/workers/databases/native-integrations/neon/) | [@neondatabase/serverless](https://neon.tech/blog/serverless-driver-for-postgres/) | API via client library | -| [Hasura](https://hasura.io/blog/building-applications-with-cloudflare-workers-and-hasura-graphql-engine/) | No | API | GraphQL API via fetch() | -| [Upstash Redis](https://blog.cloudflare.com/cloudflare-workers-database-integration-with-upstash/) | [Yes](/workers/databases/native-integrations/upstash/) | [@upstash/redis](https://github.com/upstash/upstash-redis) | API via client library | -| [TiDB Cloud](https://docs.pingcap.com/tidbcloud/integrate-tidbcloud-with-cloudflare) | No | [@tidbcloud/serverless](https://github.com/tidbcloud/serverless-js) | API via client library | +| Database | Library or Driver | Connection Method | +| --------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ----------------------- | +| [PlanetScale](https://planetscale.com/blog/introducing-the-planetscale-serverless-driver-for-javascript) | [@planetscale/database](https://github.com/planetscale/database-js) | API via client library | +| [Supabase](https://github.com/supabase/supabase/tree/master/examples/with-cloudflare-workers) | [@supabase/supabase-js](https://github.com/supabase/supabase-js) | API via client library | +| [Prisma](https://www.prisma.io/docs/guides/deployment/deployment-guides/deploying-to-cloudflare-workers) | [prisma](https://github.com/prisma/prisma) | API via client library | +| [Neon](https://blog.cloudflare.com/neon-postgres-database-from-workers/) | [@neondatabase/serverless](https://neon.tech/blog/serverless-driver-for-postgres/) | API via client library | +| [Hasura](https://hasura.io/blog/building-applications-with-cloudflare-workers-and-hasura-graphql-engine/) | API | GraphQL API via fetch() | +| [Upstash Redis](https://blog.cloudflare.com/cloudflare-workers-database-integration-with-upstash/) | [@upstash/redis](https://github.com/upstash/upstash-redis) | API via client library | +| [TiDB Cloud](https://docs.pingcap.com/tidbcloud/integrate-tidbcloud-with-cloudflare) | [@tidbcloud/serverless](https://github.com/tidbcloud/serverless-js) | API via client library | -:::note[Easier setup with database integrations] - -[Database Integrations](/workers/databases/native-integrations/) simplify the authentication for serverless database drivers by managing credentials on your behalf and includes support for PlanetScale, Neon and Supabase. - -If you do not see an integration listed or have an integration to add, complete and submit the [Cloudflare Developer Platform Integration form](https://forms.gle/iaUqLWE8aezSEhgd6). - -::: Once you have installed the necessary packages, use the APIs provided by these packages to connect to your database and perform operations on it. Refer to detailed links for service-specific instructions. diff --git a/src/content/docs/workers/databases/native-integrations/index.mdx b/src/content/docs/workers/databases/native-integrations/index.mdx deleted file mode 100644 index 3408083b188c594..000000000000000 --- a/src/content/docs/workers/databases/native-integrations/index.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -pcx_content_type: navigation -title: Database Integrations -head: [] -description: Connect to a supported third-party database (such as Supabase, - Turso and more) directly from the Cloudflare dashboard. -sidebar: - badge: - text: Beta - ---- - -import { DirectoryListing } from "~/components" - -## Background - -Connect to databases using the new Database Integrations (beta) experience. Enable Database Integrations in the [Cloudflare dashboard](https://dash.cloudflare.com). With Database Integrations, Cloudflare automatically handles the process of creating a connection string and adding it as secrets to your Worker. - -:::note[Making multiple round trip calls to a centralized database from a Worker?] - - -If your Worker is making multiple round trip calls to a centralized database, your Worker may be a good fit for Smart Placement. Smart Placement speeds up applications by automatically running your Worker closer to your back-end infrastructure rather than the end user. Learn more about [how Smart Placement works](/workers/configuration/smart-placement/). -::: - -## Database credentials - -If you rotate or delete database credentials, you must delete the integration and go through the setup flow again. - -## Database limits - -At this time, Database Integrations only support access to one database per provider. To add multiple, you must manually configure [secrets](/workers/configuration/environment-variables/). - -## Supported platforms - - diff --git a/src/content/docs/workers/databases/third-party-integrations/index.mdx b/src/content/docs/workers/databases/third-party-integrations/index.mdx new file mode 100644 index 000000000000000..2282db43c03b0ac --- /dev/null +++ b/src/content/docs/workers/databases/third-party-integrations/index.mdx @@ -0,0 +1,32 @@ +--- +pcx_content_type: navigation +title: 3rd Party Integrations +head: [] +description: Connect to third-party databases such as Supabase, + Turso and PlanetScale) + +--- + +import { DirectoryListing } from "~/components" + +## Background + +Connect to databases by configuring connection strings and credentials as [secrets](/workers/configuration/secrets/) in your Worker. + +:::note[Making multiple round trip calls to a centralized database from a Worker?] + + +If your Worker is making multiple round trip calls to a centralized database, your Worker may be a good fit for Smart Placement. Smart Placement speeds up applications by automatically running your Worker closer to your back-end infrastructure rather than the end user. Learn more about [how Smart Placement works](/workers/configuration/smart-placement/). +::: + +## Database credentials + +When you rotate or update database credentials, you must update the corresponding [secrets](/workers/configuration/secrets/) in your Worker. Use the [`wrangler secret put`](/workers/wrangler/commands/#secret) command to update secrets securely or update the secret directly in the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers/services/view/:worker/production/settings). + +## Database limits + +You can connect to multiple databases by configuring separate sets of secrets for each database connection. Use descriptive secret names to distinguish between different database connections (for example, `DATABASE_URL_PROD` and `DATABASE_URL_STAGING`). + +## Popular providers + + diff --git a/src/content/docs/workers/databases/native-integrations/neon.mdx b/src/content/docs/workers/databases/third-party-integrations/neon.mdx similarity index 81% rename from src/content/docs/workers/databases/native-integrations/neon.mdx rename to src/content/docs/workers/databases/third-party-integrations/neon.mdx index a114185bb51105e..ce3164e1b204a3b 100644 --- a/src/content/docs/workers/databases/native-integrations/neon.mdx +++ b/src/content/docs/workers/databases/third-party-integrations/neon.mdx @@ -7,8 +7,6 @@ import { Render, PackageManagers } from "~/components"; [Neon](https://neon.tech/) is a fully managed serverless PostgreSQL. It separates storage and compute to offer modern developer features, such as serverless, branching, and bottomless storage. - - ## Set up an integration with Neon To set up an integration with Neon: @@ -43,21 +41,23 @@ To set up an integration with Neon: (10, 'Neon', 10, 'Ne'); ``` -4. Add the Neon database integration to your Worker: +4. Configure the Neon database credentials in your Worker: + + You need to add your Neon database connection string as a secret to your Worker. Get your connection string from the [Neon Console](https://console.neon.tech) under **Connection Details**, then add it as a secret using Wrangler: - 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. - 2. In **Account Home**, select **Workers & Pages**. - 3. In **Overview**, select your Worker. - 4. Select **Integrations** > **Neon**. - 5. Follow the setup flow, selecting the database created in step 1. + ```sh + # Add the database connection string as a secret + npx wrangler secret put DATABASE_URL + # When prompted, paste your Neon database connection string + ``` 5. In your Worker, install the `@neondatabase/serverless` driver to connect to your database and start manipulating data: -6. The following example shows how to make a query to your Neon database in a Worker. The credentials needed to connect to Neon have been automatically added as secrets to your Worker through the integration. +6. The following example shows how to make a query to your Neon database in a Worker. The credentials needed to connect to Neon have been added as secrets to your Worker. - ```sql + ```js import { Client } from '@neondatabase/serverless'; export default { diff --git a/src/content/docs/workers/databases/native-integrations/planetscale.mdx b/src/content/docs/workers/databases/third-party-integrations/planetscale.mdx similarity index 74% rename from src/content/docs/workers/databases/native-integrations/planetscale.mdx rename to src/content/docs/workers/databases/third-party-integrations/planetscale.mdx index 9e91aa10f0266b0..0b4bea3512d8417 100644 --- a/src/content/docs/workers/databases/native-integrations/planetscale.mdx +++ b/src/content/docs/workers/databases/third-party-integrations/planetscale.mdx @@ -7,8 +7,6 @@ import { Render, PackageManagers } from "~/components"; [PlanetScale](https://planetscale.com/) is a MySQL-compatible platform that makes databases infinitely scalable, easier and safer to manage. - - ## Set up an integration with PlanetScale To set up an integration with PlanetScale: @@ -34,19 +32,29 @@ To set up an integration with PlanetScale: VALUES ('Ballpoint pen', 'https://example.com/500x500', '1'); ``` -4. Add the PlanetScale integration to your Worker: - - 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. - 2. In **Account Home**, select **Workers & Pages**. - 3. In **Overview**, select your Worker. - 4. Select **Integrations** > **PlanetScale**. - 5. Follow the setup flow, selecting the database created in step 1. +4. Configure the PlanetScale database credentials in your Worker: + + You need to add your PlanetScale database credentials as secrets to your Worker. Get your connection details from the [PlanetScale Dashboard](https://app.planetscale.com) by creating a connection string, then add them as secrets using Wrangler: + + ```sh + # Add the database host as a secret + npx wrangler secret put DATABASE_HOST + # When prompted, paste your PlanetScale host + + # Add the database username as a secret + npx wrangler secret put DATABASE_USERNAME + # When prompted, paste your PlanetScale username + + # Add the database password as a secret + npx wrangler secret put DATABASE_PASSWORD + # When prompted, paste your PlanetScale password + ``` 5. In your Worker, install the `@planetscale/database` driver to connect to your PlanetScale database and start manipulating data: -6. The following example shows how to make a query to your PlanetScale database in a Worker. The credentials needed to connect to PlanetScale have been automatically added as secrets to your Worker through the integration. +6. The following example shows how to make a query to your PlanetScale database in a Worker. The credentials needed to connect to PlanetScale have been added as secrets to your Worker. ```js import { connect } from "@planetscale/database"; diff --git a/src/content/docs/workers/databases/native-integrations/supabase.mdx b/src/content/docs/workers/databases/third-party-integrations/supabase.mdx similarity index 78% rename from src/content/docs/workers/databases/native-integrations/supabase.mdx rename to src/content/docs/workers/databases/third-party-integrations/supabase.mdx index 4c473cb33fc1e3b..cbdeb6987c7e7db 100644 --- a/src/content/docs/workers/databases/native-integrations/supabase.mdx +++ b/src/content/docs/workers/databases/third-party-integrations/supabase.mdx @@ -7,8 +7,6 @@ import { Render, PackageManagers } from "~/components"; [Supabase](https://supabase.com/) is an open source Firebase alternative and a PostgreSQL database service that offers real-time functionality, database backups, and extensions. With Supabase, developers can quickly set up a PostgreSQL database and build applications. - - ## Set up an integration with Supabase To set up an integration with Supabase: @@ -35,21 +33,27 @@ To set up an integration with Supabase: INSERT INTO countries (name) VALUES ('The Netherlands'); ``` -4. Add the Supabase database integration to your Worker: +4. Configure the Supabase database credentials in your Worker: + + You need to add your Supabase URL and anon key as secrets to your Worker. Get these from your [Supabase Dashboard](https://supabase.com/dashboard) under **Settings** > **API**, then add them as secrets using Wrangler: - 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. - 2. In **Account Home**, select **Workers & Pages**. - 3. In **Overview**, select your Worker. - 4. Select **Integrations** > **Supabase**. - 5. Follow the setup flow, selecting the database created in step 1. + ```sh + # Add the Supabase URL as a secret + npx wrangler secret put SUPABASE_URL + # When prompted, paste your Supabase project URL + + # Add the Supabase anon key as a secret + npx wrangler secret put SUPABASE_KEY + # When prompted, paste your Supabase anon/public key + ``` 5. In your Worker, install the `@supabase/supabase-js` driver to connect to your database and start manipulating data: -6. The following example shows how to make a query to your Supabase database in a Worker. The credentials needed to connect to Supabase have been automatically added as secrets to your Worker through the integration. +6. The following example shows how to make a query to your Supabase database in a Worker. The credentials needed to connect to Supabase have been added as secrets to your Worker. - ```sql + ```js import { createClient } from '@supabase/supabase-js'; export default { diff --git a/src/content/docs/workers/databases/native-integrations/turso.mdx b/src/content/docs/workers/databases/third-party-integrations/turso.mdx similarity index 85% rename from src/content/docs/workers/databases/native-integrations/turso.mdx rename to src/content/docs/workers/databases/third-party-integrations/turso.mdx index 14f19357526b107..9865a4cac3a419d 100644 --- a/src/content/docs/workers/databases/native-integrations/turso.mdx +++ b/src/content/docs/workers/databases/third-party-integrations/turso.mdx @@ -7,8 +7,6 @@ import { Render, PackageManagers } from "~/components"; [Turso](https://turso.tech/) is an edge-hosted, distributed database based on [libSQL](https://libsql.org/), an open-source fork of SQLite. Turso was designed to minimize query latency for applications where queries comes from anywhere in the world. - - ## Set up an integration with Turso To set up an integration with Turso: @@ -84,19 +82,35 @@ To set up an integration with Turso: (10, 'Neon', 10, 'Ne'); ``` -4. Add the Turso database integration to your Worker: +4. Configure the Turso database credentials in your Worker: + + You need to add your Turso database URL and authentication token as secrets to your Worker. First, get your database URL and create an authentication token: + + ```sh + # Get your database URL + turso db show my-db --url + + # Create an authentication token + turso db tokens create my-db + ``` + + Then add these as secrets to your Worker using Wrangler: - 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. - 2. In **Account Home**, select **Workers & Pages**. - 3. In **Overview**, select your Worker. - 4. Select **Integrations** > **Turso**. - 5. Follow the setup flow, selecting the database created in step 1. + ```sh + # Add the database URL as a secret + npx wrangler secret put TURSO_URL + # When prompted, paste your database URL + + # Add the authentication token as a secret + npx wrangler secret put TURSO_AUTH_TOKEN + # When prompted, paste your authentication token + ``` 5. In your Worker, install the Turso client library: -6. The following example shows how to make a query to your Turso database in a Worker. The credentials needed to connect to Turso have been automatically added as [secrets](/workers/configuration/secrets/) to your Worker through the integration. +6. The following example shows how to make a query to your Turso database in a Worker. The credentials needed to connect to Turso have been added as [secrets](/workers/configuration/secrets/) to your Worker. ```ts import { Client as LibsqlClient, createClient } from "@libsql/client/web"; diff --git a/src/content/docs/workers/databases/native-integrations/upstash.mdx b/src/content/docs/workers/databases/third-party-integrations/upstash.mdx similarity index 66% rename from src/content/docs/workers/databases/native-integrations/upstash.mdx rename to src/content/docs/workers/databases/third-party-integrations/upstash.mdx index 4c50221794ee7a3..8a8e92be94027a3 100644 --- a/src/content/docs/workers/databases/native-integrations/upstash.mdx +++ b/src/content/docs/workers/databases/third-party-integrations/upstash.mdx @@ -7,8 +7,6 @@ import { Render, PackageManagers } from "~/components"; [Upstash](https://upstash.com/) is a serverless database with Redis\* and Kafka API. Upstash also offers QStash, a task queue/scheduler designed for the serverless. - - ## Upstash for Redis To set up an integration with Upstash: @@ -44,19 +42,25 @@ To set up an integration with Upstash: OK ``` -3. Add the Upstash Redis integration to your Worker: +3. Configure the Upstash Redis credentials in your Worker: - 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. - 2. In **Account Home**, select **Workers & Pages**. - 3. In **Overview**, select your Worker. - 4. Select **Settings** > **Integrations** > **Upstash Redis**. - 5. Follow the setup flow, selecting the database created in step 1. + You need to add your Upstash Redis database URL and token as secrets to your Worker. Get these from your [Upstash Console](https://console.upstash.com) under your database details, then add them as secrets using Wrangler: + + ```sh + # Add the Upstash Redis URL as a secret + npx wrangler secret put UPSTASH_REDIS_REST_URL + # When prompted, paste your Upstash Redis REST URL + + # Add the Upstash Redis token as a secret + npx wrangler secret put UPSTASH_REDIS_REST_TOKEN + # When prompted, paste your Upstash Redis REST token + ``` 4. In your Worker, install the `@upstash/redis`, a HTTP client to connect to your database and start manipulating data: -5. The following example shows how to make a query to your Upstash database in a Worker. The credentials needed to connect to Upstash have been automatically added as secrets to your Worker through the integration. +5. The following example shows how to make a query to your Upstash database in a Worker. The credentials needed to connect to Upstash have been added as secrets to your Worker. ```js import { Redis } from "@upstash/redis/cloudflare"; @@ -94,13 +98,23 @@ To set up an integration with Upstash Kafka: 1. Create a [Kafka cluster and topic](https://docs.upstash.com/kafka). -2. Add the Upstash Kafka integration to your Worker: +2. Configure the Upstash Kafka credentials in your Worker: + + You need to add your Upstash Kafka connection details as secrets to your Worker. Get these from your [Upstash Console](https://console.upstash.com) under your Kafka cluster details, then add them as secrets using Wrangler: - 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. - 2. In **Account Home**, select **Workers & Pages**. - 3. In **Overview**, select your Worker. - 4. Select **Settings** > **Integrations** > **Upstash Kafka**. - 5. Follow the setup flow, selecting the cluster and topic. + ```sh + # Add the Upstash Kafka URL as a secret + npx wrangler secret put UPSTASH_KAFKA_REST_URL + # When prompted, paste your Upstash Kafka REST URL + + # Add the Upstash Kafka username as a secret + npx wrangler secret put UPSTASH_KAFKA_REST_USERNAME + # When prompted, paste your Upstash Kafka username + + # Add the Upstash Kafka password as a secret + npx wrangler secret put UPSTASH_KAFKA_REST_PASSWORD + # When prompted, paste your Upstash Kafka password + ``` 3. In your Worker, install `@upstash/kafka`, a HTTP/REST based Kafka client: @@ -116,13 +130,15 @@ To set up an integration with Upstash QStash: 1. Configure the [publicly available HTTP endpoint](https://docs.upstash.com/qstash#1-public-api) that you want to send your messages to. -2. Add the Upstash QStash integration to your Worker: +2. Configure the Upstash QStash credentials in your Worker: + + You need to add your Upstash QStash token as a secret to your Worker. Get your token from your [Upstash Console](https://console.upstash.com) under QStash settings, then add it as a secret using Wrangler: - 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. - 2. In **Account Home**, select **Workers & Pages**. - 3. In **Overview**, select your Worker. - 4. Select **Integrations** > **Upstash QStash**. - 5. Follow the setup flow. + ```sh + # Add the QStash token as a secret + npx wrangler secret put QSTASH_TOKEN + # When prompted, paste your QStash token + ``` 3. In your Worker, install the `@upstash/qstash`, a HTTP client to connect to your database QStash endpoint: diff --git a/src/content/docs/workers/databases/native-integrations/xata.mdx b/src/content/docs/workers/databases/third-party-integrations/xata.mdx similarity index 77% rename from src/content/docs/workers/databases/native-integrations/xata.mdx rename to src/content/docs/workers/databases/third-party-integrations/xata.mdx index fcfaa3cf179fbbe..1c58a6bd3db4879 100644 --- a/src/content/docs/workers/databases/native-integrations/xata.mdx +++ b/src/content/docs/workers/databases/third-party-integrations/xata.mdx @@ -7,8 +7,6 @@ import { Render } from "~/components"; [Xata](https://xata.io) is a serverless data platform powered by PostgreSQL. Xata uniquely combines multiple types of stores (relational databases, search engines, analytics engines) into a single service, accessible through a consistent REST API. - - ## Set up an integration with Xata To set up an integration with Xata: @@ -17,13 +15,23 @@ To set up an integration with Xata: 2. In your database, you have several options for creating a table: you can start from scratch, use a template filled with sample data, or import data from a CSV file. For this guide, choose **Start with sample data**. This option automatically populates your database with two sample tables: `Posts` and `Users`. -3. Add the Xata integration to your Worker: +3. Configure the Xata database credentials in your Worker: + + You need to add your Xata database credentials as secrets to your Worker. First, get your database details from your [Xata Dashboard](https://app.xata.io), then add them as secrets using Wrangler: - 1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. - 2. In **Account Home**, select **Workers & Pages**. - 3. In **Overview**, select your Worker. - 4. Select **Integrations** > **Xata**. - 5. Follow the setup flow, selecting the database created in step 1. + ```sh + # Add the Xata API key as a secret + npx wrangler secret put XATA_API_KEY + # When prompted, paste your Xata API key + + # Add the Xata branch as a secret + npx wrangler secret put XATA_BRANCH + # When prompted, paste your Xata branch name (usually 'main') + + # Add the Xata database URL as a secret + npx wrangler secret put XATA_DATABASE_URL + # When prompted, paste your Xata database URL + ``` 4. Install the [Xata CLI](https://xata.io/docs/getting-started/installation) and authenticate the CLI by running the following commands: @@ -49,7 +57,7 @@ To set up an integration with Xata: XATA_DATABASE_URL= ``` -7. The following example shows how to make a query to your Xata database in a Worker. The credentials needed to connect to Xata have been automatically added as secrets to your Worker through the integration. +7. The following example shows how to make a query to your Xata database in a Worker. The credentials needed to connect to Xata have been added as secrets to your Worker. ```ts export default { diff --git a/src/content/docs/workers/observability/integrations/baselime-integration.mdx b/src/content/docs/workers/observability/integrations/baselime-integration.mdx deleted file mode 100644 index 24acaffc7b3e1f9..000000000000000 --- a/src/content/docs/workers/observability/integrations/baselime-integration.mdx +++ /dev/null @@ -1,64 +0,0 @@ ---- -pcx_content_type: concept -title: Baselime integration -head: [] -description: Connect to Baselime from your Worker to automatically send errors - and logs to Baselime. -sidebar: - badge: - variant: caution - text: Maintenance Mode - ---- - -import { Render } from "~/components" - -[Baselime](https://baselime.io/) is an observability solution built for modern cloud-native environments. It combines logs, metrics, and distributed traces to give you full visibility across your microservices at scale. - -This integration allows you to connect to a Baselime environment from your Worker to automatically send errors and logs to Baselime with no code changes needed in the Workers application. - -:::note - - -Baselime integration is available to all Enterprise customers and Free, Pro, and Business customers on the [Workers Paid plan](/workers/platform/pricing/). - - -::: - -## How it works - -This integration adds a [Tail Worker](/workers/observability/logs/tail-workers) to your application Worker. The Tail Worker automatically sends errors and uncaught exceptions to the Baselime environment you have configured. - -This integration supports the following Baselime features: - -* **[Logging](https://baselime.io/docs/analysing-data/overview/)**: Request info, logs, and exceptions are all available to be searched for and analyzed. -* **[Error tracking](https://baselime.io/docs/analysing-data/errors/)**: Actively find and be notified of new errors and track their resolution. - -:::note - -If there are more configuration options that you would like to see, leave us feedback on the [Cloudflare Developer Discord](https://discord.cloudflare.com) (channel name: integrations). -::: - -## Set up an integration with Baselime - -To set up an integration with Baselime, you need to have a Baselime environment to connect to. If this is your first time using Baselime, you will be prompted to create an account and an environment during the integration setup. - -To add the Baselime integration to your Worker: - -1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. -2. Select **Workers & Pages**. -3. In **Overview**, select your Worker. -4. Select **Integrations** > **Baselime**. -5. Follow the setup flow. - -Once installed, the integration will automatically start forwarding events to Baselime. To learn more about Baselime, refer to [Baselime's official documentation](https://baselime.io/docs/). - - - -:::caution - - -Note that automatic distributed tracing is not yet supported via the Baselime integration. To add tracing, follow the [Baselime documentation](https://baselime.io/docs/sending-data/platforms/cloudflare/traces/). - - -::: diff --git a/src/content/docs/workers/observability/integrations/sentry.mdx b/src/content/docs/workers/observability/integrations/sentry.mdx deleted file mode 100644 index 76c149727189c7a..000000000000000 --- a/src/content/docs/workers/observability/integrations/sentry.mdx +++ /dev/null @@ -1,72 +0,0 @@ ---- -pcx_content_type: concept -title: Sentry -head: [] -description: Connect to a Sentry project from your Worker to automatically send - errors and uncaught exceptions to Sentry. -sidebar: - badge: - text: Beta - ---- - -import { Render } from "~/components" - -[Sentry](https://sentry.io/welcome/) is an error tracking and performance monitoring platform that allows developers to diagnose, fix, and optimize the performance of their code. - -This integration allows you to connect to a Sentry project from your Worker to automatically send errors and uncaught exceptions to Sentry with no code changes needed in the Workers application. - -:::note - - -Sentry integration is available to all Enterprise customers and Free, Pro, and Business customers on the [Workers Paid plan](/workers/platform/pricing/). - - -::: - -:::caution - - -This integration is not supported for Pages projects. Pages does not support [Tail Workers](/workers/observability/logs/tail-workers/), and the Sentry integration relies on adding a Tail Worker to your Worker. - - -::: - -## How it works - -This integration adds a [Tail Worker](/workers/observability/logs/tail-workers) to your application Worker. The Tail Worker automatically sends errors and uncaught exceptions to the Sentry project you have configured. - -This integration supports the following Sentry features: - -* **[Data Handling](https://develop.sentry.dev/sdk/data-handling/)**: As a best practice, do not include PII or other sensitive data in the payload sent to Sentry. HTTP headers (for example, `Authorization` or `Cookie`) can be removed before events are forwarded to Sentry. -* **[Sampling](https://docs.sentry.io/platforms/javascript/configuration/sampling/#configuring-the-transaction-sample-rate)**: Sampling can be configured to manage the number and type of events sent to Sentry. Sampling rates can be configured based on the HTTP status code returned by the Worker and for uncaught exceptions. Setting the sampling rate to 100% sends all events to Sentry or setting it to 30% sends approximately 30% of events to Sentry. -* **[Breadcrumbs](https://docs.sentry.io/product/issues/issue-details/breadcrumbs/)**: Breadcrumbs create a trail of events that happened prior to an issue. Breadcrumbs are automatically forwarded to Sentry in the case of an error or exception. These events consist of the `console.log()` from the Worker before the error or exception occurred. - -:::note - -If there are more configuration options that you would like to see, leave us feedback on the [Cloudflare Developer Discord](https://discord.cloudflare.com) (channel name: integrations). -::: - -## Set up an integration with Sentry - -To set up an integration with Sentry, you need to have an existing Sentry project to connect to. [Create a Sentry project](https://docs.sentry.io/product/sentry-basics/integrate-frontend/create-new-project), or use an existing project for this integration. Then add the Sentry integration to your Worker. - -To add the Sentry integration to your Worker: - -1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com) and select your account. -2. Select **Workers & Pages**. -3. In **Overview**, select your Worker. -4. Select **Integrations** > **Sentry**. -5. Follow the setup flow. - -Once installed, the integration will automatically start forwarding matching events to Sentry. To learn more about Sentry, refer to [Sentry's official documentation](https://docs.sentry.io/). - - - -:::caution - - -Each Cloudflare account can only be linked to one Sentry organization. Use the [Sentry SDK](https://github.com/getsentry/sentry-javascript) in order to send events to projects in more than one Sentry organization. - - -::: diff --git a/src/content/docs/workers/observability/integrations/index.mdx b/src/content/docs/workers/observability/third-party-integrations/index.mdx similarity index 100% rename from src/content/docs/workers/observability/integrations/index.mdx rename to src/content/docs/workers/observability/third-party-integrations/index.mdx diff --git a/src/content/docs/workers/observability/third-party-integrations/sentry.mdx b/src/content/docs/workers/observability/third-party-integrations/sentry.mdx new file mode 100644 index 000000000000000..969972a393c0a3a --- /dev/null +++ b/src/content/docs/workers/observability/third-party-integrations/sentry.mdx @@ -0,0 +1,12 @@ +--- +pcx_content_type: navigation +title: Sentry +external_link: https://docs.sentry.io/platforms/javascript/guides/cloudflare/ +head: [] +description: Connect to a Sentry project from your Worker to automatically send + errors and uncaught exceptions to Sentry. + +--- + +Connect to a Sentry project from your Worker to automatically send +errors and uncaught exceptions to Sentry. \ No newline at end of file diff --git a/src/content/docs/workers/tutorials/connect-to-turso-using-workers/index.mdx b/src/content/docs/workers/tutorials/connect-to-turso-using-workers/index.mdx index 8a4157772ee38d6..a063a7c52c66d67 100644 --- a/src/content/docs/workers/tutorials/connect-to-turso-using-workers/index.mdx +++ b/src/content/docs/workers/tutorials/connect-to-turso-using-workers/index.mdx @@ -14,7 +14,7 @@ This tutorial will guide you on how to build globally distributed applications w :::note -For a more seamless experience, refer to the [Turso Database Integration guide](/workers/databases/native-integrations/turso/). The Turso Database Integration will connect your Worker to a Turso database by getting the right configuration from Turso and adding it as [secrets](/workers/configuration/secrets/) to your Worker. +For a more seamless experience, refer to the [Turso Database Integration guide](/workers/databases/third-party-integrations/turso/). The Turso Database Integration will guide you through connecting your Worker to a Turso database by securely configuring your database credentials as [secrets](/workers/configuration/secrets/) in your Worker. ::: diff --git a/src/content/partials/workers/database_integrations_definition.mdx b/src/content/partials/workers/database_integrations_definition.mdx index a4a3c87a33946a9..474057435db90f0 100644 --- a/src/content/partials/workers/database_integrations_definition.mdx +++ b/src/content/partials/workers/database_integrations_definition.mdx @@ -3,4 +3,4 @@ --- -[Database Integrations](/workers/databases/native-integrations/) allow you to connect to a database from your Worker by getting the right configuration from your database provider and adding it as [secrets](/workers/configuration/secrets/) to your Worker. +[Database Integrations](/workers/databases/third-party-integrations/) allow you to connect to a database from your Worker by configuring the right connection credentials from your database provider and adding them as [secrets](/workers/configuration/secrets/) to your Worker.