Skip to content

Commit d9aad4e

Browse files
Docs: Refactor self-hosted docs (#1223)
Co-authored-by: Christopher Samiullah <[email protected]>
1 parent 0b1b8e6 commit d9aad4e

File tree

9 files changed

+164
-223
lines changed

9 files changed

+164
-223
lines changed

docs/reference/self-hosted.md

Lines changed: 0 additions & 79 deletions
This file was deleted.
File renamed without changes.

docs/self-hosted/playground.md renamed to docs/reference/self-hosted/local-quickstart.md

Lines changed: 56 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
# Trying Self Hosted locally
1+
# Local Quickstart
22

3-
This guide covers how to setup a local instance, so that you can test, prototype and evaluate Logfire without requiring a full production environment.
3+
This guide provides a fast path for setting up a local Logfire instance on Kubernetes to test, prototype, and evaluate the product.
4+
5+
For a production setup, including detailed configuration and prerequisites, please refer to our In-Depth [Installation Guide](./installation.md).
6+
7+
---
48

59
## Prerequisites
610

11+
Before deploying, you will need the following:
12+
713
- A Logfire Access Key, you'll need to get in contact with [[email protected]](mailto:[email protected]) to get one.
814
- A local Kubernetes cluster, we will be using [Kind](https://kind.sigs.k8s.io/) in this example.
915
- [Helm](https://helm.sh) CLI installed.
@@ -36,9 +42,11 @@ kubectl create secret docker-registry regcred \
3642
--docker-email=<YOUR_EMAIL>
3743
```
3844

39-
## Installing Logfire
45+
### Installing Logfire
4046

4147
You can now install Logfire using the Helm chart, with the development dependencies enabled.
48+
!!! warning
49+
These development services are not suitable for production use. They lack persistence, backup, and security configurations.
4250

4351
Here is a minimal command to run Logfire in development mode, you can customize `adminEmail` if you want to access Logfire's self telemetry, but it's not required:
4452

@@ -58,39 +66,9 @@ helm install logfire pydantic/logfire \
5866
```
5967

6068
You can refer to the [Logfire Helm Chart](https://github.com/pydantic/logfire-helm-chart) documentation to check all the supported configurations.
69+
Also check our [full installation guide](./installation.md) for a complete checklist and a detailed example `values.yaml` to get you started on your production setup.
6170

62-
63-
## Using Logfire
64-
65-
To access your local Logfire installation from you host you'll need to port forward `logfire-service`:
66-
67-
```bash
68-
kubectl port-forward service/logfire-service 8080:8080
69-
```
70-
71-
and `logfire-maildev`, for receiving emails and enabling user signups:
72-
73-
```bash
74-
kubectl port-forward service/logfire-maildev 1080:1080
75-
```
76-
77-
You are now ready to use Logfire with your browser of choice navigating to `http://localhost:8080/`
78-
79-
You can access the emails for signin up going to `http://localhost:1080`.
80-
81-
After creating your user, your project and your write token, you can start sending data to Logfire in the same fashion as always:
82-
83-
```python
84-
import logfire
85-
86-
logfire.configure(
87-
advanced=logfire.AdvancedOptions(base_url='http://localhost:8080'),
88-
token='__YOUR_LOGFIRE_WRITE_TOKEN__'
89-
)
90-
logfire.info('Hello, {place}!', place='World')
91-
```
92-
93-
## Using Tilt
71+
## Setup with Tilt (Optional)
9472

9573
If you are a [Tilt](https://tilt.dev/) user, you can use this `Tiltfile` to automate the Logfire setup:
9674

@@ -157,10 +135,53 @@ LOGFIRE_ADMIN_EMAIL=<ADMIN_EMAIL> \
157135
tilt up
158136
```
159137

138+
## Using Logfire
139+
140+
To access your local Logfire installation from you host you'll need to port forward `logfire-service`:
141+
142+
```bash
143+
kubectl port-forward service/logfire-service 8080:8080
144+
```
145+
146+
and `logfire-maildev`, for receiving emails and enabling user signups:
147+
148+
```bash
149+
kubectl port-forward service/logfire-maildev 1080:1080
150+
```
151+
152+
You are now ready to use Logfire with your browser of choice navigating to `http://localhost:8080/`
153+
154+
You can access the emails for signin up going to `http://localhost:1080`.
155+
156+
After creating your user, your project and your write token, you can start sending data to Logfire in the same fashion as always:
157+
158+
```python
159+
import logfire
160+
161+
logfire.configure(
162+
advanced=logfire.AdvancedOptions(base_url='http://localhost:8080'),
163+
token='__YOUR_LOGFIRE_WRITE_TOKEN__'
164+
)
165+
logfire.info('Hello, {place}!', place='World')
166+
```
167+
160168
## Cleanup
161169

162170
In order to cleanup your local environment you can just delete the k8s cluster:
163171

164172
```bash
165173
kind delete cluster
166174
```
175+
176+
## Troubleshooting and support
177+
178+
If you encounter issues, we recommend first consulting the [Troubleshooting](./troubleshooting.md) section.
179+
180+
If your issue persists, please open a detailed issue on [Github](https://github.com/pydantic/logfire-helm-chart/issues), including:
181+
182+
* Chart version
183+
* Kubernetes version
184+
* A sanitized copy of your ```values.yaml```
185+
* Relevant logs or error messages
186+
187+
For commercial or enterprise support, contact [our sales team](mailto:[email protected]).
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Self Hosted Introduction
2+
3+
Logfire can be deployed on-premises using the official [Logifre Helm Chart](https://github.com/pydantic/logfire-helm-chart). This allows organizations the ability to fully manage their own data.
4+
5+
This chart is included in our [Enterprise plan](../../enterprise.md). Contact us at [[email protected]](mailto:[email protected]) for details.
6+
7+
### Key Benefits
8+
9+
* **Simplified Deployment:** Install and manage the entire application stack with a single command.
10+
* **Flexible Configuration:** Easily adjust resource allocation, ingress settings, and authentication to your needs.
11+
* **Production-Ready Defaults:** Built-in settings for high availability, resource limits, and health checks.
12+
* **Repeatable & Versioned:** Manage your application deployment as code, ensuring consistency across environments.
13+
* **Compliance Friendly:** Leverage your own infrastructure to meet internal security standards.
14+
15+
## System Requirements
16+
17+
**Logfire** has been built from the ground up to be horizontally scalable. The self-hosted version shares the same code as the public deployment, and so is able to scale to high volumes of traffic.
18+
19+
With that in mind, here are some minimum requirements that you will need to deploy logfire self-hosted:
20+
21+
- A **Kubernetes** Cluster version `1.32` or greater
22+
- A **PostgreSQL** Database version `16` or greater
23+
- **Object Storage** such as Amazon S3, Azure Blob Storage or Google Cloud Storage
24+
- At least `512GB` or more local SSD scratch disk for ingest, compaction and caching
25+
- A **DNS/Hostname** to serve Logfire on. This does not need to be Internet accessible, but will need to be accessed over HTTP from any client.
26+
- An **Identity Provider** for Authenticating Users such as Github, Google or Microsoft. **Logfire** uses [Dex for authentication](https://dexidp.io/docs/connectors/)
27+
28+
Please view [installation](./installation.md) to find out how each of these are used.
29+
30+
## Client Configuration Instructions
31+
32+
After setting up the chart, you can send data to your **Logfire** Self-hosted instance by specifying the base url in advanced options:
33+
34+
```python
35+
import logfire
36+
37+
logfire.configure(
38+
..., # other options
39+
advanced=logfire.AdvancedOptions(base_url="https://<your_logfire_hostname>")
40+
)
41+
```
42+
43+
## Service Architecture
44+
45+
The Self-hosted deployment has a number of interdependent services that work to run logfire. Each component can be scaled independently of others depending on the utilisation of the system.
46+
47+
### Service Dependency Diagram
48+
49+
```mermaid
50+
graph
51+
%% Entry point
52+
LS[logfire-service:8080]
53+
54+
%% Core services
55+
LB[logfire-backend:8000]
56+
RD[logfire-redis:6379]
57+
FIA[logfire-ff-ingest:8012]
58+
FQA[logfire-ff-query-api:8011]
59+
FCC[logfire-ff-cache:9001]
60+
MW[logfire-maintenance-worker]
61+
62+
OS[(Object Storage)]
63+
PG[(Postgres DB)]
64+
65+
%% Connections from entry point
66+
LS --> LB
67+
LS --> FIA
68+
69+
FQA --> FCC
70+
FQA --> PG
71+
FQA --> RD
72+
FQA --> OS
73+
74+
LB --> FQA
75+
LB --> RD
76+
77+
FIA --> PG
78+
FIA --> RD
79+
FIA --> OS
80+
81+
FCC --> OS
82+
83+
MW --> PG
84+
MW --> OS
85+
86+
87+
```
88+
89+
### Service Descriptions
90+
91+
#### Entry Point
92+
- `logfire-service` (Port 8080): Main entry point for the system
93+
94+
#### Core Services
95+
- `logfire-backend` (Port 8000): Backend service handling business logic, frontend and authentication
96+
- `logfire-ff-ingest` (Port 8012): API for data ingestion
97+
- `logfire-ff-query-api` (Port 8011): API for querying data
98+
- `logfire-ff-maintenance-worker`: Maintenance Jobs
99+
- `logfire-ff-compaction-worker`: Compaction Jobs
100+
- `logfire-redis`: Live query streaming and autocomplete cache
101+
- `logfire-ff-cache` (Port 9001 via `logfire-ff-conhash-cache` consistent hashing): Cache service

docs/self-hosted/scaling.md renamed to docs/reference/self-hosted/scaling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**Logfire** is designed to be horizontally scalable, and can handle a lot of traffic. Depending on your usage patterns, however, you may be required to scale certain pods in order to maintain performance.
44

5-
Please use the [architecture](./architecture.md) diagram as reference.
5+
Please use the [architecture](./overview.md#service-architecture) diagram as reference.
66

77
## PostgreSQL Configuration
88

File renamed without changes.

docs/self-hosted/architecture.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)