Status

Marketplace
API
P2
normal
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: andym, Assigned: mat)

Tracking

Avenir
2014-01-14
x86
Mac OS X
Points:
---

Details

(Whiteboard: [qa-])

(Reporter)

Description

4 years ago
I'm not sure if all DRF views are outputting statsd timing. I hit this URL on my home page:

curl "http://z.mozilla.dev/api/v1/apps/category/?lang=en-US&region=us"

And got this:

20:27:03 statsd:INFO Increment: z.regions.middleware.source.url, 1, 1 :/Users/andy/.virtualenvs/zamboni/lib/python2.6/site-packages/django_statsd/clients/log.py:17
20:27:03 statsd:INFO Increment: z.mkt.dnt.unset, 1, 1 :/Users/andy/.virtualenvs/zamboni/lib/python2.6/site-packages/django_statsd/clients/log.py:17
20:27:03 statsd:INFO Increment: api.db.unpinned, 1, 1 :/Users/andy/.virtualenvs/zamboni/lib/python2.6/site-packages/django_statsd/clients/log.py:17
20:27:03 statsd:INFO Increment: response.200, 1, 1 :/Users/andy/.virtualenvs/zamboni/lib/python2.6/site-packages/django_statsd/clients/log.py:17

Tastypie URLs also emit an overall timing for the API like this (for api.fireplace.featured)

20:28:31 statsd:INFO Timing: api.fireplace.featured.GET, 83, 1 :/Users/andy/.virtualenvs/zamboni/lib/python2.6/site-packages/django_statsd/clients/log.py:13
20:28:31 statsd:INFO Timing: api.fireplace.GET, 83, 1 :/Users/andy/.virtualenvs/zamboni/lib/python2.6/site-packages/django_statsd/clients/log.py:13
20:28:31 statsd:INFO Timing: api.GET, 83, 1 :/Users/andy/.virtualenvs/zamboni/lib/python2.6/site-packages/django_statsd/clients/log.py:13

I think this is a useful feature. There is some timing middleware here:

https://github.com/mozilla/zamboni/blob/master/mkt/api/middleware.py#L171

...which is using the Tastypie timing middleware in django-statsd. That middleware is expecting view_kwargs in a certain Tastypie way, not getting them and silently failing. Perhaps we could do something in django-statsd for DRF as well?
(Assignee)

Updated

4 years ago
Priority: -- → P2
(Assignee)

Updated

4 years ago
Assignee: nobody → mpillard
(Assignee)

Comment 1

4 years ago
I submitted a PR to stop that middleware from silently failing: https://github.com/andymckay/django-statsd/pull/43

With that change, I get this:

16:39:22 statsd:INFO Timing: api.mkt.api.resources.CategoryViewSet.GET, 191, 1 :/home/mat/.virtualenvs/zamboni26/lib/python2.6/site-packages/django_statsd/clients/log.py:13
16:39:22 statsd:INFO Timing: api.mkt.api.resources.GET, 191, 1 :/home/mat/.virtualenvs/zamboni26/lib/python2.6/site-packages/django_statsd/clients/log.py:13
16:39:22 statsd:INFO Timing: api.GET, 191, 1 :/home/mat/.virtualenvs/zamboni26/lib/python2.6/site-packages/django_statsd/clients/log.py:13

Still need to check what happens with linked actions and stuff like that, but it's better than what we have now, so it's a good start. DRF doesn't have resource_name/api_name, and I don't think we need it, unless we want/need compatibility with the older stats. Do we?
(Reporter)

Comment 2

4 years ago
I wouldn't worry about backwards compatability, we can change the dashboards to use the new names: api.mkt.api.resources.CategoryViewSet.GET < looks good to me.
(Assignee)

Updated

4 years ago
Status: NEW → ASSIGNED
(Assignee)

Updated

4 years ago
Target Milestone: --- → 2014-01-07
(Assignee)

Comment 3

4 years ago
Fixed in https://github.com/mozilla/zamboni/commit/623830e52085360654492f36b1e2ed505b95b884

We need to change the dashboards now.
(Assignee)

Updated

4 years ago
Target Milestone: 2014-01-07 → 2014-01-14
(Assignee)

Comment 4

4 years ago
Dashboard fixed in https://github.com/mozilla/zamboni-dashboard/commit/cf10c3b0024de4ccabe14d732418ab083c698561
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.