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

feat(coap-core): Add java-coap specific header option for correlation tags #104

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

akolosov-n
Copy link
Collaborator

The option allows to send and receive correlation tags to match CoAP requests and responses with any application specific actions.

Option number is a randomly generated number (29643) from the Expert Review range.

@akolosov-n akolosov-n requested a review from szysas September 19, 2024 12:26
Copy link
Collaborator

@szysas szysas left a comment

Choose a reason for hiding this comment

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

🦸

@akolosov-n akolosov-n merged commit d1b7b98 into master Sep 19, 2024
5 of 6 checks passed
@akolosov-n akolosov-n deleted the request-id-option branch September 19, 2024 13:01
@szysas
Copy link
Collaborator

szysas commented Sep 20, 2024

@sbernard31 FYI, we added new custom coap option that is meant to be equivalent of http X-Request-ID. Are you aware of any standard coap option for that purpose?

@sbernard31
Copy link
Collaborator

You're refer to X-Request-ID from HTTP ? I'm not too familiar with that feature.

Is it mainly used for https://stackoverflow.com/a/27174552/5088764 or https://stackoverflow.com/a/54356305/5088764 ?

@sbernard31
Copy link
Collaborator

At least I don't see any registered option which looks like that at : https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#option-numbers

@sbernard31
Copy link
Collaborator

I'm not sure exactly how you want to use it.
E.g. if you want that all block requests use same Request ID for same "parent" request/operation ?

If yes, re-reading Request-Tag Option, I feel this is maybe the nearest existing CoAP concept ? but theoretically intended to be used only with block transfer BUT RFC says :

Note that Request-Tag options can be present in request messages that carry no Block options (for example, because a proxy unaware of Request-Tag reassembled them).

and

The Request-Tag option does not require any particular processing on the server side outside of the processing already necessary for any unknown elective proxy-safe cache-key option.

So maybe it's ok ? 🤔

Anyway, maybe this is good question to ask at [email protected]. (explaining your use case)

@szysas
Copy link
Collaborator

szysas commented Sep 23, 2024

Request-Tag feels like it would be the closest, but it is not suppose to be in responses. The idea is that (same as with X-Request-ID) server generates and send this header option in responses so that customer can provide it if there are any issues that needs tracing in logs. This is handy especially with micro-services, to filter out logs related to a specific request. In case of blockwise transfer, that would be the added to a response of a last block.

@sbernard31
Copy link
Collaborator

Request-Tag feels like it would be the closest, but it is not suppose to be in responses.

Correct.
I tried to find official specification about it but didn't find it, so I was not sure if X-Request-ID should be in the response too.

After more searching, I maybe know why it was so hard to find specification. This is because this is not a real standard.
It seems the official standard to do that is : W3 Trace Context.

server generates and send this header option in responses so that customer can provide it if there are any issues that needs tracing in logs.

If you search something about correlating Request and Response then could you use CoAP token (OR CoAP token+Peer Identitity) to do that ?

Anyway, If nothing match your need I think it's OK to use a non standard option header but I strongly encourage to share your need/question at [email protected], you will maybe have better answer than mine and you will let them know community needs, so maybe we will have a standard before everybody create its own option header like in HTTP (X-request-ID, X-correlation-ID ...)

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.

3 participants