Deploy a PayID server with Docker, and pull PayID metrics into Prometheus
In this tutorial, you will deploy a PayID server and run Prometheus locally using Docker, and you will create a configuration file for the PayID server so that PayID metrics are pulled into Prometheus.
Install the following software on your machine, if not already present.
Build a Docker container for setting up a PayID server
Run these commands to build a Docker container for a PayID server.
Create Docker network for PayID
You will run several containers in Docker that must talk to each other. To set up these containers, create a docker network called
Start a Postgres Database
To have a PayID server, you require a Postgres database to store PayID accounts and address mappings. To do this, run the postgres database in docker with a default password of
password, and tell the database to use the
payid-network that you previously created. Name this docker container
payid-postgres, so that you can reference the container by name when you connect your PayID server. Note that both the default database and the user are named
postgres, as described at Postgres Docker Official Images.
Start and test the PayID server
To start the PayID server, run the PayID server in docker using the image you created. You must also use the docker network
payid-network so that it can connect to the
Test whether the PayID server is running by creating a PayID with this cURL command.
You should get a
Query the PayID server to make sure it resolves, using this cURL command.
In this step, you will run prometheus in docker and configure it to scrape the PayID server’s metrics. To do this, you need to create a
prometheus.yml file on the host machine and mount it in the docker container.
Create a file named
prometheus.yml with these contents.
Start the docker container:
You can verify Prometheus is running by opening
http://localhost:9090/graph in a browser.
You can verify metrics collection metrics are being collected by entering the following expression into the form:
Execute. If successful, the results look like this:
Click the Graph tab to display the results in graph format.
Here are some other example expressions:
sum(payid_count) by (paymentNetwork)- Sum of
payidcount by payment network, such as XRPL, BTC, and so forth.
sum(payid_lookup_request)- Total number of
rate(payid_lookup_request[5m])- Rate of
payidlookup requests per second.