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: Correct tags for each span are shown #41473

Merged
merged 3 commits into from
Nov 12, 2021

Conversation

ivanahuckova
Copy link
Member

What this PR does / why we need it:
We were showing wrong tags in spans. More context here: https://raintank-corp.slack.com/archives/CPXKS6FB5/p1634297506265900

To fix this, we have decided to have 1-1 relationship between span and process. We are using spanID as a key as it should be unique within the trace.

Which issue(s) this PR fixes:

Fixes #40625

Special notes for your reviewer:

I have added test for this. You can also upload this trace to see the difference (after JSON upload fix is merged #41455):

{
  "batches": [
    {
      "resource": {
        "attributes": [
          {
            "key": "service.name",
            "value": {
              "stringValue": "frontend"
            }
          },
          {
            "key": "host.name",
            "value": {
              "stringValue": "frontend-1"
            }
          }
        ]
      },
      "instrumentationLibrarySpans": [
        {
          "instrumentationLibrary": {},
          "spans": [
            {
              "traceId": "AAAAAAAAAACEiiIwxeKP9A==",
              "spanId": "hIoiMMXij/Q=",
              "name": "frontend",
              "startTimeUnixNano": "1634296766948000000",
              "endTimeUnixNano": "1634296767232000000",
              "attributes": [],
              "status": {}
            }
          ]
        }
      ]
    },
    {
      "resource": {
        "attributes": [
          {
            "key": "service.name",
            "value": {
              "stringValue": "querier"
            }
          },
          {
            "key": "host.name",
            "value": {
              "stringValue": "querier-1"
            }
          }
        ]
      },
      "instrumentationLibrarySpans": [
        {
          "instrumentationLibrary": {},
          "spans": [
            {
              "traceId": "AAAAAAAAAACEiiIwxeKP9A==",
              "spanId": "MdmmKDpzjyE=",
              "parentSpanId": "hIoiMMXij/Q=",
              "name": "span from querier-1",
              "startTimeUnixNano": "1634296766990000000",
              "endTimeUnixNano": "1634296767167000000",
              "attributes": [],
              "status": {}
            }
          ]
        }
      ]
    },
    {
      "resource": {
        "attributes": [
          {
            "key": "service.name",
            "value": {
              "stringValue": "querier"
            }
          },
          {
            "key": "host.name",
            "value": {
              "stringValue": "querier-2"
            }
          }
        ]
      },
      "instrumentationLibrarySpans": [
        {
          "instrumentationLibrary": {},
          "spans": [
            {
              "traceId": "AAAAAAAAAACEiiIwxeKP9A==",
              "spanId": "mwJYmrj4CBs=",
              "parentSpanId": "hIoiMMXij/Q=",
              "name": "span from querier-2",
              "startTimeUnixNano": "1634296767133000000",
              "endTimeUnixNano": "1634296767147000000",
              "attributes": [],
              "status": {}
            }
          ]
        }
      ]
    }
  ]
}

@ivanahuckova ivanahuckova added this to the 8.2.4 milestone Nov 9, 2021
@ivanahuckova ivanahuckova requested a review from a team November 9, 2021 12:44
@ivanahuckova ivanahuckova self-assigned this Nov 9, 2021
@ivanahuckova ivanahuckova requested review from connorlindsey and removed request for a team November 9, 2021 12:44
@ivanahuckova ivanahuckova merged commit bf2ece7 into main Nov 12, 2021
@ivanahuckova ivanahuckova deleted the ivana/fix-processses-matching branch November 12, 2021 09:43
grafanabot pushed a commit that referenced this pull request Nov 12, 2021
ivanahuckova added a commit that referenced this pull request Nov 15, 2021
* Tracing: Add processes for each span (#41473)

(cherry picked from commit bf2ece7)

* Remove test for backport to fix yarn upgrade related issues

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Ivana <ivana.huckova@gmail.com>
@dprokop dprokop changed the title Tracing: Show correct tags for each span Tracing: Correct tags for each span are shown Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong tags shown in spans
3 participants