Fix: use WARN level and "Notif failure" message for failed notifications (#4800) - #4801
Conversation
| ... | ||
|
|
||
| time=2026-03-12T13:16:09.473Z | lvl=INFO | corr=a280a8ae-1e15-11f1-ae2a-080027207a9f; cbnotif=1 | trans=1773321367-657-00000000004 | from=0.0.0.0 | srv=<none> | subsrv=/ | comp=Orion | op=logTracing.cpp[105]:logInfoHttpNotification | msg=Notif delivered (subId: 69b2bc999bb797a5cd07dc74): POST localhost:9997/giveme400, payload (123 bytes): {"subscriptionId":"69b2bc999bb797a5cd07dc74","data":[{"id":"E1","type":"T","A":{"type":"Number","value":1,"metadata":{}}}]}, response code: 400, response payload (93 bytes): {"error": "FakeError", "description": "this is a forged error response for testing purposes"} | ||
| time=2026-03-12T13:16:09.473Z | lvl=WARN | corr=a280a8ae-1e15-11f1-ae2a-080027207a9f; cbnotif=1 | trans=1773321367-657-00000000004 | from=0.0.0.0 | srv=<none> | subsrv=/ | comp=Orion | op=logTracing.cpp[105]:logInfoHttpNotification | msg=Notif failure (subId: 69b2bc999bb797a5cd07dc74): POST localhost:9997/giveme400, payload (123 bytes): {"subscriptionId":"69b2bc999bb797a5cd07dc74","data":[{"id":"E1","type":"T","A":{"type":"Number","value":1,"metadata":{}}}]}, response code: 400, response payload (93 bytes): {"error": "FakeError", "description": "this is a forged error response for testing purposes"} |
There was a problem hiding this comment.
I think this case should be changed
The "failure" semantics for notifications is "the notification hasn't reached the destination" no matter the response code of the receiver (either 2xx, 4xx or 5xx). This is somehow confirmed by alarm ID 5 type in this table
The change INFO -> WARN and "Notif delivered" -> "Notif failure" is ok for the following cases shown in this documentation:
- Couldn't connect to server
- Timeout was reached
- Couldn't resolve host name
| } | ||
|
|
||
| LM_I(("Notif delivered (subId: %s): %s %s%s, payload (%d bytes): %s, response code: %s", subId, verb, endpoint, resource, strlen(payload), effectivePayload, reason)); | ||
| LM_W(("Notif failure (subId: %s): %s %s%s, payload (%d bytes): %s, response code: %s", subId, verb, endpoint, resource, strlen(payload), effectivePayload, reason)); |
There was a problem hiding this comment.
Given that we are changing the structure of the message ("delivered" -> "failure") maybe we should do the same for "response code", as in this case we don't have an actual response code (in the past we did so to have an homogenous format along all the notification log messages)
What about?
| LM_W(("Notif failure (subId: %s): %s %s%s, payload (%d bytes): %s, response code: %s", subId, verb, endpoint, resource, strlen(payload), effectivePayload, reason)); | |
| LM_W(("Notif failure (subId: %s): %s %s%s, payload (%d bytes): %s, reason: %s", subId, verb, endpoint, resource, strlen(payload), effectivePayload, reason)); |
|
@fisuda this PR does some modifications in .md files. It would be great if you could have a look and do a PR with the Japanese sync. Thanks in advance! |
|
I sent the PR #4802. |
(JP) Added documentation about failed notifications (#4801)
Issue #4800