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

Tracing: Incoming TraceId is lost and outgoing is either completely lost or rounded #6465

Closed
richteri opened this issue Jan 20, 2021 · 4 comments
Assignees
Labels
c/server Related to server support/needs-action support ticket that requires action by team

Comments

@richteri
Copy link

Related to #3011, #5517

Versions

graphql-engine v1.3.3 and v1.3.4-beta.2
postgres v11.6.0

Environment

minikube / kubernetes

Steps to Reproduce

  1. create a table
  2. set up an event trigger for the table
  3. run a mutation using tracing headers X-Hasura-TraceId & X-B3-TraceId

Expected Result

  • Incoming tracing headers use B3 compliant names
  • TraceID is preserved

Actual Result in v1.3.3

  • Incoming tracing headers use custom X-Hasura-* names
  • TraceID is lost in (rounded due to JSON conversion and JS number overflow?)

Event invocation log in v1.3.3

Notice the missing 1 from the end of trace_id and the trailing zeros in span_id.

{
    "payload": {
        "event": {
            "session_variables": {
                "x-hasura-spanid": "1000000000000000001",
                "x-hasura-role": "admin",
                "x-hasura-traceid": "1000000000000000001"
            },
            "op": "INSERT",
            "data": { ... },
            "trace_context": {
                "trace_id": 1000000000000000000,
                "span_id": 4083814875249555000
            }
        },
        "created_at": "2021-01-20T06:36:53.940866Z",
        "id": "4317f03c-d81a-4d6c-bf83-ede895fbb0d9",
        "delivery_info": {
            "max_retries": 0,
            "current_retry": 0
        },
        "trigger": {
            "name": "changelog"
        },
        "table": {
            "schema": "audit",
            "name": "logged_actions"
        }
    },
    "headers": [
        {
            "value": "application/json",
            "name": "Content-Type"
        },
        {
            "value": "hasura-graphql-engine/v1.3.3",
            "name": "User-Agent"
        }
    ],
    "version": "2"
}

Actual Result in v1.3.4-beta.2

  • Incoming tracing headers use custom X-Hasura-* names
  • TraceID is lost in (new TraceId is generated AND rounded due to JSON conversion and JS number overflow?)

Event invocation log in v1.3.4-beta.2

Notice the 3 trailing zeros in trace_id and span_id

{
    "payload": {
        "event": {
            "session_variables": {
                "x-hasura-spanid": "1000000000000000001",
                "x-hasura-role": "admin",
                "x-hasura-traceid": "1000000000000000001"
            },
            "op": "INSERT",
            "data": { ... },
            "trace_context": {
                "trace_id": 14323783848538888000,
                "span_id": 8736764150515762000
            }
        },
        "created_at": "2021-01-20T07:02:31.457988Z",
        "id": "8aeb9ff5-54de-4b76-aea6-cbf1acb4cef7",
        "delivery_info": {
            "max_retries": 0,
            "current_retry": 0
        },
        "trigger": {
            "name": "changelog"
        },
        "table": {
            "schema": "audit",
            "name": "logged_actions"
        }
    },
    "headers": [
        {
            "value": "application/json",
            "name": "Content-Type"
        },
        {
            "value": "hasura-graphql-engine/v1.3.4-beta.2",
            "name": "User-Agent"
        }
    ],
    "version": "2"
}
@tirumaraiselvan tirumaraiselvan added the support/needs-action support ticket that requires action by team label Jan 27, 2021
@paf31 paf31 assigned Naveenaidu and unassigned paf31 Jan 27, 2021
@paf31 paf31 added the c/server Related to server label Jan 27, 2021
@Naveenaidu
Copy link
Member

@richteri Thank you for reporting the issue. I'm looking into it now and will get back to you with an update :)

@Naveenaidu
Copy link
Member

Naveenaidu commented Apr 14, 2021

Closing the issue since it has been fixed in https://github.com/hasura/graphql-engine-mono/pull/446.

@richteri
Copy link
Author

richteri commented Apr 14, 2021

@Naveenaidu, Any chance it'll make its way into the current repo / CE release soon?

@Naveenaidu
Copy link
Member

@richteri This will be released from 2.0.0-alpha.8 onwards :)

It's already in the current repo(hasura/graphql engine) in this commit f6fbf20 in case you wanna try it out ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/server Related to server support/needs-action support ticket that requires action by team
Projects
None yet
Development

No branches or pull requests

4 participants