@backstage-community/plugin-rollbar-backend
TypeScript icon, indicating that this package has built-in type declarations

0.1.70 • Public • Published

Rollbar Backend

Simple plugin that proxies requests to the Rollbar API.

Setup

  1. Install the plugin using:
# From your Backstage root directory
yarn --cwd packages/backend add @backstage-community/plugin-rollbar-backend
  1. In your packages/backend/src/index.ts make the following changes:
  import { createBackend } from '@backstage/backend-defaults';

  const backend = createBackend();

  // ... other feature additions

+ backend.add(import('@backstage-community/plugin-rollbar-backend'));

  // ...

  backend.start();

Legacy Backend Setup

  1. Install the plugin using:
# From your Backstage root directory
yarn --cwd packages/backend add @backstage-community/plugin-rollbar-backend
  1. Create a rollbar.ts file inside packages/backend/src/plugins/:
import { createRouter } from '@backstage-community/plugin-rollbar-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';

export default async function createPlugin(
  env: PluginEnvironment,
): Promise<Router> {
  return await createRouter({
    logger: env.logger,
    config: env.config,
  });
}
  1. Modify your packages/backend/src/index.ts to include:
 ...

 import { Config } from '@backstage/config';
 import app from './plugins/app';
+import rollbar from './plugins/rollbar';
 import scaffolder from './plugins/scaffolder';

 ...

 async function main() {

   ...

   const authEnv = useHotMemoize(module, () => createEnv('auth'));
+  const rollbarEnv = useHotMemoize(module, () => createEnv('rollbar'));
   const proxyEnv = useHotMemoize(module, () => createEnv('proxy'));

   ...

   const apiRouter = Router();
   apiRouter.use('/catalog', await catalog(catalogEnv));
+  apiRouter.use('/rollbar', await rollbar(rollbarEnv));
   apiRouter.use('/scaffolder', await scaffolder(scaffolderEnv));

The following values are read from the configuration file.

rollbar:
  accountToken: ${ROLLBAR_ACCOUNT_TOKEN}

NOTE: The ROLLBAR_ACCOUNT_TOKEN environment variable must be set to a read access account token.

Links

Readme

Keywords

Package Sidebar

Install

npm i @backstage-community/plugin-rollbar-backend

Homepage

backstage.io

Weekly Downloads

641

Version

0.1.70

License

Apache-2.0

Unpacked Size

67.7 kB

Total Files

17

Last publish

Collaborators

  • patriko