Skip to content

Conversation

eliebleton-manomano
Copy link

What does this PR do?

This PR expands the list of supported metrics to include the ones that ship with Gitlab Runner 18.0+ as well as the new recommended docker_autoscale runner

Motivation

Would rather not pay custom metrics for those

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

github-actions bot commented Sep 4, 2025

⚠️ Recommendation: Add qa/skip-qa Label

This PR does not modify any files shipped with the agent.

To help streamline the release process, please consider adding the qa/skip-qa label if these changes do not require QA testing.

Copy link

codecov bot commented Sep 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.00%. Comparing base (ad6a704) to head (01f7982).
⚠️ Report is 15 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hestonhoffman hestonhoffman added the editorial review Waiting on a more in-depth review from a docs team editor label Sep 4, 2025
gitlab_runner.autoscaling_machine_states,gauge,,,,The current number of machines per state in this provider.,0,gitlab_runner,autoscaling machine states,
gitlab_runner.autoscaling_machine_stopping_duration_seconds_bucket,gauge,,request,second,Histogram of machine stopping time.,0,gitlab_runner,autoscaling machine stopping duration time,
gitlab_runner.autoscaling_machine_stopping_duration_seconds_count,gauge,,request,second,Histogram of machine stopping time.,0,gitlab_runner,autoscaling machine stopping duration time count,
gitlab_runner.autoscaling_machine_stopping_duration_seconds_sum,gauge,,request,second,Histogram of machine stopping time.,0,gitlab_runner,autoscaling machine stopping duration time sum,
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the update! Adding the metrics to metadata.csv does not ensures the metrics are going to be emitted. These metrics need to be allowlisted (see here). You need to add the metrics that you want to be allowed in the configuration spec.

Once you add them CI will fail telling you to update the config example. Should guide you to get it fixed.

Could you also include a changelog for this? Let me know if you need help with any of these steps.

Adding new metrics in a OpenMetricsCheck is safe since we will only emit the metrics if they are found in the Prometheus endpoint. So there is no need to split per version.

@eliebleton-manomano eliebleton-manomano changed the title add up to date metric list expand gitlab_runner supported metrics Sep 5, 2025
@eliebleton-manomano
Copy link
Author

eliebleton-manomano commented Sep 5, 2025

Sadly, the suggested ddev changelog ... command fails to locate this PR for some reason 😭

◎ ddev -x release changelog new -m "up to date go/base metrics alongside support for the docker-autoscale executor metrics"

INFO: HTTP Request: GET https://api.github.com/search/issues?q=sha%3A01f7982ca84b6cd7cab1aa1be5620aa065d21136+repo%3ADataDog%2Flocal+is%3Apull-request "HTTP/1.1 422 Unprocessable Entity"
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/ddev/cli │
│ /__init__.py:173 in main                                                                         │
│                                                                                                  │
│   170 │   manager.hook.register_commands()                                                       │
│   171 │                                                                                          │
│   172 │   try:                                                                                   │
│ ❱ 173 │   │   return ddev(prog_name='ddev', windows_expand_args=False)                           │
│   174 │   except Exception:                                                                      │
│   175 │   │   from rich.console import Console                                                   │
│   176                                                                                            │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/click/co │
│ re.py:1161 in __call__                                                                           │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/click/co │
│ re.py:1082 in main                                                                               │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/click/co │
│ re.py:1697 in invoke                                                                             │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/click/co │
│ re.py:1697 in invoke                                                                             │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/click/co │
│ re.py:1697 in invoke                                                                             │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/click/co │
│ re.py:1443 in invoke                                                                             │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/click/co │
│ re.py:788 in invoke                                                                              │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/click/de │
│ corators.py:45 in new_func                                                                       │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/ddev/cli │
│ /release/changelog/new.py:40 in new                                                              │
│                                                                                                  │
│   37 │   edited = 0                                                                              │
│   38 │   for check in app.repo.integrations.iter_changed_code(targets):                          │
│   39 │   │   if not create_command:                                                              │
│ ❱ 40 │   │   │   create_command = __get_create_command(app, entry_type, message)                 │
│   41 │   │                                                                                       │
│   42 │   │   towncrier(check.path, *create_command)                                              │
│   43 │   │   edited += 1                                                                         │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/ddev/cli │
│ /release/changelog/new.py:55 in __get_create_command                                             │
│                                                                                                  │
│   52 │   from ddev.release.constants import ENTRY_TYPES                                          │
│   53 │                                                                                           │
│   54 │   latest_commit = app.repo.git.latest_commit()                                            │
│ ❱ 55 │   pr = app.github.get_pull_request(latest_commit.sha)                                     │
│   56 │   if pr is not None:                                                                      │
│   57 │   │   pr_number = pr.number                                                               │
│   58 │   │   message_based_on_git = pr.title                                                     │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/ddev/uti │
│ ls/github.py:94 in get_pull_request                                                              │
│                                                                                                  │
│    91 │   def get_pull_request(self, sha: str) -> PullRequest | None:                            │
│    92 │   │   from json import loads                                                             │
│    93 │   │                                                                                      │
│ ❱  94 │   │   response = self.__api_get(                                                         │
│    95 │   │   │   self.ISSUE_SEARCH_API,                                                         │
│    96 │   │   │   # https://docs.github.com/en/search-github/searching-on-github/searching-iss   │
│    97 │   │   │   params={'q': f'sha:{sha} repo:{self.repo_id} is:pull-request'},                │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/ddev/uti │
│ ls/github.py:136 in __api_get                                                                    │
│                                                                                                  │
│   133 │   │   return self.__api_call('post', *args, **kwargs)                                    │
│   134 │                                                                                          │
│   135 │   def __api_get(self, *args, **kwargs):                                                  │
│ ❱ 136 │   │   return self.__api_call('get', *args, **kwargs)                                     │
│   137 │                                                                                          │
│   138 │   def __api_call(self, method, *args, **kwargs):                                         │
│   139 │   │   from httpx import HTTPError                                                        │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/ddev/uti │
│ ls/github.py:159 in __api_call                                                                   │
│                                                                                                  │
│   156 │   │   │   │   retry_wait *= 2                                                            │
│   157 │   │   │   │   continue                                                                   │
│   158 │   │   │                                                                                  │
│ ❱ 159 │   │   │   response.raise_for_status()                                                    │
│   160 │   │   │   return response                                                                │
│   161                                                                                            │
│                                                                                                  │
│ /home/x/.local/share/mise/installs/pipx-ddev/13.0.0/ddev/lib/python3.10/site-packages/httpx/_m │
│ odels.py:829 in raise_for_status                                                                 │
│                                                                                                  │
│    826 │   │   }                                                                                 │
│    827 │   │   error_type = error_types.get(status_class, "Invalid status code")                 │
│    828 │   │   message = message.format(self, error_type=error_type)                             │
│ ❱  829 │   │   raise HTTPStatusError(message, request=request, response=self)                    │
│    830 │                                                                                         │
│    831 │   def json(self, **kwargs: typing.Any) -> typing.Any:                                   │
│    832 │   │   return jsonlib.loads(self.content, **kwargs)                                      │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
HTTPStatusError: Client error '422 Unprocessable Entity' for url 'https://api.github.com/search/issues?q=sha%3A01f7982ca84b6cd7cab1aa1be5620aa065d21136+repo%3ADataDog%2Flocal+is%3Apull-request'
For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422

ddev cannot apparently be coerced from the commandline to narrow down on the appropriate PR (assuming I understood the stack trace correctly - not a given). Could you clarify what are the requirements when it comes to change logging? I imagine gitlab_runner/CHANGELOG.md needs to change, but I didn't spend the time to understand w/e it is that "towncrier" would do.

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