Skip to content

feat: add partition_of tag to postgresql.seq_scans metric #19298

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Chrisp1tv
Copy link

@Chrisp1tv Chrisp1tv commented Dec 23, 2024

What does this PR do?

At Doctolib, we need the partition_of tag for metric postgresql.seq_scans and found out it's not available 😢

Doing a PR to have it now 🎉

I would appreciate a lot some help to implement tests, as I'm not used to the structure of project nor to Python TBH :)
Could you point me the files I should update to test the new behavior?

Motivation

Using the partition_of tag in our monitors, dashboards and so on, of course! 😄
And to make Datadog even better than it already is! 🎉

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.
  • If you need to backport this PR to another branch, you can add the backport/<branch-name> label to the PR and it will automatically open a backport PR once this one is merged

Copy link

codecov bot commented Dec 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.70%. Comparing base (fdf1f78) to head (93e0637).
Report is 202 commits behind head on master.

Additional details and impacted files
Flag Coverage Δ
postgres 93.31% <ø> (+4.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@Chrisp1tv Chrisp1tv marked this pull request as ready for review December 23, 2024 14:36
@Chrisp1tv Chrisp1tv requested review from a team as code owners December 23, 2024 14:36
@Chrisp1tv
Copy link
Author

Hey 👋

As mentioned in the PR description, I would appreciate a lot some help to implement tests, at least a pointer to the files I should update to test the new behavior, and fix the broken tests.

Or if you prefer to update tests yourself, that works for me too, no problem! 😄

@Chrisp1tv Chrisp1tv changed the title add partition_of metric tag feat: add partition_of tag to postgresql.seq_scans metric Dec 23, 2024
Copy link
Contributor

@azhou-datadog azhou-datadog left a comment

Choose a reason for hiding this comment

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

Hey @Chrisp1tv 👋 ! Thanks for contributing :)
So few things - you will need to update the changelog to pass the pipeline, by running ddev release changelog new, see Details

It looks like this change will add the partition_of tag to not just postgresql.seq_scans, but also all the other metrics in the QUERY_PG_CLASS columns section. So should include that in the description of PR and changelog.
You should also update the descriptions of the corresponding metrics that have this new tag in postgres/metadata.csv

I merged your branch with master and that seems to have fixed the broken tests. As for adding new testing to cover this new tag, take a look at postgres/tests/test_relations.py and how the QUERY_PG_CLASS query is tested, especially with the expected_tags.
You may also need to take a look at the files that set up the Postgres test instance for the unit tests at postgres/tests/compose/resources/

@azhou-datadog azhou-datadog self-assigned this Jan 16, 2025
@Chrisp1tv
Copy link
Author

Hey @azhou-datadog 👋

Many thanks for the clear instructions 🙏 I'll try to have a look when I have time and get back to you if I need help!

@iliakur
Copy link
Contributor

iliakur commented Feb 21, 2025

@Chrisp1tv I've added the "WIP" label to this PR, we can remove it after you have time to implement changes.

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.

3 participants