Files
backstage/plugins/kafka
dependabot[bot] 7c7919777e build(deps-dev): bump @testing-library/react-hooks from 7.0.2 to 8.0.0
Bumps [@testing-library/react-hooks](https://github.com/testing-library/react-hooks-testing-library) from 7.0.2 to 8.0.0.
- [Release notes](https://github.com/testing-library/react-hooks-testing-library/releases)
- [Changelog](https://github.com/testing-library/react-hooks-testing-library/blob/main/CHANGELOG.md)
- [Commits](https://github.com/testing-library/react-hooks-testing-library/compare/v7.0.2...v8.0.0)

---
updated-dependencies:
- dependency-name: "@testing-library/react-hooks"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-13 04:10:59 +00:00
..
2022-02-18 13:54:33 +01:00
2022-02-18 13:54:33 +01:00
2022-04-12 15:19:00 +00:00

Kafka Plugin

Setup

  1. Run:
# From your Backstage root directory
yarn --cwd packages/app add @backstage/plugin-kafka
yarn --cwd packages/backend add @backstage/plugin-kafka-backend
  1. Add the plugin backend:

In a new file named kafka.ts under backend/src/plugins:

import { createRouter } from '@backstage/plugin-kafka-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,
  });
}

And then add to packages/backend/src/index.ts:

// In packages/backend/src/index.ts
import kafka from './plugins/kafka';
// ...
async function main() {
  // ...
  const kafkaEnv = useHotMemoize(module, () => createEnv('kafka'));
  // ...
  apiRouter.use('/kafka', await kafka(kafkaEnv));
  1. Add the plugin as a tab to your service entities:
// In packages/app/src/components/catalog/EntityPage.tsx
import { EntityKafkaContent } from '@backstage/plugin-kafka';

const serviceEntityPage = (
  <EntityLayout>
    {/* other tabs... */}
    <EntityLayout.Route path="/kafka" title="Kafka">
      <EntityKafkaContent />
    </EntityLayout.Route>
  1. Add broker configs for the backend in your app-config.yaml (see kafka-backend for more options):
kafka:
  clientId: backstage
  clusters:
    - name: cluster-name
      brokers:
        - localhost:9092
  1. Add the kafka.apache.org/consumer-groups annotation to your services:
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  # ...
  annotations:
    kafka.apache.org/consumer-groups: cluster-name/consumer-group-name
spec:
  type: service

Features

  • List topics offsets and consumer group offsets for configured services.