Correlation ID - Aggouri/acheron GitHub Wiki

Correlate requests and responses using a unique identifier transmitted over a configurable HTTP header. This header is injected by Acheron when proxying the request and its value is set to a UUID.

Configuration

Enable Correlation ID by executing the following request:

curl -X POST -H "Content-Type: application/json" -d '{
"name": "correlation_id",
"route_id": <route_id>,
"http_methods": [
  "*"
 ]
}' "http://localhost:9090/admin/plugin-configs"

JSON body parameters:

  • route_id (required): the route this plugin configuration applies to.
  • consumer_id: the consumer this plugin configuration applies to.
  • http_methods: the HTTP methods this plugin configuration applies to, e.g. POST. The asterisk character (*) captures all methods. Please keep all method names uppercase, e.g. use GET instead of get.
  • config: a JSON object containing plugin-specific configuration parameters

Configuration (config) parameters:

  • custom_header_name: Use a custom header name instead of the default one.

Example on hypothetical balances API:

curl -X POST -H "Content-Type: application/json" -d '{
"name": "correlation_id",
"route_id": "balances",
"http_methods": [
  "*"
 ],
 "config": {
 	"custom_header_name": "AMAZING_CORRELATION"
 }
}' "http://localhost:9090/admin/plugin-configs"

Usage

All requests going to the API will be transformed to contain a header with a UUID as value. The default header name is ACHERON-REQUEST-ID.

Upstream Headers

Acheron adds one of the following headers when proxying the request.

  • ACHERON-REQUEST-ID: The default header representing the correlation ID, set to a UUID generated by Acheron
  • <custom_header_name>: The custom header representing the correlation ID, set to a UUID generated by Acheron
⚠️ **GitHub.com Fallback** ⚠️