Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LI-HOTFIX] Make the msgSendLatencySensor non-static #500

Merged
merged 1 commit into from
Dec 22, 2023

Conversation

gitlw
Copy link

@gitlw gitlw commented Dec 22, 2023

TICKET = LIKAFKA-56148
LI_DESCRIPTION =
The msgSendLatencySensor sensor is used to add the following metrics together with client-id tags to a single KafkaProducer:

MetricName [name=message-produce-latency-avg, group=producer-metrics, description=The average latency between record queuing and get acknowledged in ms, tags={client-id=client-id1}],
MetricName [name=message-produce-latency-max, group=producer-metrics, description=The average latency between record queuing and get acknowledged in ms, tags={client-id=client-id1}],

The current implematation uses a static variable for the msgSendLatencySensor field, which means all KafkaProducer objects in the same process share the same sensor, and hence can interfere with each other.

This PR fixes the problem by making the msgSendLatencySensor a non-static field.

EXIT_CRITERIA = When this patch is merged in upstream kafka.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

TICKET = LIKAFKA-56148
LI_DESCRIPTION =
The msgSendLatencySensor sensor is used to add the following metrics together with client-id tags to a single KafkaProducer:

MetricName [name=message-produce-latency-avg, group=producer-metrics, description=The average latency between record queuing and get acknowledged in ms, tags={client-id=client-id1}],
MetricName [name=message-produce-latency-max, group=producer-metrics, description=The average latency between record queuing and get acknowledged in ms, tags={client-id=client-id1}],

The current implematation uses a static variable for the msgSendLatencySensor field, which means all KafkaProducer objects in the same process share the same sensor, and hence can interfere with each other.

This PR fixes the problem by making the msgSendLatencySensor a non-static field.

EXIT_CRITERIA = When this patch is merged in upstream kafka.
Copy link

@moussa-chater moussa-chater left a comment

Choose a reason for hiding this comment

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

lgtm

@gitlw gitlw merged commit 4253d39 into 3.0-li Dec 22, 2023
25 checks passed
@gitlw gitlw deleted the fix_msgSendLatencySensor_3.0 branch December 22, 2023 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants