Skip to content

feat(examples & workflows): Draft PR for adding prometheus-3 example - #330

Open
SerbaC6 wants to merge 2 commits into
unikraft-cloud:mainfrom
SerbaC6:serbanc/prometheus
Open

feat(examples & workflows): Draft PR for adding prometheus-3 example#330
SerbaC6 wants to merge 2 commits into
unikraft-cloud:mainfrom
SerbaC6:serbanc/prometheus

Conversation

@SerbaC6

@SerbaC6 SerbaC6 commented May 9, 2026

Copy link
Copy Markdown

No description provided.

@SerbaC6
SerbaC6 marked this pull request as ready for review May 9, 2026 09:41
@razvand
razvand self-requested a review May 9, 2026 10:13

@razvand razvand left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where is the Kraftfile for your example? Add the version number in the directory name.

Use your proper name in the commit message. Use Serban Ciumacencu, not SerbaC6.

Use a single commit. A commit is a unit of contribution. It can't reference a pull request, it can't be something thought of as draft. A commit is NOT a history of your struggles. A commit is an atomic contribution. Think of that when you create a commit. See instructions here and use the model of commits in the commit history.

@SerbaC6
SerbaC6 force-pushed the serbanc/prometheus branch from 9e3a7db to f6c70e6 Compare May 9, 2026 19:23
SerbaC6 added 2 commits May 9, 2026 22:28
    Add a Prometheus 3.x example for Unikraft deployment based on Alpine Linux.

    The example includes:
    - Dockerfile: builds a minimal image using the Prometheus package pulled
      directly from the official Alpine Linux repositories
    - Kraftfile: defines the Unikraft deployment specification, including the
      runtime, erofs filesystem packaging, and startup command flags
    - prometheus.yml: provides the base scraping configuration, intervals,
      and static target definitions for the Prometheus instance
    - README.md: provides deployment instructions and configuration details

    The directory is explicitly named prometheus-3 rather than latest to
    track the current 3.x package provided by Alpine Linux, future-proofing
    the example against breaking changes in subsequent major releases.

    Signed-off-by: Serban Ciumacencu <serbaciumacencu@gmail.com>
    Introduce two GitHub Actions workflows to continuously test the
    prometheus-3 example against Unikraft Cloud environments.

    Workflows added:
    - example-prometheus-3-staging.yaml: targets the staging environment
    - example-prometheus-3-stable.yaml: targets the stable environment

    Each workflow is triggered on push and pull request to paths under
    prometheus-3/, as well as on a weekday schedule (Mon-Fri at 15:00 UTC).
    Both use kraftkit@staging to build and deploy the example via
    kraft cloud deploy, start the instance, assert the endpoint is
    reachable with curl, and unconditionally tear down the instance and
    image on completion.

    Signed-off-by: Serban Ciumacencu <serbaciumacencu@gmail.com>
@SerbaC6
SerbaC6 force-pushed the serbanc/prometheus branch from f6c70e6 to 5994f55 Compare May 9, 2026 19:30
@SerbaC6 SerbaC6 changed the title feat(examples): Draft PR for adding Prometheus example feat(examples & workflows): Draft PR for adding prometheus-3 example May 9, 2026
@SerbaC6
SerbaC6 requested a review from razvand May 16, 2026 07:55
@razvand
razvand requested a lite review from Copilot August 21, 2026 07:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a Prometheus 3 example for Unikraft Cloud, including configuration, container/runtime definitions, documentation, and deployment workflows.

Changes:

  • Adds Prometheus configuration and build files.
  • Adds usage and customization documentation.
  • Adds staging and stable workflows.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Review summary
prometheus-3/README.md Nit (4 votes): Quickstart paths reference examples/prometheus instead of examples/prometheus-3.
prometheus-3/prometheus.yml Critical (4 votes): Invalid indentation causes Prometheus configuration startup failures; reindent the complete file.
prometheus-3/Kraftfile Critical (1 vote): Read-only erofs conflicts with TSDB/WAL writes under /prometheus; provide writable storage.
prometheus-3/Dockerfile Moderate (3 votes): Alpine and Prometheus package versions are unpinned, so Prometheus 3 is not guaranteed.
.github/workflows/example-prometheus-3-staging.yaml No final comments.
.github/workflows/example-prometheus-3-stable.yaml No final comments.
Suppressed comments (6)

prometheus-3/Dockerfile:6

  • The README says users can add rule files under rules/, and prometheus.yml loads rules/*.yml, but this image copies only prometheus.yml. Any rules added as documented are therefore absent from the rootfs and will not be loaded. Copy the rules into the image (with a matching in-image path) or remove/update that customization guidance.
COPY prometheus.yml /etc/prometheus/prometheus.yml

prometheus-3/README.md:148

  • alpine:latest plus an unversioned apk add prometheus does not pin the Prometheus major version. A future Alpine update can install a different major even though the directory is named prometheus-3, so the note's compatibility and future-proofing claim is false. Pin the base/package versions or remove the version-specific claim.
* `FROM alpine:latest`: Use the latest Alpine Linux image as the base. 
  *(Note: The directory for this example is explicitly named `prometheus-3` because `alpine:latest` currently provides the 3.x series of Prometheus. This version pinning ensures the `prometheus.yml` configuration remains compatible and future-proofs the example against breaking changes in future major releases).*

prometheus-3/README.md:45

  • The unikraft example explicitly configures port 443 as tls+http, but this kraft command omits the protocol. That changes the port mapping and can leave the HTTPS URL used in the following steps unable to reach Prometheus; keep the two commands equivalent.
kraft cloud deploy -p 443:9090 -M 2Gi .

prometheus-3/README.md:143

  • Kraftfile is omitted from the customization list even though this new file controls the runtime/rootfs format and the Prometheus startup command. Comparable example READMEs document it alongside Dockerfile (for example, httpserver-nginx-vite-vanilla/README.md:121 and node24-karaoke/README.md:119), so readers are not told where to change these settings.
To customize the app, update the files in the repository, listed below:

* `prometheus.yml`: the Prometheus configuration file
* `Dockerfile`: the Docker-specified app filesystem

prometheus-3/README.md:82

  • The sample network UUID contains g, which is not a hexadecimal UUID character, so this cannot be output from the CLI and makes the example misleading. Replace it with a valid UUID-shaped value.
- uuid:       a3ccf7b2-82e4-6693-14b3-2f53663g5eae

prometheus-3/prometheus.yml:56

  • Even after the general indentation is corrected, labels is placed as a field of the my-app scrape config. Prometheus only accepts these labels inside the static_configs target group, beneath - targets; in the current structure configuration validation fails.
labels:
service: my-app
team: backend

馃挕 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread prometheus-3/Dockerfile
Comment on lines +1 to +3
FROM alpine:latest

RUN apk add --no-cache prometheus && \
Comment thread prometheus-3/Kraftfile

rootfs:
source: ./Dockerfile
format: erofs
Comment thread prometheus-3/README.md
Comment on lines +12 to +16
2. Clone the [`examples` repository](https://github.com/unikraft-cloud/examples) and `cd` into the `examples/prometheus/` directory:

```bash
git clone https://github.com/unikraft-cloud/examples
cd examples/prometheus/
Comment on lines +3 to +5
global:
# How often to scrape targets
scrape_interval: 15s
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.

4 participants