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

Expose compaction metrics to Prometheus #11739

Merged
merged 10 commits into from Aug 31, 2021

Conversation

Technoboy-
Copy link
Contributor

@Technoboy- Technoboy- commented Aug 22, 2021

Motivation

As #11564 has involved compaction metrics in CLI, it's extremely useful to expose relative metrics to Prometheus.

  • pulsar_compaction_removed_event_count : the removed event count of compaction .
  • pulsar_compaction_succeed_count : the succeed count of compaction.
  • pulsar_compaction_failed_count : the failed count of compaction.
  • pulsar_compaction_duration_time_in_millis : the duration time of compaction.
  • pulsar_compaction_read_throughput : the read throughput of compaction.
  • pulsar_compaction_write_throughput : the write throughput of compaction.
  • pulsar_compaction_compacted_entries_count: the compacted entries count.
  • pulsar_compaction_compacted_entries_size: the compacted entries size;

if users enable the topic level metrics and the topic has been compacted or doing the compaction, we should expose the compaction metrics for the topic level. If users disable the topic level metrics, we should expose the aggregated compaction metrics for the namespace level.

Documentation

For contributor

The document is required.

Technoboy- added a commit to Technoboy-/pulsar that referenced this pull request Aug 22, 2021
@Technoboy- Technoboy- changed the title Expose compaction metrics to Prometheus [WIP]Expose compaction metrics to Prometheus Aug 22, 2021
@Anonymitaet Anonymitaet added the doc-required Your PR changes impact docs and you will update later. label Aug 23, 2021
@Anonymitaet
Copy link
Member

Thanks for your contribution. Please do not forget to update docs later. And you can ping me to review the docs, thanks.

@Technoboy- Technoboy- changed the title [WIP]Expose compaction metrics to Prometheus Expose compaction metrics to Prometheus Aug 23, 2021
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

very good.

I left one comment about exposing an "Impl" class in PersistentTopic.

PTAL

@Technoboy-
Copy link
Contributor Author

very good.

I left one comment about exposing an "Impl" class in PersistentTopic.

PTAL

Thanks for reviewing.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

@Technoboy-
Copy link
Contributor Author

/pulsarbot run-failure-checks

@michaeljmarshall
Copy link
Member

michaeljmarshall commented Aug 26, 2021

Just took a glance, and this is a good addition. change. When reviewing #11564, I forgot to mention that we should provide a way to disable metrics at a topic level. I plan to review this PR more thoroughly within 24 hours.

Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

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

This is a great start. I left a couple comments where I think we can improve the data modeling to minimize the number of get calls required to retrieve metrics from the same CompactionRecord object.

@michaeljmarshall
Copy link
Member

@Technoboy- it could also be convenient to allow users to aggregate these metrics at a namespace level, but not a topic level. This would especially be helpful for users with many compacted topics.

@Technoboy-
Copy link
Contributor Author

Technoboy- commented Aug 27, 2021

@Technoboy- it could also be convenient to allow users to aggregate these metrics at a namespace level, but not a topic level. This would especially be helpful for users with many compacted topics.

Yes, the current CompactorMetrics is based on namespace level. And many thanks for your kind reivew.

@Technoboy-
Copy link
Contributor Author

/pulsarbot run-failure-checks

Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

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

@Technoboy- thanks for making those changes. It looks great to me. The only change I can see is to update the computeIfAbsent logic to prevent the same value from being added twice.

Copy link
Contributor

@hangc0276 hangc0276 left a comment

Choose a reason for hiding this comment

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

Please add a test to check the final prometheus metric output result in PrometheusMetricsTest

Copy link
Member

@michaeljmarshall michaeljmarshall left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for addressing all of my feedback.

@Technoboy-
Copy link
Contributor Author

LGTM. Thanks for addressing all of my feedback.

Many thanks for your kind review.

@Technoboy-
Copy link
Contributor Author

Please add a test to check the final prometheus metric output result in PrometheusMetricsTest

Yes, done. Thanks for reviewing.

@codelipenghui codelipenghui merged commit 656635e into apache:master Aug 31, 2021
@Anonymitaet Anonymitaet added doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. and removed doc-required Your PR changes impact docs and you will update later. labels Sep 1, 2021
@Anonymitaet
Copy link
Member

Anonymitaet commented Sep 2, 2021

Hi @sijia-w, in this PR, @Technoboy- has already added docs tomaster.

  • Could you please add the same contents to 2.8.2?
  • If you find any inaccurate expressions, incorrect grammar usage, or other issues, you can modify the docs based on technical writing rules.

Thanks!

codelipenghui pushed a commit that referenced this pull request Sep 2, 2021
### Motivation
As #11564 has involved compaction metrics in CLI, it's extremely useful to expose relative metrics to Prometheus.

- pulsar_compaction_removed_event_count :  the removed event count of compaction .
- pulsar_compaction_succeed_count : the succeed count of compaction.
- pulsar_compaction_failed_count : the failed count of compaction.
- pulsar_compaction_duration_time_in_millis : the duration time of compaction.
- pulsar_compaction_read_throughput : the read throughput of compaction.
- pulsar_compaction_write_throughput : the write throughput of compaction.
- pulsar_compaction_compacted_entries_count: the compacted entries count.
- pulsar_compaction_compacted_entries_size: the compacted entries size;

if users enable the topic level metrics and the topic has been compacted or doing the compaction, we should expose the compaction metrics for the topic level. If users disable the topic level metrics, we should expose the aggregated compaction metrics for the namespace level.


(cherry picked from commit 656635e)
@codelipenghui codelipenghui added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Sep 2, 2021
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 25, 2022
### Motivation
As apache#11564 has involved compaction metrics in CLI, it's extremely useful to expose relative metrics to Prometheus.

- pulsar_compaction_removed_event_count :  the removed event count of compaction .
- pulsar_compaction_succeed_count : the succeed count of compaction.
- pulsar_compaction_failed_count : the failed count of compaction.
- pulsar_compaction_duration_time_in_millis : the duration time of compaction.
- pulsar_compaction_read_throughput : the read throughput of compaction.
- pulsar_compaction_write_throughput : the write throughput of compaction.
- pulsar_compaction_compacted_entries_count: the compacted entries count.
- pulsar_compaction_compacted_entries_size: the compacted entries size;

if users enable the topic level metrics and the topic has been compacted or doing the compaction, we should expose the compaction metrics for the topic level. If users disable the topic level metrics, we should expose the aggregated compaction metrics for the namespace level.

(cherry picked from commit 656635e)
(cherry picked from commit a80f1e8)
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this pull request Mar 18, 2022
### Motivation
As apache#11564 has involved compaction metrics in CLI, it's extremely useful to expose relative metrics to Prometheus.

- pulsar_compaction_removed_event_count :  the removed event count of compaction .
- pulsar_compaction_succeed_count : the succeed count of compaction.
- pulsar_compaction_failed_count : the failed count of compaction.
- pulsar_compaction_duration_time_in_millis : the duration time of compaction.
- pulsar_compaction_read_throughput : the read throughput of compaction.
- pulsar_compaction_write_throughput : the write throughput of compaction.
- pulsar_compaction_compacted_entries_count: the compacted entries count.
- pulsar_compaction_compacted_entries_size: the compacted entries size;

if users enable the topic level metrics and the topic has been compacted or doing the compaction, we should expose the compaction metrics for the topic level. If users disable the topic level metrics, we should expose the aggregated compaction metrics for the namespace level.
momo-jun added a commit to momo-jun/pulsar that referenced this pull request Aug 5, 2022
@Technoboy- Technoboy- deleted the compacted-topic-metrics-2 branch August 10, 2022 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/metrics cherry-picked/branch-2.8 Archived: 2.8 is end of life doc Your PR contains doc changes, no matter whether the changes are in markdown or code files. release/2.8.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants