Issue with CWP ${service.shared.spanId} in Kubernetes Logs and audit.log.service.headerFormat
search cancel

Issue with CWP ${service.shared.spanId} in Kubernetes Logs and audit.log.service.headerFormat

book

Article ID: 387225

calendar_today

Updated On:

Products

CA API Gateway

Issue/Introduction

Why is the CWP audit.log.service.headerFormat (with a value like ${requestId}: processing message.) ineffective in inserting traces into Kubernetes logs when a service is called?

Specifically:

  • We noticed that CWPs like audit.log.*** do not accept variables such as ${service.shared.spanId}.
  • In our environments (e.g., WORK02 Real and SBx), we implemented a workaround by modifying keap.traceLogWriter to include the spanId directly in the log message.
  • However, in WORK02-SB, the CWPs containing ${service.shared.spanId} cannot be edited or deleted. Attempts result in an error, both through the UI and RESTman, as shown below:
 
java.lang.IllegalArgumentException: can't parse argument number: service.shared.spanId

Could you clarify why this happens and how we can properly use CWPs to log traces (like spanId) in Kubernetes environments?

Environment

11.1

Resolution

Whenever JSON formatter is used, regardless the platform (OVA, k8s, software), CWP for headerformat, footerformat, detailformat are all ignored, so they never get populated.

 

Additional Information