Deploying Prometheus on Northflank
Prometheus is available as an official Docker image on Docker Hub. We can use it as a base image and layer in our configuration before deploying it on Northflank. You find the resources for the Deployment here (opens in a new tab).
We will use Northflank's ability to deploy from a repository using a Dockerfile (opens in a new tab) to set up our Prometheus instance.
Create a file called
prometheus.yml with the following contents:
- job_name: my-app-name
# Replace the port with the port your /metrics endpoint is running on
- targets: ["your-app-on-northflank:3000"]
See the Prometheus configuration reference (opens in a new tab) for full details. You can find an example config.yaml here (opens in a new tab).
The below Dockerfile uses the base Prometheus image, loads our configuration, makes the 9090 port available, and runs the container as a
root user in Docker to make sure it can access the persistent volume properly.
ADD prometheus.yml /etc/prometheus/
Create a Northflank (opens in a new tab) service from our newly created GitHub repo, it should pick up the configuration from the Dockerfile
In order to make Prometheus accessible to other services in your Northflank network or externally configure the PORT & DNS settings under the service network section in the Northflank UI. Northflank picks automatically up the port number that is specified in the Dockerfile.
Ensure in the settings that the
Port is set to 9090 and choose TCP as