jaegertracing / jaeger-ui

Web UI for Jaeger
http://jaegertracing.io/
Apache License 2.0
1.14k stars 482 forks source link

Span is not visible in TraceGraph #317

Open zablvit opened 5 years ago

zablvit commented 5 years ago

Requirement - what kind of business use case are you trying to solve?

See All spans in TraceGraph view

Problem - what in Jaeger blocks you from solving the requirement?

It doesn't show all of them in Trace Graph view, however all are visible in Timeline view

Details

Jaeger v1.9.0

Spans 5f5ddc06e9adfbe2 and a9a3acd2ef652f are not visible in Trace Graph view

Timeline view

0

Trace Graph view

3

Trace JSON

{
    "data": [
        {
            "traceID": "1fea103d70eafd9d",
            "spans": [
                {
                    "traceID": "1fea103d70eafd9d",
                    "spanID": "1fea103d70eafd9d",
                    "flags": 1,
                    "operationName": "POST /letters",
                    "references": [],
                    "startTime": 1548412159938720,
                    "duration": 18497,
                    "tags": [
                        {
                            "key": "sampler.type",
                            "type": "string",
                            "value": "probabilistic"
                        },
                        {
                            "key": "sampler.param",
                            "type": "float64",
                            "value": 1
                        },
                        {
                            "key": "span.kind",
                            "type": "string",
                            "value": "server"
                        },
                        {
                            "key": "http.method",
                            "type": "string",
                            "value": "POST"
                        },
                        {
                            "key": "http.url",
                            "type": "string",
                            "value": "/letters"
                        },
                        {
                            "key": "component",
                            "type": "string",
                            "value": "net/http"
                        },
                        {
                            "key": "http.status_code",
                            "type": "int64",
                            "value": 200
                        }
                    ],
                    "logs": [],
                    "processID": "p1",
                    "warnings": null
                },
                {
                    "traceID": "1fea103d70eafd9d",
                    "spanID": "19ae1396111e418d",
                    "flags": 1,
                    "operationName": "parseLetter",
                    "references": [
                        {
                            "refType": "CHILD_OF",
                            "traceID": "1fea103d70eafd9d",
                            "spanID": "1fea103d70eafd9d"
                        }
                    ],
                    "startTime": 1548412159938997,
                    "duration": 76,
                    "tags": [],
                    "logs": [],
                    "processID": "p1",
                    "warnings": null
                },
                {
                    "traceID": "1fea103d70eafd9d",
                    "spanID": "e6db995ab6d7ab4",
                    "flags": 1,
                    "operationName": "createOrderEvent",
                    "references": [
                        {
                            "refType": "CHILD_OF",
                            "traceID": "1fea103d70eafd9d",
                            "spanID": "1fea103d70eafd9d"
                        }
                    ],
                    "startTime": 1548412159939077,
                    "duration": 108,
                    "tags": [],
                    "logs": [],
                    "processID": "p1",
                    "warnings": null
                },
                {
                    "traceID": "1fea103d70eafd9d",
                    "spanID": "5f5ddc06e9adfbe2",
                    "flags": 1,
                    "operationName": "sendOrderEvent",
                    "references": [
                        {
                            "refType": "CHILD_OF",
                            "traceID": "1fea103d70eafd9d",
                            "spanID": "1fea103d70eafd9d"
                        }
                    ],
                    "startTime": 1548412159939188,
                    "duration": 18019,
                    "tags": [],
                    "logs": [],
                    "processID": "p1",
                    "warnings": null
                },
                {
                    "traceID": "1fea103d70eafd9d",
                    "spanID": "444aa53430d97add",
                    "flags": 1,
                    "operationName": "processNewOrder",
                    "references": [
                        {
                            "refType": "FOLLOWS_FROM",
                            "traceID": "1fea103d70eafd9d",
                            "spanID": "5f5ddc06e9adfbe2"
                        }
                    ],
                    "startTime": 1548412159952556,
                    "duration": 120938,
                    "tags": [],
                    "logs": [],
                    "processID": "p2",
                    "warnings": null
                },
                {
                    "traceID": "1fea103d70eafd9d",
                    "spanID": "47232eb96e157621",
                    "flags": 1,
                    "operationName": "extendOrderWithChildNL",
                    "references": [
                        {
                            "refType": "CHILD_OF",
                            "traceID": "1fea103d70eafd9d",
                            "spanID": "444aa53430d97add"
                        }
                    ],
                    "startTime": 1548412159952810,
                    "duration": 120683,
                    "tags": [],
                    "logs": [],
                    "processID": "p2",
                    "warnings": null
                },
                {
                    "traceID": "1fea103d70eafd9d",
                    "spanID": "a9a3acd2ef652f",
                    "flags": 1,
                    "operationName": "AssignNL",
                    "references": [
                        {
                            "refType": "CHILD_OF",
                            "traceID": "1fea103d70eafd9d",
                            "spanID": "47232eb96e157621"
                        }
                    ],
                    "startTime": 1548412159952813,
                    "duration": 105049,
                    "tags": [],
                    "logs": [],
                    "processID": "p2",
                    "warnings": null
                },
                {
                    "traceID": "1fea103d70eafd9d",
                    "spanID": "16f27898ed108612",
                    "flags": 1,
                    "operationName": "GET",
                    "references": [
                        {
                            "refType": "CHILD_OF",
                            "traceID": "1fea103d70eafd9d",
                            "spanID": "a9a3acd2ef652f"
                        }
                    ],
                    "startTime": 1548412159959000,
                    "duration": 98613,
                    "tags": [
                        {
                            "key": "http.status_code",
                            "type": "int64",
                            "value": 200
                        },
                        {
                            "key": "component",
                            "type": "string",
                            "value": "java-web-servlet"
                        },
                        {
                            "key": "span.kind",
                            "type": "string",
                            "value": "server"
                        },
                        {
                            "key": "http.url",
                            "type": "string",
                            "value": "http://children-inventory:10001/children/search/byChildName"
                        },
                        {
                            "key": "http.method",
                            "type": "string",
                            "value": "GET"
                        }
                    ],
                    "logs": [],
                    "processID": "p3",
                    "warnings": null
                },
                {
                    "traceID": "1fea103d70eafd9d",
                    "spanID": "906cfd752141ed50",
                    "flags": 1,
                    "operationName": "find",
                    "references": [
                        {
                            "refType": "CHILD_OF",
                            "traceID": "1fea103d70eafd9d",
                            "spanID": "16f27898ed108612"
                        }
                    ],
                    "startTime": 1548412160018000,
                    "duration": 1408,
                    "tags": [
                        {
                            "key": "db.instance",
                            "type": "string",
                            "value": "test"
                        },
                        {
                            "key": "component",
                            "type": "string",
                            "value": "java-mongo"
                        },
                        {
                            "key": "db.type",
                            "type": "string",
                            "value": "mongo"
                        },
                        {
                            "key": "span.kind",
                            "type": "string",
                            "value": "client"
                        },
                        {
                            "key": "db.statement",
                            "type": "string",
                            "value": "{ \"find\" : \"child\", \"filter\" : { \"name\" : \"Donald\" }, \"projection\" : { }, \"limit\" : 2, \"$db\" : \"test\", \"lsid\" : { \"id\" : { \"$binary\" : \"tgkJ++hOSUGhm+fzwfIpiw==\", \"$type\" : \"04\" } } }"
                        },
                        {
                            "key": "peer.hostname",
                            "type": "string",
                            "value": "mongo"
                        },
                        {
                            "key": "peer.port",
                            "type": "int64",
                            "value": 27017
                        },
                        {
                            "key": "peer.ipv4",
                            "type": "string",
                            "value": "172.18.0.2"
                        }
                    ],
                    "logs": [],
                    "processID": "p3",
                    "warnings": null
                },
                {
                    "traceID": "1fea103d70eafd9d",
                    "spanID": "31d2664f9d75eb1f",
                    "flags": 1,
                    "operationName": "sendMessage",
                    "references": [
                        {
                            "refType": "CHILD_OF",
                            "traceID": "1fea103d70eafd9d",
                            "spanID": "47232eb96e157621"
                        }
                    ],
                    "startTime": 1548412160058024,
                    "duration": 15258,
                    "tags": [],
                    "logs": [],
                    "processID": "p2",
                    "warnings": null
                }
            ],
            "processes": {
                "p1": {
                    "serviceName": "fancy_branch-letter-collector",
                    "tags": [
                        {
                            "key": "client-uuid",
                            "type": "string",
                            "value": "29947bd0de8fcc14"
                        },
                        {
                            "key": "hostname",
                            "type": "string",
                            "value": "a1c090c6e369"
                        },
                        {
                            "key": "ip",
                            "type": "string",
                            "value": "172.18.0.11"
                        },
                        {
                            "key": "jaeger.version",
                            "type": "string",
                            "value": "Go-2.15.0"
                        }
                    ]
                },
                "p2": {
                    "serviceName": "fancy_branch-child-nl-assigner",
                    "tags": [
                        {
                            "key": "client-uuid",
                            "type": "string",
                            "value": "3042dab1bc0a4d1b"
                        },
                        {
                            "key": "hostname",
                            "type": "string",
                            "value": "64340fbab260"
                        },
                        {
                            "key": "ip",
                            "type": "string",
                            "value": "172.18.0.8"
                        },
                        {
                            "key": "jaeger.version",
                            "type": "string",
                            "value": "Go-2.15.0"
                        }
                    ]
                },
                "p3": {
                    "serviceName": "fancy_branch-children-inventory",
                    "tags": [
                        {
                            "key": "hostname",
                            "type": "string",
                            "value": "5d2fbcd2ba81"
                        },
                        {
                            "key": "ip",
                            "type": "string",
                            "value": "172.18.0.7"
                        },
                        {
                            "key": "jaeger.version",
                            "type": "string",
                            "value": "Java-0.30.2"
                        }
                    ]
                }
            },
            "warnings": null
        }
    ],
    "total": 0,
    "limit": 0,
    "offset": 0,
    "errors": null
}
copa2 commented 5 years ago

TraceGraph is not just another representation of the timeline. It tries to compact it and remove some superfluous spans.

Regarding the trace above the missing spans have been identified as 'AnnotationSpans' and are therefore skipped (https://github.com/jaegertracing/jaeger-ui/blob/f66f73756ba0e5e5fc51ab60ea3d97b45f7ea692/packages/jaeger-ui/src/model/trace-dag/denseTransforms.js#L87-L92) Spans are made dense with a denseTransform algorithm (more info here #252).

@tiffon: Probably in TraceCompare it makes more sense to skip annotation spans. In this case it would be nice to see them in the TraceGraph. Probably a config provided to denseTransforms which decides which transforms to skip? I think when semantic conventions are considered this is not necessary.

yurishkuro commented 5 years ago

From looking at the comments in the code, the key condition for the "annotation spans" is that they are from the same process. In which case they probably shouldn't be shown in the trace graph either (unless we ensure that they truly represent a network call to itself, i.e. their span.kind values are different (client & server or producer & consumer).

copa2 commented 5 years ago

It seems that most spans above have no tags. I would expect at least to see span.kind for the missing ones. @zablvit: Which library do you use? See also https://opentracing.io/specification/conventions/

zablvit commented 5 years ago

This was an example trace to demonstrate the issue.

It seems that most spans above have no tags. I would expect at least to see span.kind for the missing ones.

@copa2 You're correct, adding tags solves the problem obviously.

However this "Compressing/Grouping" functionality is kind of hidden and I would like to have it visible, so I won't have to open an issue for such clarification. I see some nice suggestions for that in #252 like checkboxes for grouping levels, for example.

Still I would expect jaeger to show me full graph and provide options to compact it, rather than showing compacted version and make me wonder, what's going on.

tiffon commented 5 years ago

@zablvit Thanks for creating this ticket; this is great feedback.