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

Print the metric list when parsing a prometheus endpoint #15586

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

FlorentClarret
Copy link
Member

@FlorentClarret FlorentClarret commented Aug 16, 2023

What does this PR do?

Print the metric list when parsing a prometheus endpoint

Motivation

We use this list in the tests

Before:

╰─❯ ddev meta prom parse -f ray_head.txt ray                                                                                                                                                                                                                                                                                                                         ─╯

Globally available options:
    t - Append .total to the available options
    s - Skip
    q - Quit

(1 of 1) python_gc_objects_collected_total
         Type: counter
         Info: Objects collected during gc

1 - python.gc.objects.collected.total
2 - python.gc.objects.collected_total
3 - python.gc.objects_collected.total
4 - python.gc.objects_collected_total
5 - python.gc_objects.collected.total
6 - python.gc_objects.collected_total
7 - python.gc_objects_collected.total
8 - python.gc_objects_collected_total
9 - python_gc.objects.collected.total
10 - python_gc.objects.collected_total
11 - python_gc.objects_collected.total
12 - python_gc.objects_collected_total
13 - python_gc_objects.collected.total
14 - python_gc_objects.collected_total
15 - python_gc_objects_collected.total
16 - python_gc_objects_collected_total
q - Quit
Choose an option (default 16, as-is): 
python_gc_objects_collected_total

Writing `/Users/florent.clarret/go/src/github.com/DataDog/integrations-core/ray/metadata.csv`... success!
METRIC_MAP = {
    'python_gc_objects_collected_total': 'python_gc_objects_collected_total',
}

After:

╰─❯ ddev meta prom parse -f ray_head.txt ray                                                                                                                                                                                                                                                                                                                         ─╯

Globally available options:
    t - Append .total to the available options
    s - Skip
    q - Quit

(1 of 1) python_gc_objects_collected_total
         Type: counter
         Info: Objects collected during gc

1 - python.gc.objects.collected.total
2 - python.gc.objects.collected_total
3 - python.gc.objects_collected.total
4 - python.gc.objects_collected_total
5 - python.gc_objects.collected.total
6 - python.gc_objects.collected_total
7 - python.gc_objects_collected.total
8 - python.gc_objects_collected_total
9 - python_gc.objects.collected.total
10 - python_gc.objects.collected_total
11 - python_gc.objects_collected.total
12 - python_gc.objects_collected_total
13 - python_gc_objects.collected.total
14 - python_gc_objects.collected_total
15 - python_gc_objects_collected.total
16 - python_gc_objects_collected_total
q - Quit
Choose an option (default 16, as-is): 
python_gc_objects_collected_total

Writing `/Users/florent.clarret/go/src/github.com/DataDog/integrations-core/ray/metadata.csv`... success!

METRIC_MAP = {
    'python_gc_objects_collected_total': 'python_gc_objects_collected_total',
}

METRICS = [
    'python_gc_objects_collected_total',
]

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Changelog entries must be created for modifications to shipped code
  • Add the qa/skip-qa label if the PR doesn't need to be tested during QA.

@FlorentClarret FlorentClarret requested a review from a team as a code owner August 16, 2023 12:33
@FlorentClarret FlorentClarret force-pushed the florentclarret/dcd/prom_metric_list branch from 1d4a73f to 328518a Compare August 16, 2023 12:37
@FlorentClarret FlorentClarret requested a review from a team as a code owner August 16, 2023 12:37
@ghost ghost added the documentation label Aug 16, 2023
@github-actions
Copy link

github-actions bot commented Aug 16, 2023

Test Results

    4 files      4 suites   4m 5s ⏱️
418 tests 418 ✔️   0 💤 0
936 runs  903 ✔️ 33 💤 0

Results for commit 971dadd.

♻️ This comment has been updated with latest results.

@FlorentClarret FlorentClarret force-pushed the florentclarret/dcd/prom_metric_list branch from 328518a to b357c27 Compare August 16, 2023 12:53
alopezz
alopezz previously approved these changes Aug 16, 2023
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #15586 (971dadd) into master (14a02fc) will increase coverage by 0.00%.
The diff coverage is n/a.

Flag Coverage Δ
datadog_checks_dev 82.51% <ø> (+0.07%) ⬆️

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

steveny91
steveny91 previously approved these changes Aug 16, 2023
buraizu
buraizu previously approved these changes Aug 16, 2023
Copy link
Contributor

@buraizu buraizu left a comment

Choose a reason for hiding this comment

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

Thanks, approving with a minor update to the changelog

datadog_checks_dev/CHANGELOG.md Outdated Show resolved Hide resolved
@FlorentClarret FlorentClarret dismissed stale reviews from buraizu, steveny91, and alopezz via d240f61 August 17, 2023 05:40
@FlorentClarret FlorentClarret force-pushed the florentclarret/dcd/prom_metric_list branch from d240f61 to 971dadd Compare August 17, 2023 05:52
@FlorentClarret FlorentClarret requested a review from alopezz August 17, 2023 05:52
@FlorentClarret FlorentClarret merged commit 83d067b into master Aug 17, 2023
@FlorentClarret FlorentClarret deleted the florentclarret/dcd/prom_metric_list branch August 17, 2023 08:23
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.

4 participants