Skip to content

KAFKA-5890 records.lag should use tags for topic and partition rather than using metric name.#4362

Closed
lahabana wants to merge 1 commit into
apache:trunkfrom
lahabana:kafka-5890
Closed

KAFKA-5890 records.lag should use tags for topic and partition rather than using metric name.#4362
lahabana wants to merge 1 commit into
apache:trunkfrom
lahabana:kafka-5890

Conversation

@lahabana

Copy link
Copy Markdown
Contributor

This is the implementation of KIP-225.
It marks the previous metrics as deprecated in the documentation and adds new metrics using tags.

Testing verifies that both the new and the old metric report the same value.

Committer Checklist (excluded from commit message)

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

@lahabana

lahabana commented Jan 8, 2018

Copy link
Copy Markdown
Contributor Author

@becketqin @junrao @hachikuji pinging you for a review as you were the binding votes of KIP-225.

Once this is merged I will open a JIRA against 2.0 to remove the deprecated metrics.

@becketqin

Copy link
Copy Markdown
Contributor

@lahabana Thanks for the patch. It looks good. Can we also update docs/upgrade.html to let the users know about the new metrics and the deprecation schedule of the old metrics so the users may plan ahead?

@lahabana

lahabana commented Jan 8, 2018

Copy link
Copy Markdown
Contributor Author

@becketqin thanks updated I couldn't find how to build the docs locally to check how it looks like. Could you let me know how to do this? Also should I link to the KIP-225 in the upgrade docs?

@becketqin

Copy link
Copy Markdown
Contributor

@lahabana The upgrade doc is an html file, so you can open it in a browser. It would be good to have a pointer to the KIP wiki. In the KIP wiki, do you think it is worth adding a code snippet to show the users how to get the metric values?

@lahabana

lahabana commented Jan 9, 2018

Copy link
Copy Markdown
Contributor Author

@becketqin updated the docs and added a before/after to the KIP.
It's not that easy to actually see the doc as it's using ssi (server side includes).
I believe I need to run an apache server locally, how do people usually do?

@lahabana

Copy link
Copy Markdown
Contributor Author

@becketqin what's the next step?

@lahabana

Copy link
Copy Markdown
Contributor Author

retest this please

@becketqin

Copy link
Copy Markdown
Contributor

@lahabana Sorry for the late response. I usually just comment out the javascript in the html. The updated patch LGTM.

@becketqin becketqin closed this in 5d81639 Jan 15, 2018
@lahabana

Copy link
Copy Markdown
Contributor Author

Thanks @becketqin

Sensor recordsLag = this.metrics.getSensor(name);
if (recordsLag == null) {
Map<String, String> metricTags = new HashMap<>(2);
metricTags.put("topic", tp.topic().replace('.', '_'));

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.

Is there a reason you replace '.' by '_' in that case?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this is always done in metrics. I believe it's because JMX uses . to define hierarchy on entities so using a dot here would cause issues in the jmx reporter.
It's mentioned here: http://kafka.apache.org/documentation.html#upgrade_9_breaking

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.

Thanks for your reply. I guess this may be true in some cases, but at least for e.g. kafka.server:type=BrokerTopicMetrics,name=MessagesInPerSec it works even if the topic contains dots.

akatona84 pushed a commit to akatona84/kafka that referenced this pull request Jul 30, 2018
…r than using metric name.

This is the implementation of KIP-225.
It marks the previous metrics as deprecated in the documentation and adds new metrics using tags.

Testing verifies that both the new and the old metric report the same value.

Author: cmolter <cmolter@apple.com>

Reviewers: Jiangjie (Becket) Qin <becket.qin@gmail.com>

Closes apache#4362 from lahabana/kafka-5890

KAFKA-6184; report a metric of the lag between the consumer offset ...

Add `records-lead` and partition-level `{topic}-{partition}.records-lead-min|avg` for fetcher metrics.

junrao  Please kindly review. Thanks.

Author: huxihx <huxi_2b@hotmail.com>

Reviewers: Jun Rao <junrao@gmail.com>

Closes apache#4191 from huxihx/KAFKA-6184

MINOR: Remove deprecated per-partition lag metrics

It takes O(n^2) time to instantiate a mbean with n attributes which can be very slow if the number of attributes of this mbean is large. This PR removes metrics whose number of attributes can grow with the number of partitions in the cluster to fix the performance issue. These metrics have already been marked for removal in 2.0 by KIP-225.

Author: Dong Lin <lindong28@gmail.com>

Reviewers: Ismael Juma <ismael@juma.me.uk>

Closes apache#5172 from lindong28/remove-deprecated-metrics

(cherry picked from commit 4580d9f)
Signed-off-by: Dong Lin <lindong28@gmail.com>

CLOUDERA-BUILD: Fix compilation error

Use TestUtils.createTopic in PlaintextConsumerTest

Change-Id: Ia3296e3093039c11b5c5c264a476ce51211a01f7
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.

3 participants