Milimetric has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/245887

Change subject: [WIP] Add a public endpoint for AQS
......................................................................

[WIP] Add a public endpoint for AQS

TODO: how do we move this to /metrics without making breaking
changes in specs/analytics/v1/pageviews.yaml?

AQS, the Analytics Query Service, is now configured to respond to
requests from the new wikimedia.org global RESTBase domain.

Bug: T114830
Change-Id: Iaaf6ebd659ba3661ae45a8225cd87bbfb8d827b5
---
M hieradata/role/common/restbase.yaml
M modules/restbase/manifests/init.pp
M modules/restbase/templates/config.yaml.erb
3 files changed, 21 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/87/245887/1

diff --git a/hieradata/role/common/restbase.yaml 
b/hieradata/role/common/restbase.yaml
index 0ce6c75..30293d6 100644
--- a/hieradata/role/common/restbase.yaml
+++ b/hieradata/role/common/restbase.yaml
@@ -13,6 +13,7 @@
 restbase::graphoid_uri: http://graphoid.svc.eqiad.wmnet:19000
 restbase::mobileapps_uri: http://mobileapps.svc.eqiad.wmnet:8888
 restbase::mathoid_uri: http://mathoid.svc.eqiad.wmnet:10042
+restbase::aqs_uri: http://aqs.svc.eqiad.wmnet:7231/analytics.wikimedia.org/v1
 restbase::cassandra_user: restbase
 restbase::cassandra_password: "%{passwords::cassandra::restbase}"
 
diff --git a/modules/restbase/manifests/init.pp 
b/modules/restbase/manifests/init.pp
index 3c6b85d..2976a96 100644
--- a/modules/restbase/manifests/init.pp
+++ b/modules/restbase/manifests/init.pp
@@ -42,6 +42,8 @@
 #   MobileApps service URI. Default: http://mobileapps.svc.eqiad.wmnet:8888
 # [*mathoid_uri*]
 #   Mathoid service URI. Default: http://mathoid.svc.eqiad.wmnet:10042
+# [*aqs_uri*]
+#   Analytics Query service URI. Default: 
http://aqs.svc.eqiad.wmnet:7231/analytics.wikimedia.org/v1
 #
 class restbase(
     $cassandra_user = 'cassandra',
@@ -63,6 +65,7 @@
     $graphoid_uri   = 'http://graphoid.svc.eqiad.wmnet:19000',
     $mobileapps_uri = 'http://mobileapps.svc.eqiad.wmnet:8888',
     $mathoid_uri    = 'http://mathoid.svc.eqiad.wmnet:10042',
+    $aqs_uri        = 
'http://aqs.svc.eqiad.wmnet:7231/analytics.wikimedia.org/v1',
 ) {
     if $::realm == 'labs' {
         include restbase::deploy
diff --git a/modules/restbase/templates/config.yaml.erb 
b/modules/restbase/templates/config.yaml.erb
index 84c3d24..f787425 100644
--- a/modules/restbase/templates/config.yaml.erb
+++ b/modules/restbase/templates/config.yaml.erb
@@ -62,6 +62,7 @@
           - <%= @graphoid_uri %>
           - <%= @mobileapps_uri %>
           - <%= @mathoid_uri %>
+          - <%= @aqs_uri %>
       header_match:
         description: Checks client ip against one of the predefined whitelists
         x-error-message: This client is not allowed to use the endpoint
@@ -218,6 +219,7 @@
     securityDefinitions: *wp/content-security/1.0.0
     x-subspecs:
       - media/v1/mathoid
+      - analytics/v1/pageviews
 
 
   global-sys: &gb/sys/1.0.0
@@ -309,6 +311,21 @@
                   status: 200
                   headers: 
'{$$.merge($.mathoid.body[$.request.params.format].headers,$$.merge($.mathoid.headers,
 {"x-resource-location": $.request.headers.x-resource-location}))}'
                   body: '{$.mathoid.body[$.request.params.format].body}'
+      
/{module:pageviews}/per-article/{project}/{access}/{agent}/{article}/{granularity}/{start}/{end}:
+        x-request-handler:
+          - get_from_aqs:
+              request:
+                uri: <%= @aqs_uri 
%>/pageviews/per-article/{project}/{access}/{agent}/{article}/{granularity}/{start}/{end}
+      
/{module:pageviews}/per-project/{project}/{access}/{agent}/{granularity}/{start}/{end}:
+        x-request-handler:
+          - get_from_aqs:
+              request:
+                uri: <%= @aqs_uri 
%>/pageviews/per-project/{project}/{access}/{agent}/{granularity}/{start}/{end}:
+      /{module:pageviews}/top/{project}/{access}/{year}/{month}/{day}:
+        x-request-handler:
+          - get_from_aqs:
+              request:
+                uri: <%= @aqs_uri 
%>/pageviews/top/{project}/{access}/{year}/{month}/{day}:
 
 
   wp-default-1.0.0: &wp/default/1.0.0

-- 
To view, visit https://gerrit.wikimedia.org/r/245887
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaaf6ebd659ba3661ae45a8225cd87bbfb8d827b5
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Milimetric <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to