Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentaton for correlation-id plugin #211

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added app/_assets/images/icons/plugins/correlation-id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/_data/plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,7 @@
- name: Loggly
id: loggly
info: Send request and response logs to Loggly

- name: Correlation ID
id: correlation-id
info: Correlate requests and responses using a unique ID
48 changes: 48 additions & 0 deletions app/plugins/correlation-id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
id: page-plugin
title: Plugins - Correlation ID
header_title: Correlation ID
header_icon: /assets/images/icons/plugins/correlation-id.png
breadcrumbs:
Plugins: /plugins
nav:
- label: Getting Started
items:
- label: Configuration
- label: Usage
items:
- label: Logs
---

Correlate requests and responses using a unique ID.

----

## Configuration

Configuring the plugin is straightforward. You can associate it with an [API][api-object] by executing the following request to your Kong server:

```bash
$ curl -X POST http://kong:8001/apis/{api}/plugins \
--data "name=correlation-id"
```

`api`: The `id` or `name` of the API that this plugin configuration will target

form parameter | required | description
--- | --- | ---
`name` | *required* | The name of the plugin to use, in this case: `correlation-id`
`header_name` | *optional* | The HTTP header name to use for the correlation ID. Defaults to `Kong-Request-ID`
`generator ` | *optional* | The generator to use for the correlation ID. Accepted values are `uuid` (which generates a UUID for every request), or `uuid#counter` (which generates a UUID once per Nginx worker, and a count for every request). Defaults to `uuid#counter`.
`echo_downstream` | *optional* | Whether to echo the header back to downstream (the API calller). Defaults to `false`.

[api-object]: /docs/latest/admin-api/#api-object
[configuration]: /docs/latest/configuration
[consumer-object]: /docs/latest/admin-api/#consumer-object
[faq-authentication]: /about/faq/#how-can-i-add-an-authentication-layer-on-a-microservice/api?

----

## Logs

The correlation ID will not show up in the Nginx access or error logs. As such, we suggest you use this plugin alongside one of the Logging plugins.