codecov / worker

Code for Background Workers of Codecov
Other
50 stars 10 forks source link

Created prometheus handler class #790

Closed adrian-codecov closed 1 week ago

adrian-codecov commented 1 week ago

We want to separate prometheus responsibilities from the checkpoint responsibilities to later extend its functionality. This PR just rearranges logic and doesn't include new one, to separate reviews into more manageable chunks.

This PR mainly creates the PrometheusCheckpointLoggerHandler class, which has log_X methods for logging X things. This class is then used in the checkpoint_logger.init.py file

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. In 2022 this entity acquired Codecov and as result Sentry is going to need some rights from me in order to utilize my contributions in this PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.01%. Comparing base (112592f) to head (1fb9d83). Report is 1 commits behind head on main.

:white_check_mark: All tests successful. No failed tests found.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/codecov/worker/pull/790/graphs/tree.svg?width=650&height=150&src=pr&token=BWTOrjBaE5&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov)](https://app.codecov.io/gh/codecov/worker/pull/790?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) ```diff @@ Coverage Diff @@ ## main #790 +/- ## ======================================= Coverage 98.01% 98.01% ======================================= Files 442 443 +1 Lines 36597 36615 +18 ======================================= + Hits 35869 35887 +18 Misses 728 728 ``` | [Flag](https://app.codecov.io/gh/codecov/worker/pull/790/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/codecov/worker/pull/790/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `98.01% <100.00%> (+<0.01%)` | :arrow_up: | | [unit](https://app.codecov.io/gh/codecov/worker/pull/790/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `98.01% <100.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#carryforward-flags-in-the-pull-request-comment) to find out more. | [Components](https://app.codecov.io/gh/codecov/worker/pull/790/components?src=pr&el=components&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | | |---|---|---| | [NonTestCode](https://app.codecov.io/gh/codecov/worker/pull/790/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `95.87% <100.00%> (+<0.01%)` | :arrow_up: | | [OutsideTasks](https://app.codecov.io/gh/codecov/worker/pull/790/components?src=pr&el=component&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | `97.99% <100.00%> (+<0.01%)` | :arrow_up: | | [Files with missing lines](https://app.codecov.io/gh/codecov/worker/pull/790?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov) | Coverage Δ | | |---|---|---| | [helpers/checkpoint\_logger/\_\_init\_\_.py](https://app.codecov.io/gh/codecov/worker/pull/790?src=pr&el=tree&filepath=helpers%2Fcheckpoint_logger%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-aGVscGVycy9jaGVja3BvaW50X2xvZ2dlci9fX2luaXRfXy5weQ==) | `95.00% <100.00%> (-0.17%)` | :arrow_down: | | [helpers/checkpoint\_logger/prometheus.py](https://app.codecov.io/gh/codecov/worker/pull/790?src=pr&el=tree&filepath=helpers%2Fcheckpoint_logger%2Fprometheus.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=codecov#diff-aGVscGVycy9jaGVja3BvaW50X2xvZ2dlci9wcm9tZXRoZXVzLnB5) | `100.00% <100.00%> (ø)` | |
codecov-notifications[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #790   +/-   ##
=======================================
  Coverage   98.01%   98.01%           
=======================================
  Files         442      443    +1     
  Lines       36597    36615   +18     
=======================================
+ Hits        35869    35887   +18     
  Misses        728      728           
Flag Coverage Δ
integration 98.01% <100.00%> (+<0.01%) :arrow_up:
unit 98.01% <100.00%> (+<0.01%) :arrow_up:

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

Components Coverage Δ
NonTestCode 95.87% <100.00%> (+<0.01%) :arrow_up:
OutsideTasks 97.99% <100.00%> (+<0.01%) :arrow_up:
Files with missing lines Coverage Δ
helpers/checkpoint_logger/__init__.py 95.00% <100.00%> (-0.17%) :arrow_down:
helpers/checkpoint_logger/prometheus.py 100.00% <100.00%> (ø)
codecov-qa[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.01%. Comparing base (112592f) to head (1fb9d83). Report is 1 commits behind head on main.

:white_check_mark: All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #790   +/-   ##
=======================================
  Coverage   98.01%   98.01%           
=======================================
  Files         442      443    +1     
  Lines       36597    36615   +18     
=======================================
+ Hits        35869    35887   +18     
  Misses        728      728           
Flag Coverage Δ
integration 98.01% <100.00%> (+<0.01%) :arrow_up:
unit 98.01% <100.00%> (+<0.01%) :arrow_up:

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

Components Coverage Δ
NonTestCode 95.87% <100.00%> (+<0.01%) :arrow_up:
OutsideTasks 97.99% <100.00%> (+<0.01%) :arrow_up:
Files with missing lines Coverage Δ
helpers/checkpoint_logger/__init__.py 95.00% <100.00%> (-0.17%) :arrow_down:
helpers/checkpoint_logger/prometheus.py 100.00% <100.00%> (ø)
codecov-public-qa[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 98.01%. Comparing base (112592f) to head (1fb9d83).

:white_check_mark: All tests successful. No failed tests found.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #790   +/-   ##
=======================================
  Coverage   98.01%   98.01%           
=======================================
  Files         442      443    +1     
  Lines       36597    36615   +18     
=======================================
+ Hits        35869    35887   +18     
  Misses        728      728           
Flag Coverage Δ
integration 98.01% <100.00%> (+<0.01%) :arrow_up:
unit 98.01% <100.00%> (+<0.01%) :arrow_up:

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

Components Coverage Δ
NonTestCode 95.87% <100.00%> (+<0.01%) :arrow_up:
OutsideTasks 97.99% <100.00%> (+<0.01%) :arrow_up:
Files Coverage Δ
helpers/checkpoint_logger/__init__.py 95.00% <100.00%> (-0.17%) :arrow_down:
helpers/checkpoint_logger/prometheus.py 100.00% <100.00%> (ø)