-
Notifications
You must be signed in to change notification settings - Fork 331
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
Add search metrics support #989
Conversation
I'm able to get the DEV environment running with an Influx container. Had to rebuild my Wondering if we should add a This is looking good! |
galaxy/api/views/search.py
Outdated
@@ -33,6 +33,7 @@ | |||
from galaxy.api import filters | |||
from galaxy.api import serializers | |||
from galaxy.api.views import base_views as base | |||
from galaxy.common.metricsutils import galaxy_send_metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Maybe calling module just
metrics
would be more readable? - Please use module import instead of class \ function import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
galaxy/common/metricsutils.py
Outdated
logger = logging.getLogger(__name__) | ||
|
||
|
||
def galaxy_send_metrics(func_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't use project name in function or class names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking behind this was to make clear that the decorator is not Django related, but I have zero Django experience, so I'll change it 😄
galaxy/common/metricsutils.py
Outdated
return client | ||
|
||
|
||
def search(request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is utility function please don't use request as a parameter. It should be context independent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
173bc4a
to
3b18472
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM,
Please when you're ready split it to granular PR's, so that it is easier to review and merge.
This looks good to me. Really nice job! IMHO, no need to break this into smaller PRs. I think what you have here fits together nicely, and is not too big. One last thing, can you please update the CONTRIBUTING.rst file with the following:
|
785b1c1
to
bf66db3
Compare
@chouseknecht @cutwater ok, |
bf66db3
to
7975018
Compare
7975018
to
0623ae6
Compare
This adds support for search metrics for Ansible Galaxy. InfluxDB, Grafana and Prometheus containers are added to the dev environment.
Related to #756 and #881.
How to test this:
The PR adds a new requirement in
requirements.txt
so your dev environment needs to be rebuilt:$ make dev/up
This sets up InfluxDB, adds it as a data resource into Grafana and imports dashboard:
$ make dev/setup-metrics
Search for stuff in Galaxy.
Log into Grafana at
http://localhost:3000
, login:admin
, password:admin
.Navigate to
Galaxy Search Metrics - InfluxDB
andGalaxy Search Metrics - Prometheus
dashboards.