Skip to content

Conversation

@gocanto
Copy link
Collaborator

@gocanto gocanto commented Oct 22, 2025

Summary

  • move the Prometheus configuration file into a top-level metrics directory
  • update the production docker compose volume mount to reference the new path

Testing

  • make format

https://chatgpt.com/codex/tasks/task_e_68f83aeebf408333990c8e48a1ed9bc6

@gocanto gocanto marked this pull request as draft October 22, 2025 02:09
@coderabbitai
Copy link

coderabbitai bot commented Oct 22, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch gus/add-prometheus-as-docker-service-for-caddy-2025-10-22

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @gocanto, 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 establishes a foundational monitoring setup by integrating Prometheus into the production Docker Compose environment. It enables the Caddy server to expose its metrics and deploys a dedicated Prometheus instance to collect and store this data, paving the way for comprehensive observability of the application's Caddy component.

Highlights

  • Caddy Metrics Enabled: The Caddy production configuration (Caddyfile.prod) has been updated to expose Prometheus metrics on its admin endpoint, allowing external monitoring systems to scrape performance data.
  • Prometheus Service Integration: A new Prometheus service has been added to docker-compose.yml, configured to run the Prometheus server, manage its data, and connect to the existing network.
  • Dedicated Prometheus Configuration: A new metrics/prometheus.yml file has been introduced, containing the configuration for the Prometheus server, including a scrape job specifically targeting the Caddy service.
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.

@gocanto gocanto changed the title Move Prometheus configuration into metrics directory chore: Add Prometheus Oct 22, 2025
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 aims to set up Prometheus monitoring for Caddy by moving the configuration to a new metrics directory and adding a Prometheus service to docker-compose.yml. While the overall structure is sound, the current implementation introduces two critical issues. Firstly, it exposes the Caddy admin endpoint to the internal network without any authentication, creating a significant security vulnerability. Secondly, the Prometheus service is configured to use a Docker image tag that does not exist, which will prevent the service from starting. My review provides specific feedback to address these critical problems.

Comment on lines 2 to 5
{
admin 0.0.0.0:2019
metrics
}

Choose a reason for hiding this comment

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

critical

Exposing the Caddy admin endpoint on 0.0.0.0 without any access controls is a significant security risk. The admin API allows for dynamic reconfiguration of Caddy and is not protected by authentication by default. Any other container on the caddy_net network (such as the api service) can access this endpoint and could potentially take control of the proxy. It is highly recommended to secure this endpoint. You could restrict access to only the Prometheus container's IP, or use mTLS for authentication. Given that you are already using mTLS elsewhere, that might be a robust option.

For more details, see Caddy's documentation on securing the admin endpoint: https://caddyserver.com/docs/json/admin/

- proxy

prometheus:
image: prom/prometheus:v3.0.1

Choose a reason for hiding this comment

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

critical

The specified Prometheus image version v3.0.1 does not appear to be a valid tag for the official prom/prometheus image on Docker Hub. This will cause the service to fail to start. Please use a valid and recent stable version. For example, the latest stable version is v2.53.0.

            image: prom/prometheus:v2.53.0

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant