refactor: update rollbar to use composability api

This commit is contained in:
Andrew Thauer
2021-02-02 21:17:06 -05:00
parent 2aeb2ee94e
commit 9d6ef14bcd
19 changed files with 84 additions and 404 deletions
+4 -14
View File
@@ -19,17 +19,7 @@ yarn add @backstage/plugin-rollbar
export { plugin as Rollbar } from '@backstage/plugin-rollbar';
```
4. Add plugin API to your Backstage instance:
```ts
// packages/app/src/api.ts
import { RollbarClient, rollbarApiRef } from '@backstage/plugin-rollbar';
// ...
builder.add(rollbarApiRef, new RollbarClient({ discoveryApi }));
```
5. Add to the app `EntityPage` component:
4. Add to the app `EntityPage` component:
```ts
// packages/app/src/components/catalog/EntityPage.tsx
@@ -48,7 +38,7 @@ const ServiceEntityPage = ({ entity }: { entity: Entity }) => (
);
```
6. Setup the `app.config.yaml` and account token environment variable
5. Setup the `app.config.yaml` and account token environment variable
```yaml
# app.config.yaml
@@ -59,7 +49,7 @@ rollbar:
$env: ROLLBAR_ACCOUNT_TOKEN
```
7. Annotate entities with the rollbar project slug
6. Annotate entities with the rollbar project slug
```yaml
# pump-station-catalog-component.yaml
@@ -71,7 +61,7 @@ metadata:
rollbar.com/project-slug: project-name
```
8. Run app with `yarn start` and navigate to `/rollbar` or a catalog entity
7. Run app with `yarn start` and navigate to `/rollbar` or a catalog entity
## Features