Back to Pinpoint

User-specified HTTP headers

agent-module/agent-plugins/proxy-user/README.md

3.0.52.3 KB
Original Source

Monitoring User Specified HTTP Headers

  • Since: Pinpoint 2.3.0

Pinpoint Configuration

pinpoint.config

HTTP headers option.

# User-specified HTTP headers
# Supports apache and nginx formats.
# e.g. profiler.proxy.http.headers=X-Trace, X-Request, X-ApacheLB, X-SSL-nginx
profiler.proxy.http.headers=

Apache HTTP Server

Add HTTP header.

text
X-ApacheLB: t=991424704447256 D=3775428

e.g.

httpd.conf

text
<IfModule mod_jk.c>
...
RequestHeader set X-ApacheLB "%t %D"
...
</IfModule>

%t is required value.

Nginx

Add HTTP header.

text
X-SSL-nginx: t=1504248328.423 D=0.123

e.g.

nginx.conf

text
...
  server {
        listen       9080;
        server_name  localhost;

        location / {
            ...
            set $pinpoint_proxy_header "t=$msec D=$request_time";
            proxy_set_header X-SSL-nginx $pinpoint_proxy_header;
        }
  }
...

or

text
http {
...

    proxy_set_header X-SSL-nginx t=$msec;

...
}

t=$msec is required value.

Mobile app

Add HTTP header.

# If profile.proxy.http.headers=x-trace setting
x-trace: t=1670487808091 d=3775428 
  • t: The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT)
    • required
  • d: duration time microseconds
    • optional

System flow


         +-----------+       +--------------+       +------------------+
         |   Mobile  | ----> |   Unknown    | ----> |        WAS       |
         |    App    |       +   Gateway    |       + (pinpoint agent) |
         +-----------+       +--------------+       +------------------+
               |                                            |
               |                                      +--------------+
               + -----------------------------------> | elapsed time |
                                                      +--------------+