Skip to content

feat(prometheus): Phase 2 - fix Chrome/Chrome-Go metrics gaps#1135

Merged
GrammaTonic merged 1 commit intodevelopfrom
feature/phase2-metrics-chrome-runners
Mar 2, 2026
Merged

feat(prometheus): Phase 2 - fix Chrome/Chrome-Go metrics gaps#1135
GrammaTonic merged 1 commit intodevelopfrom
feature/phase2-metrics-chrome-runners

Conversation

@GrammaTonic
Copy link
Owner

Summary

Fixes the remaining gaps in the Phase 2 Prometheus metrics implementation for Chrome and Chrome-Go runners (Issue #1060, TASK-013 through TASK-019).

All code-level tasks were already implemented on develop, but four blockers/gaps prevented successful build and runtime validation (TASK-020 through TASK-026). This PR addresses all four.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Configuration change

Related Issues

Changes Made

1. Add netcat-openbsd to Chrome Dockerfiles (BLOCKER fix)

metrics-server.sh requires nc (netcat). The standard Dockerfile already installs netcat-openbsd, but both Chrome variants were missing it. Without this, the metrics HTTP server silently fails at runtime.

  • docker/Dockerfile.chrome - added netcat-openbsd to apt-get install
  • docker/Dockerfile.chrome-go - added netcat-openbsd to apt-get install

2. Reorder Chrome entrypoint token validation

entrypoint-chrome.sh checked GITHUB_TOKEN before starting metrics, despite a comment saying Start metrics services BEFORE token validation. The standard entrypoint.sh correctly starts metrics first. This reordering matches that pattern and enables standalone metrics testing.

3. Update Prometheus scrape targets

monitoring/prometheus.yml still had the stale placeholder runner:8080. Updated to per-variant scrape jobs matching the actual Docker Compose service names and ports.

4. Document metrics env vars in config examples

Added RUNNER_TYPE, METRICS_PORT, and METRICS_UPDATE_INTERVAL entries to config/chrome-runner.env.example and config/chrome-go-runner.env.example.

Checklist

  • I have performed a self-review of my code
  • My changes generate no new warnings
  • Changes are backward-compatible
  • Port mappings follow the established convention (9091 internal, unique host ports)

Add netcat-openbsd to Dockerfile.chrome and Dockerfile.chrome-go
apt-get blocks so the metrics-server.sh nc dependency is satisfied.

Reorder entrypoint-chrome.sh to start the Prometheus metrics collector
and HTTP server BEFORE the GITHUB_TOKEN/GITHUB_REPOSITORY checks,
matching the standard entrypoint pattern and enabling standalone
metrics testing without runner registration.

Update monitoring/prometheus.yml scrape targets from the stale
runner:8080 placeholder to per-variant jobs: github-runner-main:9091,
github-runner-chrome:9091, and github-runner-chrome-go:9091.

Add RUNNER_TYPE, METRICS_PORT, and METRICS_UPDATE_INTERVAL entries to
config/chrome-runner.env.example and config/chrome-go-runner.env.example
so users discover the metrics configuration options.

Closes #1060 (TASK-013 through TASK-019 code changes)
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses and resolves several critical gaps in the Phase 2 Prometheus metrics implementation for Chrome and Chrome-Go runners. It ensures that metrics collection functions correctly by installing necessary dependencies, reordering initialization logic for proper startup, and updating Prometheus configuration to accurately target the different runner types. The changes aim to provide complete and reliable observability for these runner environments.

Highlights

  • Dependency Addition: Added the netcat-openbsd package to both Chrome and Chrome-Go Dockerfiles, resolving a silent failure in the metrics HTTP server due to a missing dependency.
  • Entrypoint Reordering: Reordered the entrypoint-chrome.sh script to validate GITHUB_TOKEN after starting metrics services, aligning with the standard entrypoint and enabling standalone metrics testing.
  • Prometheus Configuration Update: Updated monitoring/prometheus.yml to replace a stale placeholder with specific scrape jobs for standard, Chrome, and Chrome-Go runners, ensuring correct metrics collection.
  • Documentation Enhancement: Documented key Prometheus metrics environment variables (RUNNER_TYPE, METRICS_PORT, METRICS_UPDATE_INTERVAL) in config/chrome-runner.env.example and config/chrome-go-runner.env.example.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • config/chrome-go-runner.env.example
    • Added optional Prometheus metrics configuration variables (RUNNER_TYPE, METRICS_PORT, METRICS_UPDATE_INTERVAL) with comments.
  • config/chrome-runner.env.example
    • Added optional Prometheus metrics configuration variables (RUNNER_TYPE, METRICS_PORT, METRICS_UPDATE_INTERVAL) with comments.
  • docker/Dockerfile.chrome
    • Installed netcat-openbsd package, required for the metrics endpoint.
  • docker/Dockerfile.chrome-go
    • Installed netcat-openbsd package, required for the metrics endpoint.
  • docker/entrypoint-chrome.sh
    • Moved GITHUB_TOKEN and GITHUB_REPOSITORY validation to occur after metrics setup, allowing standalone metrics testing.
  • monitoring/prometheus.yml
    • Replaced the generic 'github-runner' job with specific scrape configurations for 'github-runner-standard', 'github-runner-chrome', and 'github-runner-chrome-go', each targeting their respective service names and ports.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request addresses several gaps in the Prometheus metrics implementation for Chrome and Chrome-Go runners. It correctly adds netcat-openbsd to the Docker images, reorders the entrypoint script logic to allow standalone metrics testing, and updates the example environment files with metrics-related variables. The changes are well-structured and align with the goals described. I have one suggestion for the prometheus.yml file to improve maintainability by reducing configuration duplication using YAML anchors. Overall, this is a solid contribution to enhance the monitoring capabilities.

Comment on lines +51 to 73
# GitHub Runner application metrics - Standard runner
- job_name: "github-runner-standard"
static_configs:
- targets: ["runner:8080"]
- targets: ["github-runner-main:9091"]
scrape_interval: 15s
metrics_path: /metrics
scrape_timeout: 10s

# GitHub Runner application metrics - Chrome runner
- job_name: "github-runner-chrome"
static_configs:
- targets: ["github-runner-chrome:9091"]
scrape_interval: 15s
metrics_path: /metrics
scrape_timeout: 10s

# GitHub Runner application metrics - Chrome-Go runner
- job_name: "github-runner-chrome-go"
static_configs:
- targets: ["github-runner-chrome-go:9091"]
scrape_interval: 15s
metrics_path: /metrics
scrape_timeout: 10s

Choose a reason for hiding this comment

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

medium

This is a great update to the scrape configurations. To improve maintainability and reduce duplication, you could consider using YAML anchors. This would allow you to define common scrape parameters like scrape_interval once and reuse them across all runner jobs. This makes future updates to these parameters easier as you'd only need to change them in one place.

  # GitHub Runner application metrics - Standard runner
  - job_name: "github-runner-standard"
    static_configs:
      - targets: ["github-runner-main:9091"]
    scrape_interval: &scrape_interval 15s
    metrics_path: &metrics_path /metrics
    scrape_timeout: &scrape_timeout 10s

  # GitHub Runner application metrics - Chrome runner
  - job_name: "github-runner-chrome"
    static_configs:
      - targets: ["github-runner-chrome:9091"]
    scrape_interval: *scrape_interval
    metrics_path: *metrics_path
    scrape_timeout: *scrape_timeout

  # GitHub Runner application metrics - Chrome-Go runner
  - job_name: "github-runner-chrome-go"
    static_configs:
      - targets: ["github-runner-chrome-go:9091"]
    scrape_interval: *scrape_interval
    metrics_path: *metrics_path
    scrape_timeout: *scrape_timeout

@GrammaTonic GrammaTonic merged commit 8c60b26 into develop Mar 2, 2026
21 checks passed
@GrammaTonic GrammaTonic deleted the feature/phase2-metrics-chrome-runners branch March 2, 2026 00:25
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.

1 participant