YahooArchive / mojito

[archiving soon] Yahoo! Mojito Framework
BSD 3-Clause "New" or "Revised" License
1.57k stars 214 forks source link

Can the tunnel path be modified and can parameters be appended? #979

Closed aljimenez closed 11 years ago

aljimenez commented 11 years ago

Currently the /tunnel call's path cannot be modified. We need to be able to modify the path and add URL parameters.

rwaldura commented 11 years ago

tunnelPrefix lets you change the URL. http://developer.yahoo.com/cocktails/mojito/docs/intro/mojito_configuring.html

Where/when would parameters get appended? On every call?

drewfish commented 11 years ago

What kind of parameters do you want to add? Are they fixed values, or do they come from code?

Basically, what is the high-level reason for these parameters?

(I'm open to the idea, but want to understand the underlying usecase/reason/issue.)

aljimenez commented 11 years ago

We need to be able to modify the tunnel path and add parameters every time that mojitProxy.invoke is called. This is important to us specifically because we append tokens to the path for tracking purposes and need to distinguish between bucket tests using parameters. And so if we could modify /tunnel to something like /mytunnel;trackId=123?bucket=abc, we would be able to track the request and make sure the right bucket responds.

caridy commented 11 years ago

for the trackId, either regular ult or "pageview-candidate" (a la comscore) makes sense because they will be consumed by external platforms during or after the requests gets to mojito, so I agree with adding support for that. For the bucket, I'm not so sure this is the right place. A tunnel is a POST request with a big payload, and adding parameters to it can complicate things, on top of that, the bucket should/will be attached to the request/headers before hitting mojito dispatcher (by a middleware or my a layer in front of the FE boxes), in which case you should not need to pass it around.

rwaldura commented 11 years ago

@aljimenez any comments, or update?

jlecomte commented 11 years ago

Just reiterating what we need: on each mojitProxy.invoke calls, we want to be able to programmatically (i.e. using dynamic values) set the entire URI used in the /tunnel call. Just as an example, in our specific case, a call could look like:

/tunnel;_ylt=A0oGdV8GMC1RcBgAQNhXNyoA;_ylu=X3oDMTE5aWhtbjdhBHNlYwNvdi10b3AEY29sbwNzazEEdnRpZANTTUUwNDFfMTU0BHBvcwMx?tmpl=USN002

The next /tunnel call would look like:

/tunnel;_ylt=A0oGdV8GMC1RcBgAathXNyoA;_ylu=X3oDMTE1ZmMwa2RqBHNlYwNzcgRwb3MDMQRjb2xvA3NrMQR2dGlkA1NNRTA0MV8xNTQ-?tmpl=USN002

Let me know if any of this makes sense.

caridy commented 11 years ago

Yeah, that part is clear, but it does not answer my previous question. Why do we need tmpl? it is the same in both requests, which makes me think it belongs to the context rather than just a querystring parameter.

jlecomte commented 11 years ago

The exact reason of why we need that parameter is complicated to explain and not very relevant to this discussion. I can explain it to you offline. It has to do mostly with other parts of our infrastructure.

jenny commented 11 years ago

https://trello.com/card/gh979-search-tunnel-params-mid-march/504e5e3b7cd1578456fc430f/415

caridy commented 11 years ago

@jlecomte one last question: Does this custom tunnel url is defined per req? per page? per mojit?

In the current implementation, the tunnel req url is defined per app, which means it is static, all requests and pages and mojits will use the same thing, but it seems to me that the tracking information you want to add is per mojit (the _ylt section) and per page (the tmpl section). Can you clarify?

isao commented 11 years ago

closed by pull #1044 (see also https://github.com/yahoo/mojito/wiki/ReleaseNotes0_5_7)

ekashida commented 11 years ago

@aljimenez, feel free to ping me if you need more details around how to configure and handle custom tunnel URLs.