Skip to content

Consider x-correlation-id as well #64

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HrFlorianHoffmann
Copy link

The library currently considers the header fields x-correlationid and x-vcap-request-id as carrying correlation IDs. This change would also make it aware of the field x-correlation-id, which is widely used in the web, today.

The settings would introduce x-correlation-id as an alias, sub-ordinating it to the original field x-correlationid. Meaning, for example, the library will use x-correlationid > x-correation-id > x-vcap-request-id, in this order of preference. The field would not be propagated back to the request sender, although this can probably be discussed.

This PR is an incomplete suggestion, to make the dimension of the changes to the production code clear. It does not adjust the unit alongside, so any automatic PR voters will/should reject this change.

The library currently considers the header fields `x-correlationid` and `x-vcap-request-id` as carrying correlation IDs. This change would also make it aware of the field `x-correlation-id`, which is widely used in the web, today.

The settings would introduce `x-correlation-id` as an alias, sub-ordinating it to the original field `x-correlationid`. Meaning, for example, the library will use `x-correlationid` > `x-correation-id` > `x-vcap-request-id`, in this order of preference. The field would not be propagated back to the request sender, although this can probably be discussed.

This PR is an incomplete suggestion, to make the dimension of the changes to the production code clear. It does not adjust the unit alongside, so any automatic PR voters will/should reject this change.
@KarstenSchnitter
Copy link
Contributor

Thanks or your contribution. We have issue #45 addressing exactly this question. Adding the alias in the library is rather easy, as demonstrated by your PR. But there are some more things to consider here. Main focus of this library is to aid development of Java applications running on the SAP Cloud Platform using the Cloud Foundry stack. This platform centrally generates request logs in the gorouter, that are shipped along the application logs filtered by this library. The request logs however, only contain a selected set of HTTP headers. This set contains the already supported X-CorrelationID, but not the proposed x-correlation-id. Developers would lack the ability to correlate the request logs with the application logs when using the new header, thus weakening the overall feature. Therefore, we decided to only support X-CorrelationID in the library as an opinionated approach to correlation ids within the platform.

@CLAassistant
Copy link

CLAassistant commented Aug 5, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@nicklas-dohrn nicklas-dohrn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants