Skip to content

Create spans for webhooks as well#317

Merged
albertvaka merged 3 commits into
masterfrom
albertvaka/spans-in-webhooks
Nov 17, 2022
Merged

Create spans for webhooks as well#317
albertvaka merged 3 commits into
masterfrom
albertvaka/spans-in-webhooks

Conversation

@albertvaka

@albertvaka albertvaka commented Nov 10, 2022

Copy link
Copy Markdown
Collaborator

What does this PR do?

Makes the classes that serialize pipelines to webhooks generate a span id and trace id, similar to the classes that serialize to traces.

Description of the Change

datadog-ci relies on us setting the trace and span ids as env vars, which wasn't working for Agentless (sending webhooks instead of traces). We already have code to set these env vars and they are correctly populated since this uses the same logic we have in the classes that generate traces.

Verification Process

  • Run with finer level logging so the payloads are printed and verify that job, stage and pipeline webhook payloads contain span_id and trace_id (and that trace_id is the same for all the jobs from a same pipeline).
  • Print $DD_CUSTOM_TRACE_ID and $DD_CUSTOM_PARENT_ID in a job and check they the trace and span ids from the payloads.

Review checklist (to be filled by reviewers)

  • Feature or bug fix MUST have appropriate tests (unit, integration, etc...)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have one changelog/ label attached. If applicable it should have the backward-incompatible label attached.
  • PR should not have do-not-merge/ label attached.
  • If Applicable, issue must have kind/ and severity/ labels attached at least.

@drodriguezhdez drodriguezhdez left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albertvaka

Copy link
Copy Markdown
Collaborator Author

👍 I'll look at DatadogGraphListenerTest and add tests in a separate PR.

@albertvaka
albertvaka merged commit d01dce4 into master Nov 17, 2022
@albertvaka
albertvaka deleted the albertvaka/spans-in-webhooks branch November 17, 2022 16:34
@albertvaka albertvaka added changelog/no-changelog Changes don't appear in changelog changelog/Changed Changed features results into a major version bump changelog/Added Added features results into a minor version bump and removed changelog/no-changelog Changes don't appear in changelog changelog/Changed Changed features results into a major version bump labels Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/Added Added features results into a minor version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants