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 metrics defined by the spec in Prometheus format #244

Merged
merged 1 commit into from
Oct 1, 2020

Conversation

pierDipi
Copy link
Member

@pierDipi pierDipi commented Oct 1, 2020

This PR exposes the following metrics:

  1. http_events_sent_total
  2. http_requests_produce_total
  3. http_requests_malformed_total

All of the above metrics are counters.

(1) is incremented when the dispatcher commits the offset to Kafka.
(2) is incremented when the receiver sends successfully the message to Kafka.
(3) is incremented when the receiver receives a malformed event.

Signed-off-by Pierangelo Di Pilato pierangelodipilato@gmail.com

Fixes #227

Proposed Changes

  • Expose metrics defined by the spec in Prometheus format

Prometheus Dashboard

image

Release Note

- 🎁 Add new feature
The receiver component exposes:
  - http_requests_produce_total - Number of accepted produce requests (200-level responses)
  - http_requests_malformed_total - Number of malformed produce requests (400-level responses)
The dispatcher component exposes:
  - http_events_sent_total - Number of events delivered

This PR exposes the following metrics:
1. http_events_sent_total
2. http_requests_produce_total
3. http_requests_malformed_total

All of the above metrics are counters.

(1) is incremented when the dispatcher commits the offset to Kafka.
(2) is incremented when the receiver sends successfully the message to Kafka.
(3) is incremented when the receiver receives a malformed event.

Signed-off-by: Pierangelo Di Pilato <pierangelodipilato@gmail.com>
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Oct 1, 2020
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 1, 2020
@codecov
Copy link

codecov bot commented Oct 1, 2020

Codecov Report

Merging #244 into master will decrease coverage by 0.10%.
The diff coverage is 65.38%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #244      +/-   ##
============================================
- Coverage     76.40%   76.30%   -0.11%     
  Complexity      170      170              
============================================
  Files            49       49              
  Lines          1420     1435      +15     
  Branches         46       46              
============================================
+ Hits           1085     1095      +10     
- Misses          266      271       +5     
  Partials         69       69              
Flag Coverage Δ Complexity Δ
#java-unittests 76.05% <65.38%> (-0.21%) 170.00 <4.00> (ø)
#unittests 76.30% <65.38%> (-0.11%) 170.00 <4.00> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ Complexity Δ
...knative/eventing/kafka/broker/dispatcher/Main.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...v/knative/eventing/kafka/broker/receiver/Main.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ka/broker/core/metrics/MetricsOptionsProvider.java 90.00% <100.00%> (+1.11%) 1.00 <0.00> (ø)
...ispatcher/ConsumerRecordOffsetStrategyFactory.java 100.00% <100.00%> (ø) 1.00 <1.00> (ø)
...trategy/UnorderedConsumerRecordOffsetStrategy.java 90.32% <100.00%> (+1.86%) 9.00 <2.00> (ø)
...eventing/kafka/broker/receiver/RequestHandler.java 95.29% <100.00%> (+0.23%) 14.00 <1.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb434dd...21c2843. Read the comment docs.

@slinkydeveloper
Copy link
Contributor

Nice trick reusing the other tests ;)
/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 1, 2020
@knative-prow-robot knative-prow-robot merged commit d964c4b into knative-extensions:master Oct 1, 2020
@pierDipi pierDipi deleted the KNATIVE-227 branch April 14, 2021 21:16
matzew pushed a commit to matzew/eventing-kafka-broker that referenced this pull request May 10, 2022
…native-extensions#244)

* Use PLAIN as default SASL if not specified
Fixes knative-extensions#2117

* control plane test to default SASL PLAIN

* Dedault to SASL PLAIN when doing connection not before

* Added data-plane unit tests for defaulted SASL PLAIN

* Reconcilation tests for Kafka source SASL

Co-authored-by: Aleksander Slominski <aslom@us.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose Prometheus metrics
4 participants