1.6.2 • Published 5 months ago

@cortexapps/backstage-backend-plugin v1.6.2

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
5 months ago

Cortex Backend Plugin for Backstage

See the Cortex Scorecard Plugin for more details. The backend plugin will allow you to sync your Backstage services with Cortex asynchronously, set to any cron schedule of your choosing.

To start using the Backstage plugin and see a demo, please book a demo!

Setup and Integration

  1. In the packages/backend directory of your Backstage instance, add the plugin as a package.json dependency:
$ yarn add @cortexapps/backstage-backend-plugin
  1. Create a new file: packages/backend/src/plugins/cortex.ts:
import { PluginEnvironment } from '../types';
import { createRouter } from '@cortexapps/backstage-backend-plugin';

export default async function createPlugin(env: PluginEnvironment) {
  return await createRouter({
    discoveryApi: env.discovery,
    logger: env.logger,
    cronSchedule: env.config.getOptionalString('cortex.backend.cron') ?? '0 3,7,11,15,19,23 * * *'
  });
}
  1. Update packages/backend/src/index.ts:
import cortex from './plugins/cortex';
...
const cortexEnv = useHotMemoize(module, () => createEnv('cortex'));
...
apiRouter.use('/cortex', await cortex(cortexEnv));
  1. Update app-config.yaml to add a new config under the proxy section:
'/cortex':
    target: ${CORTEX_BACKEND_HOST_URL}
    headers:
      Authorization: Bearer ${CORTEX_TOKEN}
  1. (Optional) You can choose to have the entity sync cron job use gzip to compress the entities by updating cortex.ts from step 2. You must also update the Backstage HTTP proxy to allow the Content-Encoding header.
import { PluginEnvironment } from '../types';
import { createRouter } from '@cortexapps/backstage-backend-plugin';

export default async function createPlugin(env: PluginEnvironment) {
  return await createRouter({
    discoveryApi: env.discovery,
    logger: env.logger,
    syncWithGzip: true,
    cronSchedule: env.config.getOptionalString('cortex.backend.cron') ?? '0 3,7,11,15,19,23 * * *'
  });
}
proxy:
  '/cortex':
    target: ${CORTEX_BACKEND_HOST_URL}
    headers:
      Authorization: ${CORTEX_TOKEN}
    allowedHeaders:
      - Content-Encoding
1.6.2

5 months ago

1.5.4

9 months ago

1.6.1

6 months ago

1.6.0

8 months ago

1.5.3

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.0

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.2

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.1

2 years ago

0.1.0

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago