Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Airbrake
The Airbrake plugin provides connectivity between Backstage and Airbrake (https://airbrake.io/).
How to use
-
Install the Frontend plugin:
# From your Backstage root directory cd packages/app yarn add @backstage/plugin-airbrake -
Install the Backend plugin:
# From your Backstage root directory cd packages/backend yarn add @backstage/plugin-airbrake-backend -
Add the
EntityAirbrakeContenttopackages/app/src/components/catalog/EntityPage.tsx:import { EntityAirbrakeContent } from '@backstage/plugin-airbrake'; const serviceEntityPage = ( <EntityLayoutWrapper> <EntityLayout.Route path="/airbrake" title="Airbrake"> <EntityAirbrakeContent /> </EntityLayout.Route> </EntityLayoutWrapper> ); -
Setup the Backend code in
packages/backend/src/index.ts:import { createRouter as createAirbrakeRouter, extractAirbrakeConfig, } from '@backstage/plugin-airbrake-backend'; async function main() { //... After const config = await loadBackendConfig({ ... const airbrakeRouter = await createAirbrakeRouter({ logger, airbrakeConfig: extractAirbrakeConfig(config), }); const service = createServiceBuilder(module) // ... Add the airbrakeRouter here .addRouter('/api/airbrake', airbrakeRouter); } -
Add this config as a top level section in your
app-config.yaml:airbrake: apiKey: ${AIRBRAKE_API_KEY} -
Set an environment variable
AIRBRAKE_API_KEYwith your API key before starting Backstage backend.
Local Development
Start this plugin in standalone mode by running yarn start inside the plugin directory. This method of serving the plugin provides quicker
iteration speed and a faster startup and hot reloads. It is only meant for local development, and the setup for it can
be found inside the /dev directory.
A mock API will be used to run it in standalone. If you want to talk to the real API follow the instructions to start up Airbrake Backend in standalone.