PayString was previously known as PayID.
In this tutorial, you will deploy a PayString server and run Prometheus locally using Docker, and you will create a configuration file for the PayString server so that PayString metrics are pulled into Prometheus.
Install the following software on your machine, if not already present.
Run these commands to build a Docker container for a PayString server.
You will run several containers in Docker that must talk to each other. To set up these containers, create a docker network called
To have a PayString server, you require a Postgres database to store PayString 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
paystring-network that you previously created. Name this docker container
paystring-postgres, so that you can reference the container by name when you connect your PayString server. Note that both the default database and the user are named
postgres, as described at Postgres Docker Official Images.
To start the PayString server, run the PayString server in docker using the image you created. You must also use the docker network
paystring-network so that it can connect to the
Test whether the PayString server is running by creating a PayString with this cURL command.
You should get a
Query the PayString 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 PayString 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
PayStringcount by payment network, such as XRPL, BTC, and so forth.
sum(payid_lookup_request)- Total number of
rate(payid_lookup_request[5m])- Rate of
PayStringlookup requests per second.