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

How to have correlation ids for messages from Cloud SDK in kibana? #4209

Open
dinurp opened this issue Oct 18, 2023 · 3 comments
Open

How to have correlation ids for messages from Cloud SDK in kibana? #4209

dinurp opened this issue Oct 18, 2023 · 3 comments
Labels
feature request Requests for new functionality

Comments

@dinurp
Copy link

dinurp commented Oct 18, 2023

We are using Cloud SDK v3 via CAP nodejs v7 for making external calls. We have enabled logging with Kibana formatter by enabling the setting in CAP. We have bound application log service to the app when it is deployed to SAP BTP Cloud Foundry. The messages from CAP are logged in Kibana together with request logs from Cloud Foundry with correlation ID. Even the messages send from the CAP application have correlation ID headers and we are able to see messages for a request across the different apps and systems.

But messages from Cloud SDK are without correlation ID. They float around in Kibana and are not easily found. Cloud SDK logs warning messages like "WarningJWT: The provided JWT payload does not include a 'user_id' property." These messages are logged with no context and we are not able to understand the relevance of these messages without correlation with other messages.

How can we get Cloud SDK messages to be logged with correlation ID? They are already logged in Kibana format. But, without correlation with their context, these messages are pretty useless. We are not able to take heed of the warnings or locate reasons of errors.

Regards,
Dinu

@dinurp dinurp added the question Further information is requested label Oct 18, 2023
@marikaner
Copy link
Contributor

marikaner commented Oct 20, 2023

Hey @dinurp, this is a relevant feature request and we have discussed a similar issue in the past.
Back then we still supported node 12 and which would have made it quite difficult to pass a context (e.g. the correlation ID) around. Now with node 18, this should be possible, however the context would have to be passed to the execute() functions somehow. This is definitely possible, we just have to discuss priorities.

@marikaner marikaner added feature request Requests for new functionality and removed question Further information is requested labels Oct 20, 2023
@dinurp
Copy link
Author

dinurp commented Oct 21, 2023

Passing additional parameters to execute() will need to be adopted by CAP to be useful to us. We will not be able to use it till then, just like we are not able to use resilience functionality now.
The correlation id is already in the request header when CAP makes the request, can't that be used? Can we configure somehow setting the logging format?
Is there a way I could configure SDK to use the same logger as used by CAP or something like cf-nodejs-logging-support that integrates with express to capture the request context?

@marikaner
Copy link
Contributor

As of today this is not possible - we would need to implement some changes to make it possible.

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

No branches or pull requests

2 participants