mule-opentelemetry-module
mule-opentelemetry-module copied to clipboard
Support for Authorization header to accept expression with encrypted token and text
When configuring OpenTelemetry config in the application to send traces to Elastic, Authorization header works only for below scenarios
-
Hardcoded text containing 'ApiKey <APM_Auth_Token>'
<opentelemetry:headers> <opentelemetry:header key="Authorization" value="ApiKey **********" /> </opentelemetry:headers>
-
Encrypting text - 'ApiKey <APM_Auth_Token>' and accessing it as secured property
<opentelemetry:headers> <opentelemetry:header key="Authorization" value="${secure::elastic.apm.authToken}" /> </opentelemetry:headers>
And, it doesn't work when encrypting only Auth_token and passing 'ApiKey' and secured token in the value expression for Authorization header - <opentelemetry:headers> <opentelemetry:header key="Authorization" value="#['ApiKey ' ++p('secure::elastic.apm.authToken')]" /> </opentelemetry:headers>
. In this scenario, OpenTelemetry doesn't raise any errors and also there's no trace sent to Elastic.