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

fix parsing logic and rule before pushing to grafana #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bubblemans
Copy link
Contributor

@bubblemans bubblemans commented Apr 25, 2021

Description

  1. When grafana queried a time range that contained any time period during postmortem failure, grafana would not render any other data points.

For example, if I would like to see the metrics from 2021/4/21 to 2021/4/23 while our postmortem failure starts from 2021/4/22 to 2021/4/23, no data would be displayed even though there exists data on 2021/4/21.

  1. All metrics will be 0 if any metric is not found in the log file based on the current logic in grafana.py. However, we only want that metric to be 0 and proceed with others with their real values.

Current logic

in log file:
CPU: 1.0
Disk: 50%
Memory: 20%
Temperature: null
->
in grafana
CPU: 0
Disk: 0
Memory: 0
Temperature: 0

Expected logic

in log file:
CPU: 1.0
Disk: 50%
Memory: 20%
Temperature: null
->
in grafana
CPU: 1.0
Disk: 50%
Memory: 20%
Temperature: 0

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  1. python3 grafana.py [log path]
  2. read the dashboard http://172.27.5.128:3000/d/8kjbZtXGk/eureka-pi-monitoring?orgId=1&from=now-7d&to=now

When the service is down, the data should be 0. When the service is up, there should be real data regardless the service is down within the query range or not.

Screen Shot 2021-04-25 at 8 26 03 PM

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@bubblemans bubblemans requested a review from breed April 25, 2021 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant