digma-ai / digma-vscode-plugin

🧑‍💻 Visual Studio Code extension for Digma
https://www.digma.ai/
MIT License
23 stars 2 forks source link

Scaling Breakdown UI #247

Closed asafchen-dig closed 1 year ago

asafchen-dig commented 1 year ago

The task is about adding an additional data to the ScalingInsight. In order to see this insight:

  1. Clone https://github.com/digma-ai/otel-sample-application-dotnet repo
  2. Run Sample.MoneyTransfer.API project
  3. Run ClientTester project
  4. Hover the method SampleInsightsController.Lock

Image

The new section in the insight json:

"rootCauseSpans": [
      {
        "sampleTraceId": "794DBD49DC6678ACFF80A1EDBDC41BF5",
        "name": "WaitForLock",
        "displayName": "WaitForLock",
        "instrumentationLibrary": "SampleInsightsController",
        "serviceName": null,
        "codeObjectId": null,
        "kind": "Internal"
      }
]

Note that the RootCauseSpan contains all the fields of SpanInfo, which is used to find the span in the code

The whole insight json:

{
    "category": "Performance",
    "specifity": 4,
    "scope": "Span",
    "name": "Scaling Issue Found",
    "type": "SpanScaling",
    "importance": 2,
    "spanName": "HTTP GET SampleInsights/lock/{milisec}",
    "turningPointConcurrency": 12,
    "maxConcurrency": 16,
    "minDuration": {
      "value": 2.12,
      "unit": "sec",
      "raw": 2118018500
    },
    "maxDuration": {
      "value": 8.92,
      "unit": "sec",
      "raw": 8920343606.25
    },
    "rootCauseSpans": [
      {
        "sampleTraceId": "794DBD49DC6678ACFF80A1EDBDC41BF5",
        "name": "WaitForLock",
        "displayName": "WaitForLock",
        "instrumentationLibrary": "SampleInsightsController",
        "serviceName": null,
        "codeObjectId": null,
        "kind": "Internal"
      }
    ],
    "shortDisplayInfo": {
      "title": "",
      "targetDisplayName": "",
      "subtitle": "",
      "description": ""
    },
    "codeObjectId": "Sample.MoneyTransfer.API.Controllers.SampleInsightsController$_$Lock(Double)",
    "decorators": [
      {
        "title": "Scaling badly",
        "description": "This code experiences exponential grows in duration after 12 concurrent executions"
      }
    ],
    "environment": "ASAFC-LAPTOP[LOCAL]",
    "severity": 0,
    "prefixedCodeObjectId": "method:Sample.MoneyTransfer.API.Controllers.SampleInsightsController$_$Lock(Double)",
    "customStartTime": null,
    "actualStartTime": "2023-01-09T00:00:00Z"
  }