22
33A wrapper around the [ Logfire] ( https://pydantic.dev/logfire ) API, exposing it as a PostgreSQL server.
44
5- ## Installation
5+ ## Usage
6+
7+ ### Docker
8+
9+ ``` bash
10+ docker run --name logfire-pg -p 5432:5432 ghcr.io/timescale/logfire-pg
11+ ```
12+
13+ ### Binary
14+
15+ #### Installation
616
717For Linux and Windows, go to the [ Releases] ( https://github.com/timescale/logfire-pg/releases ) page
818and download the binary for your system. Place the binary onto somewhere in your PATH.
919
1020For macOS, you will need to clone the repo and build from source.
1121
12- ## Usage
22+ #### Running the Binary
1323
1424To start the server, simply do:
1525
1626``` bash
1727logfire_pg
1828```
1929
20- Where this starts a server that accepts PostgreSQL connections, where the username should be ` token `
21- and the password is your Logfire read token, see
22- [ here] ( https://logfire.pydantic.dev/docs/how-to-guides/query-api/#how-to-create-a-read-token ) on how
23- to create the token.
24-
25- Then to connect, you can use something like ` psql ` as follows:
26-
27- ``` bash
28- psql -d " postgres://token:${LOGFIRE_READ_TOKEN} $@ localhost:5432/logfire"
29- ```
30-
3130For the full available options on running the server, see ` --help ` :
3231
3332``` text
@@ -38,6 +37,19 @@ Usage of ./bin/logfire_pg:
3837 --version Print version and exit
3938```
4039
40+ ### Connecting to logfire-pg
41+
42+ After starting the server via one of the above methods, you can then use a PostgreSQL client, like
43+ ` psql ` to connect. You will need to first obtain a read token for your Logfire project, see
44+ [ here] ( https://logfire.pydantic.dev/docs/how-to-guides/query-api/#how-to-create-a-read-token ) on how
45+ to create a read token.
46+
47+ If using ` psql ` , you could then do the following to connect:
48+
49+ ``` bash
50+ psql -d " postgres://token:${LOGFIRE_READ_TOKEN} $@ localhost:5432/logfire"
51+ ```
52+
4153## Development
4254
4355### Building from Source
0 commit comments