feat(observability): support header param while OTLP export#1805
feat(observability): support header param while OTLP export#1805qin-ctx merged 2 commits intovolcengine:mainfrom
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
qin-ctx
left a comment
There was a problem hiding this comment.
Thanks for adding OTLP header support across traces, logs, and metrics.
I found one blocking issue: the new config accepts and documents mixed-case header keys, but the gRPC export paths forward those keys as metadata, and grpcio rejects uppercase metadata keys at call time. Please normalize or validate header keys before they reach gRPC metadata.
Non-blocking notes:
- This PR does not link a related issue. If this is for a specific backend integration requirement, please add the issue or design context for traceability.
- The current docs build is failing in
docs/zh/api/99-api-doc-writing-guide.md:47. That appears unrelated to this PR, but the PR is still blocked until CI is green or the baseline is clarified.
| endpoint: str = "localhost:4317" # gRPC default: 4317; HTTP default: 4318 | ||
| service_name: str = "openviking-server" | ||
| export_interval_ms: int = 10000 | ||
| headers: Dict[str, str] = Field(default_factory=dict) |
There was a problem hiding this comment.
[Bug] (blocking)
headers currently accepts arbitrary keys and the gRPC paths pass them through as metadata. gRPC Python requires metadata keys to be lowercase; for example, the documented/tested X-ByteAPM-AppKey form is rejected by grpcio with ValueError: metadata was invalid before the request is sent.
This means users following the new protocol="grpc" examples with X-* auth headers will see OTLP exports fail continuously. Please either normalize keys before passing them to gRPC metadata, or validate config and reject non-lowercase metadata keys. The tests should also cover the real grpcio metadata constraint, not only a fake stub that accepts uppercase keys.
Description
feat(observability): support header param while OTLP export
Related Issue
Type of Change
Changes Made
Testing
Checklist
Screenshots (if applicable)
Additional Notes
#1805
Supports adding header parameters during OTLP transmission, suitable for scenarios requiring additional information (such as authentication SK/SK).
Configuration as follows
Example -- Integrating into the Volcano Engine log service system requires adding information such as topic/ak/sk.