adding rollbar plugin & backend
This is the first commit of the rollbar plugin. It is fully functional but will require some additional features to make it more usable and feature complete. It currently includes a backend wraps the rollbar REST API and provides data for the frontend plugin.
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
"@backstage/plugin-graphiql": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-lighthouse": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-register-component": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-rollbar": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-scaffolder": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-sentry": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-tech-radar": "^0.1.1-alpha.13",
|
||||
|
||||
@@ -57,6 +57,8 @@ import {
|
||||
} from '@backstage/plugin-graphiql';
|
||||
import { scaffolderApiRef, ScaffolderApi } from '@backstage/plugin-scaffolder';
|
||||
|
||||
import { rollbarApiRef, RollbarClient } from '@backstage/plugin-rollbar';
|
||||
|
||||
export const apis = (config: ConfigApi) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log(`Creating APIs for ${config.getString('app.title')}`);
|
||||
@@ -170,5 +172,13 @@ export const apis = (config: ConfigApi) => {
|
||||
]),
|
||||
);
|
||||
|
||||
builder.add(
|
||||
rollbarApiRef,
|
||||
new RollbarClient({
|
||||
apiOrigin: backendUrl,
|
||||
basePath: '/rollbar',
|
||||
}),
|
||||
);
|
||||
|
||||
return builder.build();
|
||||
};
|
||||
|
||||
@@ -26,3 +26,4 @@ export { plugin as GitopsProfiles } from '@backstage/plugin-gitops-profiles';
|
||||
export { plugin as TechDocs } from '@backstage/plugin-techdocs';
|
||||
export { plugin as GraphiQL } from '@backstage/plugin-graphiql';
|
||||
export { plugin as GithubActions } from '@backstage/plugin-github-actions';
|
||||
export { plugin as Rollbar } from '@backstage/plugin-rollbar';
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"@backstage/plugin-auth-backend": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-catalog-backend": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-identity-backend": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-rollbar-backend": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-scaffolder-backend": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-sentry-backend": "^0.1.1-alpha.13",
|
||||
"@backstage/plugin-techdocs-backend": "^0.1.1-alpha.13",
|
||||
|
||||
@@ -33,6 +33,7 @@ import knex from 'knex';
|
||||
import auth from './plugins/auth';
|
||||
import catalog from './plugins/catalog';
|
||||
import identity from './plugins/identity';
|
||||
import rollbar from './plugins/rollbar';
|
||||
import scaffolder from './plugins/scaffolder';
|
||||
import sentry from './plugins/sentry';
|
||||
import techdocs from './plugins/techdocs';
|
||||
@@ -69,6 +70,12 @@ async function main() {
|
||||
const service = createServiceBuilder(module)
|
||||
.loadConfig(configReader)
|
||||
.addRouter('/catalog', await catalog(catalogEnv))
|
||||
.addRouter(
|
||||
'/rollbar',
|
||||
await rollbar(
|
||||
getRootLogger().child({ type: 'plugin', plugin: 'rollbar' }),
|
||||
),
|
||||
)
|
||||
.addRouter('/scaffolder', await scaffolder(scaffolderEnv))
|
||||
.addRouter(
|
||||
'/sentry',
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* Copyright 2020 Spotify AB
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createRouter } from '@backstage/plugin-rollbar-backend';
|
||||
import { Logger } from 'winston';
|
||||
|
||||
export default async function createPlugin(logger: Logger) {
|
||||
return await createRouter({ logger });
|
||||
}
|
||||
Reference in New Issue
Block a user