Files
backstage/plugins/kafka
dependabot[bot] e5327abaa3 build(deps): bump @testing-library/react-hooks from 3.4.2 to 7.0.2
Bumps [@testing-library/react-hooks](https://github.com/testing-library/react-hooks-testing-library) from 3.4.2 to 7.0.2.
- [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/v3.4.2...v7.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-28 13:01:24 +02:00
..
2021-06-18 20:26:42 +02:00
2020-12-21 13:21:48 +02:00
2021-09-23 10:01:17 +00:00
2021-05-02 22:13:05 +02: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 { PluginEnvironment } from '../types';

export default async function createPlugin({
  logger,
  config,
}: PluginEnvironment) {
  return await createRouter({ logger, 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.