forked from backstage/backstage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request backstage#3532 from SDA-SE/feat/sentry
Refactor the Sentry plugin to use the proxy backend instead of a custom backend
- Loading branch information
Showing
37 changed files
with
404 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
--- | ||
'@backstage/plugin-sentry': minor | ||
'@backstage/plugin-sentry-backend': minor | ||
--- | ||
|
||
The plugin uses the `proxy-backend` instead of a custom `sentry-backend`. | ||
It requires a proxy configuration: | ||
|
||
`app-config.yaml`: | ||
|
||
```yaml | ||
proxy: | ||
'/sentry/api': | ||
target: https://sentry.io/api/ | ||
allowedMethods: ['GET'] | ||
headers: | ||
Authorization: | ||
$env: SENTRY_TOKEN # export SENTRY_TOKEN="Bearer <your-sentry-token>" | ||
``` | ||
The `MockApiBackend` is no longer configured by the `NODE_ENV` variable. | ||
Instead, the mock backend can be used with an api-override: | ||
|
||
`packages/app/src/apis.ts`: | ||
|
||
```ts | ||
import { createApiFactory } from '@backstage/core'; | ||
import { MockSentryApi, sentryApiRef } from '@backstage/plugin-sentry'; | ||
export const apis = [ | ||
// ... | ||
createApiFactory(sentryApiRef, new MockSentryApi()), | ||
]; | ||
``` | ||
|
||
If you already use the Sentry backend, you must remove it from the backend: | ||
|
||
Delete `packages/backend/src/plugins/sentry.ts`. | ||
|
||
```diff | ||
# packages/backend/package.json | ||
... | ||
"@backstage/plugin-scaffolder-backend": "^0.3.2", | ||
- "@backstage/plugin-sentry-backend": "^0.1.3", | ||
"@backstage/plugin-techdocs-backend": "^0.3.0", | ||
... | ||
``` | ||
|
||
```diff | ||
// packages/backend/src/index.html | ||
const apiRouter = Router(); | ||
apiRouter.use('/catalog', await catalog(catalogEnv)); | ||
apiRouter.use('/rollbar', await rollbar(rollbarEnv)); | ||
apiRouter.use('/scaffolder', await scaffolder(scaffolderEnv)); | ||
- apiRouter.use('/sentry', await sentry(sentryEnv)); | ||
apiRouter.use('/auth', await auth(authEnv)); | ||
apiRouter.use('/techdocs', await techdocs(techdocsEnv)); | ||
apiRouter.use('/kubernetes', await kubernetes(kubernetesEnv)); | ||
apiRouter.use('/proxy', await proxy(proxyEnv)); | ||
apiRouter.use('/graphql', await graphql(graphqlEnv)); | ||
apiRouter.use(notFoundHandler()); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# sentry-backend | ||
|
||
Simple plugin forwarding requests to [Sentry](https://sentry.io) API. | ||
> DEPRECATED | ||
Please use the [proxy-backend](../proxy-backend) instead. See [CHANGELOG.md](./CHANGELOG.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
42 changes: 0 additions & 42 deletions
42
plugins/sentry-backend/src/service/standaloneApplication.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.