Thank you for your response, @Olu.
Could you please share an example? I’m not sure how I can reference the traceparent value generated in Tyk Gateway.
My API definition is similar to the following:
apps:
my-api:
name: "My API"
api_id: my-api
active: true
version_data:
default_version: v1
not_versioned: false
versions:
v1:
name: v1
use_extended_paths: true
extended_paths:
white_list:
- path: "/my-list"
method_actions:
GET:
action: no_action
proxy:
listen_path: "/my/api/"
strip_listen_path: true
target_url: "https://my-api.com"
tag_headers:
- traceparent
enable_context_vars: true
I think I wasn’t clear enough. We have a couple of pumps configured and I don’t think there is an issue with them. By integration, I meant propagating the traceparent
header to the tags
field in the pump records.
Let me share an example for the API definition I shared above.
- I send a request
curl -X GET https://my-tyk.com/my/api/list
with no headers.
- Tyk Gateway accepts the request, adds the
traceparent
header, and forwards the call to my service. Now the request looks like this curl -X GET https://my-api.com/list -H "traceparent: 01-XXX-123"
- Then the response is returned and probably at this point Tyk Gateway creates an analytic record and sends it to Redis. The record will look similar to the following:
{
"api_id": "my-api",
"api_key": "123",
"api_name": "My API",
"api_version": "Non Versioned",
"content_length": 0,
"host": "my-api.com",
"ip_address": "11.11.11.11",
"method": "GET",
"oauth_id": "",
"org_id": "default",
"path": "/list",
"raw_path": "/list",
"raw_request": "",
"raw_response": "",
"request_time_ms": 123,
"response_code": 200,
"tags": [
"pol-my-policy",
"key-123",
"org-default",
"api-my-api"
],
"timestamp": "2024-04-02T10:10:10.03264713Z"
}
And the result I’m trying to achieve is that the tags
field looks like this instead:
"tags": [
"pol-my-policy",
"key-123",
"org-default",
"api-my-api",
"traceparent-01-XXX-123"
],
Does it make sense? Hope it’s more clear this way.