aicoe-aiops / time-series

A repository showing example analysis of time series data.
Other
5 stars 8 forks source link

Add fetching metrics notebook #4

Closed Shreyanand closed 3 years ago

Shreyanand commented 3 years ago

Related Issues and Dependencies

2

This introduces a breaking change

This Pull Request implements

This pull request adds the first notebook that describes how to fetch metrics from a Prometheus instance and create a dataframe for analysis.

review-notebook-app[bot] commented 3 years ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

sesheta commented 3 years ago
Pre-Commit Test failed! Click here ``` [INFO] Initializing environment for git://github.com/Lucas-C/pre-commit-hooks. [INFO] Initializing environment for git://github.com/pre-commit/pre-commit-hooks. [INFO] Initializing environment for git://github.com/pycqa/pydocstyle.git. [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Initializing environment for https://github.com/pre-commit/mirrors-mypy. [INFO] Initializing environment for https://github.com/psf/black. [INFO] Initializing environment for https://github.com/tomcatling/black-nb. [INFO] Initializing environment for https://github.com/s-weigand/flake8-nb. [INFO] Initializing environment for https://github.com/s-weigand/flake8-nb:pep8-naming. [INFO] Installing environment for git://github.com/Lucas-C/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for git://github.com/pre-commit/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for git://github.com/pycqa/pydocstyle.git. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/pre-commit/mirrors-mypy. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/psf/black. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/tomcatling/black-nb. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/s-weigand/flake8-nb. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... Tabs remover.............................................................Passed Trim Trailing Whitespace.................................................Passed Check for merge conflicts................................................Passed Fix End of Files.........................................................Passed Tests should end in _test.py.........................(no files to check)Skipped Check for added large files..............................................Passed check BOM - deprecated: use fix-byte-order-marker........................Passed Check for case conflicts.................................................Passed Check docstring is first.................................................Passed Check JSON...............................................................Passed Check for broken symlinks............................(no files to check)Skipped Detect Private Key.......................................................Passed Check python ast.........................................................Passed Debug Statements (Python)................................................Passed pydocstyle...............................................................Passed Check Toml...............................................................Passed Check Yaml...............................................................Passed Fix End of Files.........................................................Passed Trim Trailing Whitespace.................................................Passed mypy.....................................................................Passed black....................................................................Passed black-nb.................................................................Failed - hook id: black-nb - files were modified by this hook reformatted notebooks/fetching-metrics.ipynb 5 cells reformatted, 5 cells left unchanged. All done! 1 file reformatted. flake8-nb................................................................Failed - hook id: flake8-nb - exit code: 1 notebooks/fetching-metrics.ipynb#In[ ]:4:1: E402 module level import not at top of file notebooks/fetching-metrics.ipynb#In[ ]:5:1: E402 module level import not at top of file notebooks/fetching-metrics.ipynb#In[ ]:6:1: E402 module level import not at top of file notebooks/fetching-metrics.ipynb#In[ ]:7:1: E402 module level import not at top of file notebooks/fetching-metrics.ipynb#In[ ]:8:1: E402 module level import not at top of file notebooks/fetching-metrics.ipynb#In[ ]:9:1: E402 module level import not at top of file notebooks/fetching-metrics.ipynb#In[ ]:9:1: F401 'os' imported but unused notebooks/fetching-metrics.ipynb#In[ ]:11:1: E402 module level import not at top of file notebooks/fetching-metrics.ipynb#In[ ]:11:1: F401 'matplotlib.pyplot as plt' imported but unused ```
4n4nd commented 3 years ago

@Shreyanand Can you fix the pre-commit errors? Otherwise LGTM :+1:

4n4nd commented 3 years ago

Also, there is a notebook in the api client project repo which is similar to this one. Should we add the MetricRange and MetricSnapshot content there as well?

Shreyanand commented 3 years ago

@Shreyanand Can you fix the pre-commit errors? Otherwise LGTM

Sure! E402 module level import not at top of file what is this expecting? Do imports need to be on the first line of the cell? Or before markdowns?

chauhankaranraj commented 3 years ago

@Shreyanand looks great! Left a small suggestion :)

Shreyanand commented 3 years ago

@Shreyanand Can you fix the pre-commit errors? Otherwise LGTM

Sure! E402 module level import not at top of file what is this expecting? Do imports need to be on the first line of the cell? Or before markdowns?

For transparency: Checked it locally, turns out that you can't put anything before import statements. Not even !pip install commands.

Shreyanand commented 3 years ago

/retest

4n4nd commented 3 years ago

/retest

sesheta commented 3 years ago

Hi @4n4nd Unauthorised to run /retest command.

tumido commented 3 years ago

/retest

4n4nd commented 3 years ago

/approve

Shreyanand commented 3 years ago

/retest

why didn't it work when I commented? In other news, I got ignored by a bot :laughing:

tumido commented 3 years ago

what about me?

/approve

tumido commented 3 years ago

@Shreyanand I have no idea. It ignored me for some time as well.. :smile:

tumido commented 3 years ago

And I'm not waiting for the approve label.. Let's merge it. :smile: