-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into joseph/rewrite-test-results
- Loading branch information
Showing
22 changed files
with
2,122 additions
and
2,186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,11 +22,11 @@ jobs: | |
lint: | ||
name: Run Lint | ||
|
||
uses: codecov/gha-workflows/.github/workflows/[email protected].23 | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].24 | ||
|
||
build: | ||
name: Build Worker | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].23 | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].24 | ||
|
||
secrets: inherit | ||
with: | ||
|
@@ -35,14 +35,14 @@ jobs: | |
codecovstartup: | ||
name: Codecov Startup | ||
needs: build | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].23 | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].24 | ||
|
||
secrets: inherit | ||
|
||
test: | ||
name: Test | ||
needs: [build] | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].23 | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].24 | ||
|
||
secrets: inherit | ||
with: | ||
|
@@ -52,7 +52,7 @@ jobs: | |
name: Build Self Hosted Worker | ||
needs: [build, test] | ||
|
||
uses: codecov/gha-workflows/.github/workflows/[email protected].23 | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].24 | ||
secrets: inherit | ||
with: | ||
repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-worker' }} | ||
|
@@ -61,7 +61,7 @@ jobs: | |
name: Push Staging Image | ||
needs: [build, test] | ||
if: ${{ github.event_name == 'push' && (github.event.ref == 'refs/heads/main' || github.event.ref == 'refs/heads/staging') && github.repository_owner == 'codecov' }} | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].23 | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].24 | ||
secrets: inherit | ||
with: | ||
environment: staging | ||
|
@@ -71,7 +71,7 @@ jobs: | |
name: Push Production Image | ||
needs: [build, test] | ||
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }} | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].23 | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].24 | ||
secrets: inherit | ||
with: | ||
environment: production | ||
|
@@ -82,7 +82,7 @@ jobs: | |
needs: [build-self-hosted, test] | ||
secrets: inherit | ||
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' && github.repository_owner == 'codecov' }} | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].23 | ||
uses: codecov/gha-workflows/.github/workflows/[email protected].24 | ||
with: | ||
push_rolling: true | ||
repo: ${{ vars.CODECOV_IMAGE_V2 || 'codecov/self-hosted-worker' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
from shared.metrics import Counter, Histogram | ||
|
||
# Main Counter | ||
CHECKPOINTS_TOTAL_BEGUN = Counter( | ||
"worker_checkpoints_begun", | ||
"Total number of times a flow's first checkpoint was logged.", | ||
["flow"], | ||
) | ||
CHECKPOINTS_TOTAL_SUCCEEDED = Counter( | ||
"worker_checkpoints_succeeded", | ||
"Total number of times one of a flow's success checkpoints was logged.", | ||
["flow"], | ||
) | ||
CHECKPOINTS_TOTAL_FAILED = Counter( | ||
"worker_checkpoints_failed", | ||
"Total number of times one of a flow's failure checkpoints was logged.", | ||
["flow"], | ||
) | ||
CHECKPOINTS_TOTAL_ENDED = Counter( | ||
"worker_checkpoints_ended", | ||
"Total number of times one of a flow's terminal checkpoints (success or failure) was logged.", | ||
["flow"], | ||
) | ||
CHECKPOINTS_ERRORS = Counter( | ||
"worker_checkpoints_errors", | ||
"Total number of errors while trying to log checkpoints", | ||
["flow"], | ||
) | ||
CHECKPOINTS_EVENTS = Counter( | ||
"worker_checkpoints_events", | ||
"Total number of checkpoints logged.", | ||
["flow", "checkpoint"], | ||
) | ||
CHECKPOINTS_SUBFLOW_DURATION = Histogram( | ||
"worker_checkpoints_subflow_duration_seconds", | ||
"Duration of subflows in seconds.", | ||
["flow", "subflow"], | ||
buckets=[ | ||
0.05, | ||
0.1, | ||
0.5, | ||
1, | ||
2, | ||
5, | ||
10, | ||
30, | ||
60, | ||
120, | ||
180, | ||
300, | ||
600, | ||
900, | ||
1200, | ||
1800, | ||
2400, | ||
3600, | ||
], | ||
) | ||
|
||
|
||
class PrometheusCheckpointLoggerHandler: | ||
""" | ||
PrometheusCheckpointLoggerHandler is a class that is responsible for all | ||
Prometheus related logs. This checkpoint logic is responsible for logging | ||
metrics to any checkpoints we define. This class is made with the intent | ||
of extending different checkpoints for metrics for different needs. The | ||
methods in this class are mainly used by the CheckpointLogger class. | ||
""" | ||
|
||
def log_begun(self, flow: str): | ||
CHECKPOINTS_TOTAL_BEGUN.labels(flow=flow).inc() | ||
|
||
def log_failure(self, flow: str): | ||
CHECKPOINTS_TOTAL_FAILED.labels(flow=flow).inc() | ||
|
||
def log_success(self, flow: str): | ||
CHECKPOINTS_TOTAL_SUCCEEDED.labels(flow=flow).inc() | ||
|
||
def log_total_ended(self, flow: str): | ||
CHECKPOINTS_TOTAL_ENDED.labels(flow=flow).inc() | ||
|
||
def log_checkpoints(self, flow: str, checkpoint: str): | ||
CHECKPOINTS_EVENTS.labels(flow=flow, checkpoint=checkpoint).inc() | ||
|
||
def log_errors(self, flow: str): | ||
CHECKPOINTS_ERRORS.labels(flow=flow).inc() | ||
|
||
def log_subflow(self, flow: str, subflow: str, duration: int): | ||
CHECKPOINTS_SUBFLOW_DURATION.labels(flow=flow, subflow=subflow).observe( | ||
duration | ||
) | ||
|
||
|
||
PROMETHEUS_HANDLER = PrometheusCheckpointLoggerHandler() |
Oops, something went wrong.