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

[Debugger] Ensure all probes have a version property #3581

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

watson
Copy link
Contributor

@watson watson commented Nov 28, 2024

Motivation

All probes sent via Remote Config should have a root version property. For some reason, one was not present in our mocked probe configs located in tests/debugger/probes. I'm not sure why this hasn't resulted in system test errors previously since the diagnostics schema expects that a version is reported. However, without this, at least the Node.js tracer, would set version: undefined in the object before it was serialized to JSON, which would completely remove the version property from the JSON output.

Maybe they other tracers fall back to 0 if there's no version property in the probe config?

Changes

Hardcode all mocked probe configs to contain version: 0.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes (if something not related to your task is failing, you can ignore it)
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner. We're working on refining the codeowners file quickly.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • If PR title starts with [<language>], double-check that only <language> is impacted by the change
  • No system-tests internal is modified. Otherwise, I have the approval from R&P team
  • CI is green, or failing jobs are not related to this change (and you are 100% sure about this statement)
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added (or removed)?

Copy link
Contributor Author

watson commented Nov 28, 2024

@watson watson force-pushed the watson/probe-has-version branch from 9a29d68 to 9f8b315 Compare December 12, 2024 19:34
@watson watson changed the base branch from watson/optional-array to main December 12, 2024 19:34
@watson watson marked this pull request as ready for review December 12, 2024 19:34
@watson watson requested review from a team as code owners December 12, 2024 19:34
Copy link
Collaborator

@robertomonteromiguel robertomonteromiguel left a comment

Choose a reason for hiding this comment

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

From the system-tests core point of view it is correct. But you would need the approval of other teams.

@p-datadog p-datadog changed the title [Debugger] Ensure all probes has a version property [Debugger] Ensure all probes have a version property Dec 13, 2024
@p-datadog
Copy link
Member

This PR seems reasonable since it only adds a field to the input (which I believe Ruby implementation will ignore), but I will test locally before adding my checkmark.

Copy link
Contributor

@shurivich shurivich left a comment

Choose a reason for hiding this comment

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

We have a method of enriching all probes with required information.

def _enrich_probes(probes):

I suggest to add the code:
probe["version"] = 0

after the line

probe["language"] = language

instead of modifying all json probe files.

@watson
Copy link
Contributor Author

watson commented Dec 15, 2024

What's the reason we don't want to update the json at the source?

@shurivich
Copy link
Contributor

shurivich commented Dec 15, 2024

What's the reason we don't want to update the json at the source?

Single responsibility - updates are handled in one place, ensuring clarity.
Less changes.

But maybe it's just a matter of code taste, so it's up to you to decide.
Wanted to make sure that you're aware of this option, too.

@watson
Copy link
Contributor Author

watson commented Dec 16, 2024

@shurivich I think it makes a lot of sense to have a way to dynamically update the JSON to suite the language being instrumented and other non-fixed properties - exactly like you've done in tests/debugger/utils.py - otherwise we'd end up with a lot of duplication 👍

However, the version property is currently static - just like the id property - and doesn't depend on the tracer (this isn't the version of the tracer, but the "probe version" and is tightly connected to the id).

So if you don't mind, I'll just leave it as is - at least for now. I think that makes it easier to understand the schema when just viewing the JSON file. Anyways, we can always refactor it if we want to make to the probe version dynamic ☺️

@watson watson merged commit b35b255 into main Dec 16, 2024
282 of 283 checks passed
@watson watson deleted the watson/probe-has-version branch December 16, 2024 08:06
cbeauchesne added a commit that referenced this pull request Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants