feat(examples & workflows): Draft PR for adding prometheus-3 example - #330
feat(examples & workflows): Draft PR for adding prometheus-3 example#330SerbaC6 wants to merge 2 commits into
Conversation
razvand
left a comment
There was a problem hiding this comment.
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.
9e3a7db to
f6c70e6
Compare
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>
f6c70e6 to
5994f55
Compare
There was a problem hiding this comment.
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/, andprometheus.ymlloadsrules/*.yml, but this image copies onlyprometheus.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:latestplus an unversionedapk add prometheusdoes not pin the Prometheus major version. A future Alpine update can install a different major even though the directory is namedprometheus-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
unikraftexample explicitly configures port 443 astls+http, but thiskraftcommand 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
Kraftfileis 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 alongsideDockerfile(for example,httpserver-nginx-vite-vanilla/README.md:121andnode24-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,
labelsis placed as a field of themy-appscrape config. Prometheus only accepts these labels inside thestatic_configstarget 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.
| FROM alpine:latest | ||
|
|
||
| RUN apk add --no-cache prometheus && \ |
|
|
||
| rootfs: | ||
| source: ./Dockerfile | ||
| format: erofs |
| 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/ |
| global: | ||
| # How often to scrape targets | ||
| scrape_interval: 15s |
No description provided.