Skip to content

Conversation

@grobinson-grafana
Copy link
Contributor

@grobinson-grafana grobinson-grafana commented May 8, 2025

What this PR does / why we need it:

This commit adds a new kafka client called clientv2. I will replace existing use of the current package over a number of subsequent PRs to make it easier to review and test changes in isolation.

The motivation for this new package is that it was hard to create a *kgo.Client that could both produce and consume records. To fix this, the v2 client separates creating the client from creating the options, enabling the use of clients that produce, consume, and do both.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@grobinson-grafana grobinson-grafana requested a review from a team as a code owner May 8, 2025 13:52
@grobinson-grafana grobinson-grafana force-pushed the grobinson/kafka-client-v2 branch 5 times, most recently from 165f5e8 to 217a049 Compare May 8, 2025 21:35
@grobinson-grafana grobinson-grafana marked this pull request as draft May 8, 2025 21:39
This commit adds a new kafka client called clientv2. I will replace
existing use of the current package over a number of subsequent
PRs to make it easier to review and test changes in isolation.

The motivation for this new package is that it was hard to create
a *kgo.Client that could both produce and consume records. To fix
this, the v2 client separates creating the client from creating
the options, enabling the use of clients that produce, consume,
and do both.
@grobinson-grafana grobinson-grafana force-pushed the grobinson/kafka-client-v2 branch from ca8844d to 041c894 Compare May 9, 2025 09:08
@grobinson-grafana grobinson-grafana marked this pull request as ready for review May 9, 2025 09:08
@grobinson-grafana grobinson-grafana force-pushed the grobinson/kafka-client-v2 branch from 041c894 to 28533f6 Compare May 9, 2025 11:47

// TODO(grobinson): These will be removed when we figure out how to support
// different addresses for read and write clients in kafka.Config,
KafkaReadAddress string `yaml:"kafka_read_address"`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a quick fix to support different addresses for read and write agents. I tried having separate configs, but it creates other problems. I need time to think about the correct solution here

@grobinson-grafana grobinson-grafana deleted the grobinson/kafka-client-v2 branch October 7, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant