Skip to content
← All apps

Prometheus with editable configuration

Store scrape jobs and recording rules in an ordinary mounted Prometheus configuration file.

Choose your deployment and the way you want to use Selfhost. The instructions below follow that choice.

Set up Prometheus with editable configuration

Store scrape jobs and recording rules in an ordinary mounted Prometheus configuration file.

Customize deployment inputs (1)
Local HTTP port port
portDefault: 9090

Save this as inputs.json and adjust the values before initialization.

{
  "port": 9090
}
selfhost app --directory ./prometheus-configured init prometheus-configured --stack --inputs inputs.json

Initialization writes portable files and does not start the app. Review compose.yaml, the private .env and any files in files/, then start it:

selfhost app --directory ./prometheus-configured start

No Selfhost dashboard or background service is needed. You can also start these files directly:

cd prometheus-configured
docker compose -f compose.yaml up -d
  • Edit native scrape configuration through App settings or files/prometheus.yml.
  • Run Check configuration before restarting to apply a file change.
  • Add remote scrape targets only across a trusted network and configure TLS/authentication for each target. Prometheus has no application OIDC login; protect its HTTP interface at the proxy.

Prometheus integrations

Compose service: prometheus. These operations use the profile saved when this deployment is created.

  • Use the Editable configuration deployment method. The basic Docker image keeps its image-provided configuration. Validate with promtool before restarting.

Native settings

Changes use the app’s native YAML file. Unrelated settings are preserved.

Supported fields (5)
Default scrape interval scrape-interval
stringLength: 2 to unbounded characters
Rule evaluation interval evaluation-interval
stringLength: 2 to unbounded characters
External labels external-labels
json
Scrape jobs scrape-jobs
json
Rule files rule-files
string_list

Save a JSON map of the field IDs you want to change as changes.json. Replace FIELD_ID with an ID from the supported fields above, and use its declared value type. Review the plan and replace REVIEWED_REVISION with the revision it returns.

{
  "FIELD_ID": "YOUR_VALUE"
}
selfhost app --directory ./prometheus-configured config prometheus
selfhost app --directory ./prometheus-configured plan prometheus changes.json
selfhost app --directory ./prometheus-configured apply prometheus changes.json --revision REVIEWED_REVISION

Saved changes need service recreation to become active. Existing interpolated environment values stay under your control in .env or Compose.

App actions

Validate configuration · schedulable

Validate the active configuration and referenced rules without changing them.

selfhost app --directory ./prometheus-configured action prometheus check-config

A workspace can schedule this workflow while Selfhost runs. A standalone user can invoke it through an external scheduler. Scheduling guide.

Check readiness · schedulable

Check whether Prometheus is ready to serve queries.

selfhost app --directory ./prometheus-configured action prometheus check-ready

A workspace can schedule this workflow while Selfhost runs. A standalone user can invoke it through an external scheduler. Scheduling guide.

App configuration reference

Versions and updates

This deployment uses the following images. Existing projects retain their saved recipe and images. A new catalogue version does not silently update them.

  • prometheus: prom/prometheus:v3.15.0

Review compatibility and back up app data before an update. Choose an image version and review the change.

Keep control of your setup

Selfhost remains optional. Your app runs using ordinary Compose files, its own settings and persistent data. Keep the Compose project name and volumes to preserve storage. Configuration exports and setting backups do not include application data.

Standalone CLI guide · Backups and removal

Built by Obiente. Your services, your configuration.