digma-ai / digma-intellij-plugin

Digma JetBrains plugin
MIT License
31 stars 7 forks source link

Add data about span insights for the Jaeger UI #669

Closed kshmidt-digma closed 1 year ago

kshmidt-digma commented 1 year ago

To display insights in Jaeger UI for each span plugin needs to provide additional payload in message.

API changes:

  1. Message names have been replaced to avoid confusion and be more accurate to the their current behaviour:

    • GET_SPANS_WITH_RESOLVED_LOCATION -> GET_SPANS_DATA
    • SET_SPANS_WITH_RESOLVED_LOCATION -> SET_SPANS_DATA
  2. SET_SPANS_DATA message payload should be the following:

    {
      hasCodeLocation: boolean,
      insights: { type: string, importance: number }[],
    },
    ...   
    }

Example:

{
   "2e55147853e81b6e": {
      "hasCodeLocation": true,
      "insights": [
         {
            "type":"SpanDurations",
            "importance":2
         },
         {
            "type":"SlowEndpoint",
            "importance":5
         },
         {
            "type":"SlowestSpans",
            "importance":7
         },
         {
            "type":"Errors",
            "importance":2
         }
      ]
   },
   "3a53147854e11c6a": {
      "hasCodeLocation": false,
      "insights": []
   }
}

Dev noted: We should show all insights related to the span, currently in the backend we are getting only high-importance insights so this filter should be removed.

shalom938 commented 1 year ago

@kshmidt-digma @shaykeren @doppleware

See PR: add data about span insights jaeger

questions:

1) can there be no insights for a span?

I mean that getInsights returns empty list. see here: JaegerUIService

2) I filtered Unmapped insights from getInsights, is that ok? see JaegerUIService

3) can there be more then one insight with same type for a span? if not then we don't need this distinct function: distinctByType

4) Sometimes there are two trace buttons that want to show the same span+traceId, for example in method OwnerRepository#findPetTypes. They will show the same editor.