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

Introduce database revision metric checks #577

Merged

Conversation

pacospace
Copy link
Contributor

@pacospace pacospace commented Jan 22, 2021

Related Issues and Dependencies

Related-To: #529

This introduces a breaking change

  • Yes
  • No

This Pull Request implements

Introduce metrics specific to metrics exporter for exposing schema revision from script and from database
Introduce metrics for alarms regarding database revision sync with single components (list of components is not complete):

- 1 no match (alarm required)
- 0 match (component is safe)
- -1 error (maybe metrics are not available) (no alarm required)

Description

# HELP thoth_database_schema_revision_script Thoth database schema revision from script # TYPE thoth_database_schema_revision_script gauge 
thoth_database_schema_revision_script{component="metrics-exporter",revision="91620576525b"} 1.0

# HELP thoth_database_schema_revision_table Thoth database schema revision from database table. # TYPE thoth_database_schema_revision_table gauge 
thoth_database_schema_revision_table{component="metrics-exporter",revision="91620576525b"} 1.0

# HELP thoth_graph_db_component_revision_check Component script and database head revision check. # TYPE thoth_graph_db_component_revision_check gauge 
thoth_graph_db_component_revision_check{component="metrics-exporter"} 0.0 

thoth_graph_db_component_revision_check{component="user-api"} -1.0 

thoth_graph_db_component_revision_check{component="management-api"} -1.0 

thoth_graph_db_component_revision_check{component="investigator"} -1.0 

thoth_graph_db_component_revision_check{component="package-releases"} -1.0 

thoth_graph_db_component_revision_check{component="graph-refresh"} -1.0 

thoth_graph_db_component_revision_check{component="graph-sync"} 0.0

@sesheta sesheta added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 22, 2021
@pacospace pacospace changed the title Introduce revision metric checks Introduce database revision metric checks Jan 22, 2021
Copy link
Contributor

@fridex fridex left a comment

Choose a reason for hiding this comment

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

One minor question, otherwise LGTM! 👍

thoth/metrics_exporter/jobs/db.py Outdated Show resolved Hide resolved
@sesheta sesheta added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 22, 2021
Francesco Murdaca added 6 commits January 22, 2021 15:20
Signed-off-by: Francesco Murdaca <[email protected]>
Signed-off-by: Francesco Murdaca <[email protected]>
Signed-off-by: Francesco Murdaca <[email protected]>
Signed-off-by: Francesco Murdaca <[email protected]>
Signed-off-by: Francesco Murdaca <[email protected]>
Signed-off-by: Francesco Murdaca <[email protected]>
@pacospace pacospace force-pushed the introduce-revision-metric-checks branch from ab94132 to 0304879 Compare January 22, 2021 14:21
@sesheta sesheta added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 22, 2021
Signed-off-by: Francesco Murdaca <[email protected]>
@pacospace
Copy link
Contributor Author

Ready, PTAL! @fridex

Copy link
Contributor

@fridex fridex left a comment

Choose a reason for hiding this comment

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

Few cosmetic changes, otherwise LGTM! Nice job!! 👍

thoth/metrics_exporter/jobs/db.py Outdated Show resolved Hide resolved
thoth/metrics_exporter/jobs/db.py Outdated Show resolved Hide resolved
thoth/metrics_exporter/jobs/db.py Outdated Show resolved Hide resolved
thoth/metrics_exporter/jobs/db.py Outdated Show resolved Hide resolved
thoth/metrics_exporter/jobs/db.py Outdated Show resolved Hide resolved
Francesco Murdaca added 4 commits January 26, 2021 10:23
Signed-off-by: Francesco Murdaca <[email protected]>
Signed-off-by: Francesco Murdaca <[email protected]>
@codeclimate
Copy link

codeclimate bot commented Jan 26, 2021

Code Climate has analyzed commit 8b2b762 and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

@pacospace pacospace requested a review from fridex January 26, 2021 09:29
Copy link
Contributor

@fridex fridex left a comment

Choose a reason for hiding this comment

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

awesome, lgtm! 💯 👍

@sesheta
Copy link
Member

sesheta commented Jan 26, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fridex

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

@sesheta sesheta added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2021
@sesheta sesheta merged commit 75c2a00 into thoth-station:master Jan 26, 2021
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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants