MCPcopy Index your code
hub / github.com/TykTechnologies/tyk-pump

github.com/TykTechnologies/tyk-pump @v1.15.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.15.0 ↗ · + Follow
1,296 symbols 4,135 edges 108 files 213 documented · 16% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Tyk Pump

Build Status

Tyk Pump is a pluggable analytics purger to move Analytics generated by your Tyk nodes to any back-end.

Table of Contents

Tyk Analytics Schema

The table below provides details on the fields within each tyk_analytics record.

Analytics Data Field Description Remarks Example
Method Request method GET, POST
Host Request Host header Includes host and optional port number of the server to which the request was sent. tyk.io, or tyk.io:8080 if port is included
Path Request path Displayed in decoded form. /foo/bar for /foo%2Fbar or /foo/bar
RawPath Request path Same value as Path. Does not provide the raw encoded path. /foo/bar for /foo%2Fbar or /foo/bar
ContentLength Request Content-Length header The number of bytes in the request body. 10 for request body 0123456789
UserAgent Request User-Agent header curl/7.86.0
Day Request day Based on TimeStamp field. 16 for 2022-11-16T03:01:54Z
Month Request month Based on TimeStamp field. 11 for 2022-11-16T03:01:54Z
Year Request year Based on TimeStamp field. 2022 for 2022-11-16T03:01:54Z
Hour Request hour Based on TimeStamp field. 3 for 2022-11-16T03:01:54Z
ResponseCode Response code 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. 200 for 200 OK
APIKey Request authentication key Authentication key, as provided in request. If no API key is provided then gateway will substitute a default value. Unhashed auth_key, hashed 6129dc1e8b64c6b4, or 00000000 if no authentication provided.
TimeStamp Request timestamp Generated by the gateway, based on the time it receives the request from the client. 2022-11-16T03:01:54.648+00:00
APIVersion Version of API Definition requested Based on version configuration of context API definition. If API is unversioned then value is "Not Versioned". Could be an alphanumeric value such as 1 or b. Is Not Versioned if not versioned.
APIName Name of API Definition requested Foo API
APIID Id of API Definition requested 727dad853a8a45f64ab981154d1ffdad
OrgID Organisation Id of API Definition requested 5e9d9544a1dcd60001d0ed20
OauthID Id of OAuth client Value is empty string if not using OAuth, or OAuth client not present. my-oauth-client-id
RequestTime Duration of upstream roundtrip Equal to value of Latency.Total field. 3 for a 3ms roundtrip
RawRequest Raw HTTP request Base64 encoded copy of the request sent from the gateway to the upstream server. R0VUIC9nZXQgSFRUUC8xLjEKSG9zdDogdHlrLmlv
RawResponse Raw HTTP response Base64 encoded copy of the response sent from the gateway to the client. SFRUUC8xLjEgMjAwIE9LCkNvbnRlbnQtTGVuZ3RoOiAxOQpEYXRlOiBXZWQsIDE2IE5vdiAyMDIyIDA2OjIxOjE2IEdNVApTZXJ2ZXI6IGd1bmljb3JuLzE5LjkuMAoKewogICJmb28iOiAiYmFyIgp9Cg==
IPAddress Client IP address Taken from either X-Real-IP or X-Forwarded-For request headers, if set. Otherwise, determined by gateway based on request. 172.18.0.1
Geo Client geolocation data Calculated using MaxMind database, based on client IP address. {"country":{"isocode":"SG"},"city":{"geonameid":0,"names":{}},"location":{"latitude":0,"longitude":0,"timezone":""}}
Network Network statistics Not currently used. N/A
Latency Latency statistics 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. {"total":3,"upstream":3}
Tags

Extension points exported contracts — how you extend this code

ElasticsearchOperator (Interface)
(no doc) [4 implementers]
pumps/elasticsearch.go
UptimePump (Interface)
(no doc) [4 implementers]
pumps/pump.go
KinesisClientInterface (Interface)
KinesisClientInterface defines the interface for Kinesis client operations [1 implementers]
pumps/kinesis_test.go
AnalyticsSerializer (Interface)
(no doc) [2 implementers]
serializer/serializer.go
AnalyticsStorage (Interface)
(no doc) [1 implementers]
storage/store.go
SQSSendMessageBatchAPI (Interface)
(no doc) [1 implementers]
pumps/sqs.go
StatsDSinkSanitizationFunc (FuncType)
(no doc)
instrumentation_statsd_sink.go
TimestreamWriteRecordsAPI (Interface)
(no doc)
pumps/timestream.go

Core symbols most depended-on inside this repo

New
called by 91
pumps/pump.go
Decode
called by 58
serializer/serializer.go
processPumpEnvVars
called by 33
pumps/pump.go
Init
called by 27
pumps/sql.go
WriteData
called by 27
pumps/pump.go
GetName
called by 25
pumps/pump.go
MigrateAllShardedTables
called by 24
pumps/common.go
GenerateRandomAnalyticRecord
called by 23
analytics/demo/demo.go

Shape

Method 625
Function 500
Struct 152
Interface 11
TypeAlias 7
FuncType 1

Languages

Go100%

Modules by API surface

analytics/proto/analytics.pb.go131 symbols
analytics/aggregate.go39 symbols
analytics/analytics.go33 symbols
pumps/elasticsearch.go32 symbols
pumps/mongo.go29 symbols
pumps/kinesis_test.go29 symbols
pumps/pump.go28 symbols
instrumentation_statsd_sink.go28 symbols
pumps/prometheus.go26 symbols
pumps/mcp_sql_aggregate_test.go24 symbols
pumps/moesif.go23 symbols
pumps/common.go23 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

Datastores touched

(mongodb)Database · 1 repos
tyk_analyticsDatabase · 1 repos
mydatabaseDatabase · 1 repos
tykDatabase · 1 repos

For agents

$ claude mcp add tyk-pump \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page