Tyk Analytics Record Fields

Last updated: 3 minutes read.

Below is a detailed list of each field contained within our Tyk Analytics Record that is sent from Tyk Pump.

Method

Request method.

Example: GET, POST.

Host

Request Host header.

Remarks: Includes host and optional port number of the server to which the request was sent. Example: tyk.io, or tyk.io:8080 if port is included.

Path

Request path.

Remarks: Displayed in decoded form.
Example: /foo/bar for /foo%2Fbar or /foo/bar.

RawPath

Request path.

Remarks: Original request path without changes just decoded.
Example: /foo/bar for /foo%2Fbar or /foo/bar.

ContentLength

Request Content-Length header.

Remarks: The number of bytes in the request body.
Example: 10 for request body 0123456789.

UserAgent

Request User-Agent header.

Example: curl/7.86.0.

Day

Request day.

Remarks: Based on TimeStamp field.
Example: 16 for 2022-11-16T03:01:54Z.

Month

Request month.

Remarks: Based on TimeStamp field.
Example: 11 for 2022-11-16T03:01:54Z.

Year

Request year.

Remarks: Based on TimeStamp field. Example: 2022 for 2022-11-16T03:01:54Z.

Hour

Request hour.

Remarks: Based on TimeStamp field.
Example: 3 for 2022-11-16T03:01:54Z.

ResponseCode

Response code.

Remarks: Only contains the integer element of the response code. Can be generated by either the gateway or upstream server, depending on how the request is handled.
Example: 200 for 200 OK.

APIKey

Request authentication key.

Remarks: OAuthentication key, as provided in request. If no API key is provided then gateway will substitute a default value.
Example: Unhashed auth_key, hashed 6129dc1e8b64c6b4, or 00000000 if no authentication provided.

TimeStamp

Request timestamp.

Remarks: Generated by the gateway, based on the time it receives the request from the client.
Example: 2022-11-16T03:01:54.648+00:00.

APIVersion

Version of API Definition requested.

Remarks: Based on version configuration of context API definition. If API is unversioned then value is “Not Versioned”.
Example: Could be an alphanumeric value such as 1 or b. Is Not Versioned if not versioned.

APIName

Name of API Definition requested.

Example: Foo API.

APIID

Id of API Definition requested.

Example: 727dad853a8a45f64ab981154d1ffdad.

OrgID

Organisation Id of API Definition requested.

Example: 5e9d9544a1dcd60001d0ed20.

OauthID

Id of OAuth client.

Remarks: Value is empty string if not using OAuth, or OAuth client not present.
Example: my-oauth-client-id.

RequestTime

Duration of upstream roundtrip.

Remarks: Equal to value of Latency.Total field. Example: 3 for a 3ms roundtrip.

RawRequest

Raw HTTP request.

Remarks: Base64 encoded copy of the request sent from the gateway to the upstream server.
Example: R0VUIC9nZXQgSFRUUC8xLjEKSG9zdDogdHlrLmlv.

RawResponse

Raw HTTP response.

Remarks: Base64 encoded copy of the response sent from the gateway to the client.
Example: SFRUUC8xLjEgMjAwIE9LCkNvbnRlbnQtTGVuZ3RoOiAxOQpEYXRlOiBXZWQsIDE2IE5vdiAyMDIyIDA2OjIxOjE2IEdNVApTZXJ2ZXI6IGd1bmljb3JuLzE5LjkuMAoKewogICJmb28iOiAiYmFyIgp9Cg==.

IPAddress

Client IP address.

Remarks: Taken from either X-Real-IP or X-Forwarded-For request headers, if set. Otherwise, determined by gateway based on request.
Example: 172.18.0.1.

Geo

Client geolocation data.

Remarks: Calculated using MaxMind database, based on client IP address.
Example: {"country":{"isocode":"SG"},"city":{"geonameid":0,"names":{}},"location":{"latitude":0,"longitude":0,"timezone":""}}.

Network

Network statistics.

Remarks: Not currently used.

Latency

Latency statistics

Remarks: Contains two fields; upstream is the roundtrip duration between the gateway sending the request to the upstream server and it receiving a response. total is the upstream value plus additional gateway-side functionality such as processing analytics data.
Example: {"total":3,"upstream":3}.

Note

We record the round trip time of the call from the gateways reverse proxy. So what you get is the sum of leaving Tyk -> upstream -> response received back at Tyk.

Tags

Session context tags.

Remarks: Can contain many tags which refer to many things, such as the gateway, API key, organisation, API definition etc.
Example: ["key-00000000","org-5e9d9544a1dcd60001d0ed20","api-accbdd1b89e84ec97f4f16d4e3197d5c"].

Alias

Session alias.

Remarks: Alias of the context authenticated identity. Blank if no alias set or request is unauthenticated.
Example: my-key-alias.

TrackPath

Tracked endpoint flag.

Remarks: Value is true if the requested endpoint is configured to be tracked, otherwise false.
Example: true or false.

ExpireAt

Future expiry date.

Remarks: Can be used to implement automated data expiry, if supported by storage.
Example: 2022-11-23T07:26:25.762+00:00.