How to log additional attributes in request and client spans? #1411
-
I don’t see an option to log parameters and custom details from Rack and ActionPack instrumentations. In our current logging setup, we typically capture request parameters and headers for incoming requests to the app, as well as for outgoing client requests to external services. However, I haven’t found a similar approach in the HTTP client instrumentations. What is the best practice for logging these attributes? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
For performance, privacy and security reasons, we have chosen to intentionally avoid recoding request and response parameters to instrumentations. The semantic conventions specification also does not specify how to record these attributes. If you want this level of granularity in traces I would recommend creating your own custom instrumentation and intentionally enrich the spans yourself using SDK provided helpers. As far as logging is concerned, I don't know where going to do to maintain backward compatibility with the Framework logs other than map the known ones to semantic attributes. Or place the fully formatted message in the Body attribute in the OTLP bridge. In these cases you should still get whatever Rails or Sinatra logs, however they will be wrapped in a OTLP log record message. |
Beta Was this translation helpful? Give feedback.
For performance, privacy and security reasons, we have chosen to intentionally avoid recoding request and response parameters to instrumentations. The semantic conventions specification also does not specify how to record these attributes.
If you want this level of granularity in traces I would recommend creating your own custom instrumentation and intentionally enrich the spans yourself using SDK provided helpers.
As far as logging is concerned, I don't know where going to do to maintain backward compatibility with the Framework logs other than map the known ones to semantic attributes. Or place the fully formatted message in the Body attribute in the OTLP bridge. In these cases you shou…