Skip to main content
A DSN replaces your API key and connection settings with a single value for each service. Your existing API keys keep working, so you can migrate one service at a time.

1. Copy your DSN

Open your service in Monocle. Under SDK connection, click Create DSN and copy it. You can find and copy it again from this page at any time.

2. Update your AdonisJS configuration

Use a version of the Monocle SDK that supports DSNs, then add your DSN to .env:
.env
Replace this example with the full DSN you copied. Add the variable to your environment schema:
start/env.ts
In config/monocle.ts, replace apiKey, serviceName, and endpoint with dsn:
config/monocle.ts
Keep your environment, integrations, sampling, and other options unchanged. If you also export to another destination, you can keep serviceName for it.

3. Check that data arrives

Restart or redeploy your application, then make a request. Check that new data appears under the expected service and environment in Monocle. You can also check the DSN’s Last used timestamp on the service page. You can find your old keys under Previous project API keys. Only revoke a key after every application using it has migrated.