Skip to content

fix: Fix kafka exporter instance argument#5213

Open
nilforoosh wants to merge 1 commit intografana:mainfrom
nilforoosh:fix-kafka-exporter-instance-argument
Open

fix: Fix kafka exporter instance argument#5213
nilforoosh wants to merge 1 commit intografana:mainfrom
nilforoosh:fix-kafka-exporter-instance-argument

Conversation

@nilforoosh
Copy link
Copy Markdown

Brief description of Pull Request

When there is only one URI in kafka-exporter, the instance parameter is ignored and there is a bug.

Pull Request Details

Issue(s) fixed by this Pull Request

Notes to the Reviewer

PR Checklist

  • Documentation added
  • Tests updated
  • Config converters updated

@nilforoosh nilforoosh requested a review from a team as a code owner January 8, 2026 16:45
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

// their own value for instance key in the common config.
func (c *Config) InstanceKey(_ string) (string, error) {
if len(c.KafkaURIs) == 1 {
if c.Instance == "" && len(c.KafkaURIs) == 1 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To make this a bit more readable, should we refactor to have a guard clause checking if Instance is set, and otherwise check the KafkaURIs?

if c.Instance != "" {
  return c.Instance, nil
}

//check KafkaURIs here

@github-actions
Copy link
Copy Markdown
Contributor

This PR has not had any activity in the past 90 days, so the needs-attention label has been added to it.
If you do not have enough time to follow up on this PR or you think it's no longer relevant, consider closing it.
The needs-attention label signals to maintainers that something has fallen through the cracks. No action is needed by you; your PR will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity.
Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants