-
Notifications
You must be signed in to change notification settings - Fork 336
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
fixed week/ endpoint that is not used on staging #10927
fixed week/ endpoint that is not used on staging #10927
Conversation
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.
Overall looks good
'field': 'pageview_info.referer_domain', | ||
'field': 'pageview_info.referer_domain.keyword', | ||
'size': 10, | ||
}, | ||
}, | ||
'popular-pages': { | ||
'terms': { | ||
'field': 'pageview_info.page_path', | ||
'field': 'pageview_info.page_path.keyword', | ||
'size': 10, | ||
}, | ||
'aggs': { | ||
'route-for-path': { | ||
'terms': { | ||
'field': 'pageview_info.route_name', | ||
'field': 'pageview_info.route_name.keyword', | ||
'size': 1, | ||
}, | ||
}, | ||
'title-for-path': { | ||
'terms': { | ||
'field': 'pageview_info.page_title', | ||
'field': 'pageview_info.page_title.keyword', |
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.
hmm... i worry this will break when deployed (and it isn't currently broken on prod or on staging)
referer_domain
, page_path
, route_name
, and page_title
should already be mapped as keyword fields -- this fix seems to indicate your local indexes were created using dynamic mapping (where text values automatically get a text field with .keyword
subfield) instead of using the template that should have been created by manage.py sync_metrics
quick fix (if you're ok with losing data) might be to delete your osf_countedauthusage*
indexes and run manage.py sync_metrics
before adding more data
(ideally you'd get a warning or error trying to save metrics without up-to-date index templates, but osf-metrics doesn't have those safety rails...)
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.
I see, it means we just don't do a request to this endpoint on the frontend side (because analytics never loads)
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.
looks like we do -- your screenshot on staging is for a private project ("Analytics are not available for private projects.") but on this public project analytics page i'm seeing a GET /_/metrics/query/node_analytics/a3rz4/week/
and charts loading
Purpose
Throughout the onboarding I got 500 error on _/metrics/query/node_analytics/m8dwk/week/ endpoint but not on staging.
Error I got before fix:
Appropriate screenshot
After the fix at the bottom of this PR I was able to fix it
Locally (fixed):
Staging (https://staging.osf.io/g78bt/analytics):
It appears that on staging we don't make a request to that endpoint at all, thus analytics is never loaded, so potentially we may have the same issue on the staging
Changes
We had to add ".keyword" to each text field