criteo / haproxy-spoe-go

An implementation of the SPOP protocol in Go. https://www.haproxy.org/download/2.0/doc/SPOE.txt
Apache License 2.0
28 stars 14 forks source link

Correlate request and response messages #33

Closed robjkc closed 1 year ago

robjkc commented 3 years ago

Is it possible to correlate the request and response messages that are received by the agent code? In another go spoe library there was a StreamID that I had access to which seemed to be the same for the request and response messages. It doesn't seem that I have access to that StreamID though. I need something to correlate the request/response so I can generate a database record of the call from a client. Below is my agent config. Thanks again!

[hello-agent]
spoe-agent hello-agent
    messages hello-request hello-response
    option var-prefix hello
    timeout hello 2s
    timeout idle  2m
    timeout processing 10ms
    use-backend hello-agents
    log global

spoe-message hello-request
    args ip=src body=req.body uri=capture.req.uri url=url method=capture.req.method ver=capture.req.ver host=req.hdr(Host)
    event on-frontend-http-request

spoe-message hello-response
    args body=res.body status=status
    event on-http-response
robjkc commented 3 years ago

I was able to generate the unique id that I can correlate the request and response by placing the following in my haproxy.cfg

frontend my_frontend
    unique-id-format %[uuid()]

Then in my spoe-message blocks I added this:

spoe-message hello-request
args uid=unique-id ...

spoe-message hello-response
args uid=unique-id ...
mougams commented 1 year ago

As mentioned in https://github.com/criteo/haproxy-spoe-go/issues/40#issuecomment-1795136138, we're dropping support on the project, and archiving it.