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

Anomalies collector #10060

Merged
merged 57 commits into from Dec 2, 2020
Merged

Conversation

andrewm4894
Copy link
Contributor

Summary

ML based anomaly detection python collector built on top of PyOD.

Component Name

/collectors/python.d.plugin/anomalies

Test Plan
Additional Information

Additional details included in the README.md for the collector.

@github-actions github-actions bot added area/build Build system (autotools and cmake). area/collectors Everything related to data collection area/docs area/external/python area/web labels Oct 12, 2020
@ilyam8 ilyam8 marked this pull request as draft October 13, 2020 20:53
@ilyam8
Copy link
Member

ilyam8 commented Oct 13, 2020

@andrewm4894 i made it draft to make it clear it is wip

@andrewm4894
Copy link
Contributor Author

@andrewm4894 i made it draft to make it clear it is wip

Yep sorry, was a little trigger happy with the pr.

@andrewm4894 andrewm4894 marked this pull request as ready for review October 19, 2020 15:40
@thiagoftsm
Copy link
Contributor

Hey @andrewm4894 , please, take a look at here, it looks like something simple to fix.

@thiagoftsm
Copy link
Contributor

@andrewm4894 when I ran the command

# pip3 install requests netdata-pandas numba==0.50.1 scikit-learn pyod

I received the following warning:

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

netdata-pandas 0.0.23 requires requests==2.23.0, but you'll have requests 2.24.0 which is incompatible.

should we add an information related to this to our documentation?

@knatsakis knatsakis removed their request for review October 20, 2020 08:00
@andrewm4894
Copy link
Contributor Author

@andrewm4894 when I ran the command

# pip3 install requests netdata-pandas numba==0.50.1 scikit-learn pyod

I received the following warning:

ERROR: After October 2020 you may experience errors when installing or updating packages. This is because pip will change the way that it resolves dependency conflicts.

We recommend you use --use-feature=2020-resolver to test your packages with the new resolver before it becomes the default.

netdata-pandas 0.0.23 requires requests==2.23.0, but you'll have requests 2.24.0 which is incompatible.

should we add an information related to this to our documentation?

Thanks for that, I'll pin version ranges to the readme and/or add more flexible version ranges to netdata-pandas requirements too and that should cover this.

@vlvkobal
Copy link
Contributor

@andrewm4894 please do squash and force push. The PR is clattered with commits. I even can't open the page with commits.

@netdata netdata deleted a comment from lgtm-com bot Oct 20, 2020
@netdata netdata deleted a comment from lgtm-com bot Oct 20, 2020
@netdata netdata deleted a comment from lgtm-com bot Oct 20, 2020
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
ilyam8
ilyam8 previously approved these changes Dec 2, 2020
@ilyam8
Copy link
Member

ilyam8 commented Dec 2, 2020

@andrewm4894 i assume you have tested the collector and it works w/o problems/errors.

Code, makefiles ,etc looks good to me.

@andrewm4894
Copy link
Contributor Author

@andrewm4894 i assume you have tested the collector and it works w/o problems/errors.

Code, makefiles ,etc looks good to me.

Yep, have been running it for last few weeks on some of my nodes.

vlvkobal
vlvkobal previously approved these changes Dec 2, 2020
@vlvkobal vlvkobal self-requested a review December 2, 2020 15:38
@vlvkobal
Copy link
Contributor

vlvkobal commented Dec 2, 2020

2020-12-02 15:37:53: python.d WARNING: plugin[main] : [anomalies] error on loading source : SyntaxError('invalid syntax', ('/usr/libexec/netdata/python.d/anomalies.chart.py', 82, 139, "        self.charts_in_scope = list(filter(self.charts_regex.match, [c for c in requests.get(f'{self.protocol}://{self.host}/api/v1/charts').json()['charts'].keys()]))\n")), skipping it
2020-12-02 15:37:53: python.d INFO: plugin[main] : no jobs to run

@andrewm4894
Copy link
Contributor Author

2020-12-02 15:37:53: python.d WARNING: plugin[main] : [anomalies] error on loading source : SyntaxError('invalid syntax', ('/usr/libexec/netdata/python.d/anomalies.chart.py', 82, 139, "        self.charts_in_scope = list(filter(self.charts_regex.match, [c for c in requests.get(f'{self.protocol}://{self.host}/api/v1/charts').json()['charts'].keys()]))\n")), skipping it
2020-12-02 15:37:53: python.d INFO: plugin[main] : no jobs to run

Hmm - is that the f-string breaking a lower version of python perhaps?

@ilyam8
Copy link
Member

ilyam8 commented Dec 2, 2020

Hmm - is that the f-string breaking a lower version of python perhaps?

It was added relatively recently, so likely it is

@andrewm4894
Copy link
Contributor Author

Hmm - is that the f-string breaking a lower version of python perhaps?

It was added relatively recently, so likely it is

I think would be better for me to replace all f strings as this would break anyone <3.6 which i guess is not great.

@vlvkobal
Copy link
Contributor

vlvkobal commented Dec 2, 2020

netdata@ubuntu-20-04:/home/vlad/test/netdata$ python3 --version
Python 3.8.5

@andrewm4894 andrewm4894 dismissed stale reviews from vlvkobal and ilyam8 via 524e2aa December 2, 2020 16:46
@andrewm4894
Copy link
Contributor Author

netdata@ubuntu-20-04:/home/vlad/test/netdata$ python3 --version
Python 3.8.5

I have broken out the offending line onto two separate lines. No idea what it might be assuming 3.8.5. I will try and make a test machine using ubunutu 20 04 and 3.8.5 to see if i can recreate

@andrewm4894
Copy link
Contributor Author

I created a ubuntu-2004-focal-v20201201 e2-medium (2 vCPUs, 4 GB memory) instance on GCP and installed and configured the collector and it is working for me so not sure what might be going on with that error.

@andrewm4894 andrewm4894 merged commit 9dda12c into netdata:master Dec 2, 2020
@netdata-community-bot
Copy link

This pull request has been mentioned on Netdata Community. There might be relevant details there:

https://community.netdata.cloud/t/collector-anomalies-error-on-loading-source/581/4

@andrewm4894 andrewm4894 deleted the anomalies-collector branch January 6, 2021 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Build system (autotools and cmake). area/collectors Everything related to data collection area/docs area/health area/web
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants