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

Cannot Capture Custom Headers from Instrumented Servers #13390

Open
baole229801 opened this issue Feb 25, 2025 · 2 comments
Open

Cannot Capture Custom Headers from Instrumented Servers #13390

baole229801 opened this issue Feb 25, 2025 · 2 comments
Labels
bug Something isn't working needs triage New issue that requires triage

Comments

@baole229801
Copy link

Describe the bug

Hi everyone,
I have attached the java opentelemetry agent to our application, anh I want to capture one custom header from its response to the clients.

This is the response header:

Date: Tue, 25 Feb 2025 06:12:47 GMT
X-Content-Type-Options: nosniff
Content-Length: 0
X-ORACLE-DMS-ECID: 006Bj5OWiBcA_MYjLp2VOA00060m000JuW
X-ORACLE-DMS-RID: 0:1
X-XSS-Protection: 1; mode=block
Keep-Alive: timeout=5, max=1000
Connection: Keep-Alive
Content-Type: text/xml; charset=iso-8859-1

And inside properties file, I use this configration:

otel.instrumentation.http.server.capture-response-headers=Content-Type,X-ORACLE-DMS-ECID

I dont understand why it only captures the Content-Type, but not the X-ORACLE-DMS-ECID header. Is there any additional configuration for the custom header.

Thank everyone.

Steps to reproduce

This is the response header:

Date: Tue, 25 Feb 2025 06:12:47 GMT
X-Content-Type-Options: nosniff
Content-Length: 0
X-ORACLE-DMS-ECID: 006Bj5OWiBcA_MYjLp2VOA00060m000JuW
X-ORACLE-DMS-RID: 0:1
X-XSS-Protection: 1; mode=block
Keep-Alive: timeout=5, max=1000
Connection: Keep-Alive
Content-Type: text/xml; charset=iso-8859-1

The configuration:

otel.instrumentation.http.server.capture-response-headers=Content-Type,X-ORACLE-DMS-ECID

Expected behavior

It should show both values for the configured headers.

Actual behavior

It should show both values for the configured headers.

Javaagent or library instrumentation version

1.37

Environment

JDK:
OS:

Additional context

No response

@baole229801 baole229801 added bug Something isn't working needs triage New issue that requires triage labels Feb 25, 2025
@laurit
Copy link
Contributor

laurit commented Feb 25, 2025

Is this weblogic or some other server? Can you observe these headers being set when you call HttpServletResponse.getHeaderNames() or HttpServletResponse.getHeaders()?

@laurit laurit added the needs author feedback Waiting for additional feedback from the author label Feb 25, 2025
@baole229801
Copy link
Author

Hi Laurit,
This is Weblogic and the application is Oracle Service Bus.

From the client side, when I set to otel.instrumentation.http.client.capture-response-headers=X-ORACLE-DMS-ECID, I can get the header's value.

@github-actions github-actions bot removed the needs author feedback Waiting for additional feedback from the author label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage New issue that requires triage
Projects
None yet
Development

No branches or pull requests

2 participants