-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
help request: How to use x-request-id as trace_id with apisix opentelemetry over istio service mesh #10239
Comments
I think we should add hyphen to the regex. WDYT @Revolyssup |
@circlelychen The opentelemetry specification says that this should be hex string and not all uuids are valid hex. So apisix uses the opentelemetry library which just follows the spec. You can use plugin to remove the So one way can be to create a copy of the x-request-id header with removed hyphens using the plugin and use the non-hyphen header for opentelemetry plugin leaving the original header intact. Long story short, it's not possible to use hyphens with opentelemetry plugin |
@Revolyssup Thanks for your advice. We should make a bridge between opentelemetry and istio service mesh. |
Due to lack of the reporter's response this issue has been labeled with "no response". It will be close in 3 days if no further activity occurs. If this issue is still relevant, please simply write any comment. Even if closed, you can still revive the issue at any time or discuss it on the [email protected] list. Thank you for your contributions. |
This issue has been closed due to lack of activity. If you think that is incorrect, or the issue requires additional review, you can revive the issue at any time. |
I investigated this and realised that the underlying otel lua library expectes trace_id to be hexadecimals. The trace-id needs to be decoded to bytes in order to be sent via transit over OLTP. The hexadecimal to bytes decoding process fails due to the way how the underlying library is written: |
according to the specification, the trace_id should be a valid hex and hyphens cannot be a part of it. So I will close this issue. |
Description
Hi guys,
We enable apisix opentelemetry plugin with trace_id_source = x-request-id over istio service mesh. I got following error in apisix log
The root cause is x-request-id header must be match with regex [0-9a-f]{32} since trace_Id only support that pattern. However, x-request-id is generated by istio service mesh with "-"(hyphen) between hex-style character, e.g. 84961386-6d84-929d-98bd-c5aee93b5c88. These "-"(hyphen) contribute the error hex2bytes function in opentelemetry-lua.
In our use cases, removing istio service mesh is forbidden and we regard this "-"hyphen embedded x-request-id as global unique trace_id cross multiple Kubernetes for single request life cycle.
We leverage apisix as micro-service API gateway. Is there any best practice or guidelines for us to integrate apisix opentelemetry over istio service mesh?
Please advises.
Thanks
Environment
apisix version
): 3.4uname -a
): redhatopenresty -V
ornginx -V
):curl http://127.0.0.1:9090/v1/server_info
): none. standalone modeluarocks --version
):The text was updated successfully, but these errors were encountered: