{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/ingress-nginx/issues/3440","repository_url":"https://api.github.com/repos/kubernetes/ingress-nginx","labels_url":"https://api.github.com/repos/kubernetes/ingress-nginx/issues/3440/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/ingress-nginx/issues/3440/comments","events_url":"https://api.github.com/repos/kubernetes/ingress-nginx/issues/3440/events","html_url":"https://github.com/kubernetes/ingress-nginx/issues/3440","id":382688982,"node_id":"MDU6SXNzdWUzODI2ODg5ODI=","number":3440,"title":"Opentracing with gRPC","user":{"login":"andremarianiello","id":3359229,"node_id":"MDQ6VXNlcjMzNTkyMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/3359229?v=4","gravatar_id":"","url":"https://api.github.com/users/andremarianiello","html_url":"https://github.com/andremarianiello","followers_url":"https://api.github.com/users/andremarianiello/followers","following_url":"https://api.github.com/users/andremarianiello/following{/other_user}","gists_url":"https://api.github.com/users/andremarianiello/gists{/gist_id}","starred_url":"https://api.github.com/users/andremarianiello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andremarianiello/subscriptions","organizations_url":"https://api.github.com/users/andremarianiello/orgs","repos_url":"https://api.github.com/users/andremarianiello/repos","events_url":"https://api.github.com/users/andremarianiello/events{/privacy}","received_events_url":"https://api.github.com/users/andremarianiello/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-20T14:29:40Z","updated_at":"2018-11-20T14:33:00Z","closed_at":null,"author_association":"NONE","body":"**What keywords did you search in NGINX Ingress controller issues before filing this one?** (If you have found any duplicates, you should instead reply there.):\r\nopentracing, grpc\r\n---\r\n\r\nFEATURE REQUEST:\r\n  - I would like opentracing to work with gRPC. The `opentracing_propagate_context` directive does not correctly inject the span context into requests to grpc upstreams, so I cannot get the correct hierarchy of spans downstream. \r\n\r\n**NGINX Ingress controller version**:\r\n0.18.0\r\n\r\n**Kubernetes version** (use `kubectl version`):\r\nv1.9.7-gke.11\r\n\r\n**Environment**:\r\n- GKE\r\n\r\n**What happened**:\r\nWhen I enable opentracing, the nginx spans are not propagated to grpc backends, only http1.x.\r\n\r\n**What you expected to happen**:\r\nI would expect spans to be injected correctly regardless of http version.\r\n\r\n**How to reproduce it** (as minimally and precisely as possible):\r\nSet up a grpc-enabled ingress, and enable opentracing as well. Send a request to your upstream grpc service via nginx-ingress controller. Check the incoming grpc metadata and find that there are no opentracing headers set, even though nginx ingress controller sends a span.\r\n\r\n**Anything else we need to know**:\r\nI added grpc propagation support to nginx-opentracing module (https://github.com/opentracing-contrib/nginx-opentracing/pull/67) recently for the specific purpose of supporting this feature. I am also willing to make a PR for this."},"comment":{"url":"https://api.github.com/repos/kubernetes/ingress-nginx/issues/comments/440293657","html_url":"https://github.com/kubernetes/ingress-nginx/issues/3440#issuecomment-440293657","issue_url":"https://api.github.com/repos/kubernetes/ingress-nginx/issues/3440","id":440293657,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDI5MzY1Nw==","user":{"login":"andremarianiello","id":3359229,"node_id":"MDQ6VXNlcjMzNTkyMjk=","avatar_url":"https://avatars2.githubusercontent.com/u/3359229?v=4","gravatar_id":"","url":"https://api.github.com/users/andremarianiello","html_url":"https://github.com/andremarianiello","followers_url":"https://api.github.com/users/andremarianiello/followers","following_url":"https://api.github.com/users/andremarianiello/following{/other_user}","gists_url":"https://api.github.com/users/andremarianiello/gists{/gist_id}","starred_url":"https://api.github.com/users/andremarianiello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andremarianiello/subscriptions","organizations_url":"https://api.github.com/users/andremarianiello/orgs","repos_url":"https://api.github.com/users/andremarianiello/repos","events_url":"https://api.github.com/users/andremarianiello/events{/privacy}","received_events_url":"https://api.github.com/users/andremarianiello/received_events","type":"User","site_admin":false},"created_at":"2018-11-20T14:33:00Z","updated_at":"2018-11-20T14:33:00Z","author_association":"NONE","body":"For anyone wanting this in the meantime there is a workaround:\r\n\r\nAdd the following annotation to your grpc-enabled, opentracing-enabled ingress:\r\n\r\n```\r\n    nginx.ingress.kubernetes.io/configuration-snippet: |\r\n      grpc_set_header X-B3-TraceId \"$opentracing_context_x_b3_traceid\";\r\n      grpc_set_header X-B3-SpanId \"$opentracing_context_x_b3_spanid\";\r\n      grpc_set_header X-B3-ParentSpanId \"$opentracing_context_x_b3_parentspanid\";\r\n      grpc_set_header X-B3-Sampled \"$opentracing_context_x_b3_sampled\";\r\n      grpc_set_header X-B3-Flags \"$opentracing_context_x_b3_flags\";\r\n```\r\n\r\nThis works is your tracing instrumentation uses B3 propagation. If it uses some other propagation format, then you will have to adjust accordingly."}}
{"actor":{"display_login":"andremarianiello"}}