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 #499

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.

Testing Done

./gradlew build

Committer Checklist (excluded from commit message)

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

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.
@gitlw gitlw merged commit 84e7571 into 2.4-li Dec 22, 2023
21 checks passed
@gitlw gitlw deleted the fix_msgSendLatencySensor 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