|
| 1 | +# DX PlatformX |
| 2 | + |
| 3 | +[DX](https://getdx.com) is a developer intelligence platform used by engineering |
| 4 | +leaders and platform engineers. Coder notifications can be transformed to |
| 5 | +[PlatformX](https://getdx.com/platformx) events, allowing platform engineers to |
| 6 | +measure activity and send pulse surveys to subsets of Coder users to understand |
| 7 | +their experience. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +## Requirements |
| 12 | + |
| 13 | +You'll need: |
| 14 | + |
| 15 | +- Coder v2.19+ |
| 16 | +- A PlatformX subscription from [DX](https://getdx.com/) |
| 17 | +- A platform to host the integration, such as: |
| 18 | + - AWS Lambda |
| 19 | + - Google Cloud Run |
| 20 | + - Heroku |
| 21 | + - Kubernetes |
| 22 | + - Or any other platform that can run Python web applications |
| 23 | + |
| 24 | +## coder-platformx-events-middleware |
| 25 | + |
| 26 | +Coder sends [notifications](../monitoring/notifications/index.md) via webhooks |
| 27 | +to coder-platformx-events-middleware, which processes and reformats the payload |
| 28 | +into a structure compatible with [PlatformX by DX](https://help.getdx.com/en/articles/7880779-getting-started). |
| 29 | + |
| 30 | +For more information about coder-platformx-events-middleware and how to |
| 31 | +integrate it with your Coder deployment and PlatformX events, refer to the |
| 32 | +[coder-platformx-notifications](https://github.com/coder/coder-platformx-notifications) |
| 33 | +repository. |
| 34 | + |
| 35 | +### Supported Notification Types |
| 36 | + |
| 37 | +coder-platformx-events-middleware supports the following [Coder notifications](../monitoring/notifications/index.md): |
| 38 | + |
| 39 | +- Workspace Created |
| 40 | +- Workspace Manually Updated |
| 41 | +- User Account Created |
| 42 | +- User Account Suspended |
| 43 | +- User Account Activated |
| 44 | + |
| 45 | +### Environment Variables |
| 46 | + |
| 47 | +The application expects the following environment variables when started. |
| 48 | +For local development, create a `.env` file in the project root with the following variables. |
| 49 | +A `.env.sample` file is included: |
| 50 | + |
| 51 | +| Variable | Description | Example | |
| 52 | +|------------------|--------------------------------------------|----------------------------------------------| |
| 53 | +| `LOG_LEVEL` | Logging level (`DEBUG`, `INFO`, `WARNING`) | `INFO` | |
| 54 | +| `GETDX_API_KEY` | API key for PlatformX | `your-api-key` | |
| 55 | +| `EVENTS_TRACKED` | Comma-separated list of tracked events | `"Workspace Created,User Account Suspended"` | |
| 56 | + |
| 57 | +### Logging |
| 58 | + |
| 59 | +Logs are printed to the console and can be adjusted using the `LOG_LEVEL` variable. The available levels are: |
| 60 | + |
| 61 | +| Level | Description | |
| 62 | +|-----------|---------------------------------------| |
| 63 | +| `DEBUG` | Most verbose, useful for debugging | |
| 64 | +| `INFO` | Standard logging for normal operation | |
| 65 | +| `WARNING` | Logs only warnings and errors | |
| 66 | + |
| 67 | +### API Endpoints |
| 68 | + |
| 69 | +- `GET /` - Health check endpoint |
| 70 | +- `POST /` - Webhook receiver |
0 commit comments