Say you want to capture analytics across a user's API lifecycle, for all their API usage, etc.
This is easily achieved using [Analytics Tags][0].
Determine what is the "unique" user ID you want to aggregate requests by.
apiVersion: tyk.tyk.io/v1alpha1 | |
kind: ApiDefinition | |
metadata: | |
name: httpbin | |
spec: | |
name: httpbin | |
use_keyless: true | |
protocol: http | |
active: true | |
do_not_track: false |
Summary: | |
Total: 10.0702 secs | |
Slowest: 0.2772 secs | |
Fastest: 0.0246 secs | |
Average: 0.0763 secs | |
Requests/sec: 652.1213 | |
Total data: 97283538 bytes | |
Size/request: 14814 bytes |
{ | |
"id": "6107fd00c957f10001ce7b7d", | |
"name": "GraphQL posts v2", | |
"slug": "graphql-posts-v2", | |
"listen_port": 0, | |
"protocol": "", | |
"enable_proxy_protocol": false, | |
"api_id": "c3ce4a87d0eb472761fbf565af80a634", | |
"org_id": "5e9d9544a1dcd60001d0ed20", | |
"use_keyless": true, |
package main | |
import ( | |
"encoding/base64" | |
"net/http" | |
"github.com/TykTechnologies/tyk/ctx" | |
) | |
func SetSessionPublicKeyVerifier(rw http.ResponseWriter, r *http.Request) { |
{ | |
"id": "60cb42a740135800017b2f51", | |
"name": "grpc", | |
"slug": "grpc", | |
"listen_port": 0, | |
"protocol": "", | |
"enable_proxy_protocol": false, | |
"api_id": "b99f0fe7a83e46627e018491fa344bc5", | |
"org_id": "5e9d9544a1dcd60001d0ed20", | |
"use_keyless": true, |
{ | |
"name": "Tyk Test API", | |
"api_id": "1", | |
"org_id": "default", | |
"auth": {}, | |
"use_keyless": true, | |
"version_data": { | |
"not_versioned": true, | |
"versions": { | |
"Default": { |
{ | |
"name": "Tyk Test API", | |
"api_id": "1", | |
"org_id": "default", | |
"definition": { | |
"location": "header", | |
"key": "version" | |
}, | |
"auth": { | |
"auth_header_name": "authorization" |
{ | |
"name": "Tyk Test API", | |
"api_id": "1", | |
"org_id": "default", | |
"definition": { | |
"location": "header", | |
"key": "version" | |
}, | |
"auth": { | |
"auth_header_name": "authorization" |