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

Fix trace name resolution for spans with remote parents #461

Closed
wants to merge 1 commit into from
Closed

Fix trace name resolution for spans with remote parents #461

wants to merge 1 commit into from

Commits on Oct 7, 2019

  1. Fix trace name resolution for spans with remote parents

    When encountering a trace whose root span contains a reference
    to a remote parent span in a different trace, the UI would fail
    to determine the root span and instead display the fallback
    <trace-without-root-span> trace name.
    
    This change makes it so that the first span that has no parents
    in the current trace is correctly considered the root span.
    Previously only a span with no references/parents was considered
    the root span.
    
    To simplify the logic and ensure consistency, transformTraceData
    was changed to use the fixed getTraceName.
    
    Traces with remote parents are commonly used when handling HTTP
    or RPC requests from untrusted clients. See the opencensus-specs
    util/HandleUntrustedRequests.md for an example of this approach.
    
    An example of a trace that contains a remote parent:
    {
        "data": [
            {
                "traceID": "46412397683b6cee4f02fa1ac7e4d0db",
                "spans": [
                    {
                        "traceID": "46412397683b6cee4f02fa1ac7e4d0db",
                        "spanID": "7ef1d2e931ada231",
                        "operationName": "operation",
                        "references": [
                            {
                                "refType": "CHILD_OF",
                                "traceID": "79b24a4a9fb5d4e46895ab64f55dfc90",
                                "spanID": "9111732227172a77"
                            }
                        ],
                        "startTime": 1257894000000000,
                        "duration": 1000,
                        "tags": [],
                        "logs": [],
                        "processID": "p1",
                        "warnings": null
                    }
                ],
                "processes": {
                    "p1": {
                        "serviceName": "service",
                        "tags": []
                    }
                },
                "warnings": null
            }
        ],
        "total": 0,
        "limit": 0,
        "offset": 0,
        "errors": null
    }
    
    Signed-off-by: Tom Thorogood <[email protected]>
    tmthrgd committed Oct 7, 2019
    Configuration menu
    Copy the full SHA
    04c636c View commit details
    Browse the repository at this point in the history