Skip to content

Commit 909259a

Browse files
committed
Remove Logfire example in documentation
Backport of: #13134
1 parent 2c4174c commit 909259a

1 file changed

Lines changed: 19 additions & 61 deletions

File tree

‎docs/index.md‎

Lines changed: 19 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -14,67 +14,25 @@ Pydantic is the most widely used data validation library for Python.
1414

1515
Fast and extensible, Pydantic plays nicely with your linters/IDE/brain. Define how data should be in pure, canonical Python 3.9+; validate it with Pydantic.
1616

17-
!!! logfire "Monitor Pydantic with Pydantic Logfire :fire:"
18-
**[Pydantic Logfire](https://pydantic.dev/logfire)** is a production-grade observability platform for AI and general applications. See LLM interactions, agent behavior, API requests, and database queries in one unified trace. With SDKs for Python, JavaScript/TypeScript, and Rust, Logfire works with all OpenTelemetry-compatible languages.
19-
20-
Logfire integrates with many popular Python libraries including FastAPI, OpenAI and Pydantic itself, so you can use Logfire to monitor Pydantic validations and understand why some inputs fail validation:
21-
22-
```python {title="Monitoring Pydantic with Logfire" test="skip"}
23-
from datetime import datetime
24-
25-
import logfire
26-
27-
from pydantic import BaseModel
28-
29-
logfire.configure()
30-
logfire.instrument_pydantic() # (1)!
31-
32-
33-
class Delivery(BaseModel):
34-
timestamp: datetime
35-
dimensions: tuple[int, int]
36-
37-
38-
# this will record details of a successful validation to logfire
39-
m = Delivery(timestamp='2020-01-02T03:04:05Z', dimensions=['10', '20'])
40-
print(repr(m.timestamp))
41-
#> datetime.datetime(2020, 1, 2, 3, 4, 5, tzinfo=TzInfo(UTC))
42-
print(m.dimensions)
43-
#> (10, 20)
44-
45-
Delivery(timestamp='2020-01-02T03:04:05Z', dimensions=['10']) # (2)!
46-
```
47-
48-
1. Set logfire record all both successful and failed validations, use `record='failure'` to only record failed validations, [learn more](https://logfire.pydantic.dev/docs/integrations/pydantic/).
49-
2. This will raise a `ValidationError` since there are too few `dimensions`, details of the input data and validation errors will be recorded in Logfire.
50-
51-
Would give you a view like this in the Logfire platform:
52-
53-
[![Logfire Pydantic Integration](img/logfire-pydantic-integration.png)](https://logfire.pydantic.dev/docs/guides/web-ui/live/)
54-
55-
This is just a toy example, but hopefully makes clear the potential value of instrumenting a more complex application.
56-
57-
**[Learn more about Pydantic Logfire](https://logfire.pydantic.dev/docs/)**
58-
59-
**Sign up for our newsletter, *The Pydantic Stack*, with updates & tutorials on Pydantic, Logfire, and Pydantic AI:**
60-
61-
<form method="POST" action="https://eu.customerioforms.com/forms/submit_action?site_id=53d2086c3c4214eaecaa&form_id=14b22611745b458&success_url=https://docs.pydantic.dev/" class="md-typeset" style="display: flex; align-items: center; gap: 0.5rem; max-width: 100%;">
62-
<input
63-
type="email"
64-
id="email_input"
65-
name="email"
66-
class="md-input md-input--stretch"
67-
style="flex: 1; background: var(--md-default-bg-color); color: var(--md-default-fg-color);"
68-
required
69-
placeholder="Email"
70-
data-1p-ignore
71-
data-lpignore="true"
72-
data-protonpass-ignore="true"
73-
data-bwignore="true"
74-
/>
75-
<input type="hidden" id="source_input" name="source" value="pydantic" />
76-
<button type="submit" class="md-button md-button--primary">Subscribe</button>
77-
</form>
17+
**Sign up for our newsletter, *The Pydantic Stack*, with updates & tutorials on Pydantic, Logfire, and Pydantic AI:**
18+
19+
<form method="POST" action="https://eu.customerioforms.com/forms/submit_action?site_id=53d2086c3c4214eaecaa&form_id=14b22611745b458&success_url=https://docs.pydantic.dev/" class="md-typeset" style="display: flex; align-items: center; gap: 0.5rem; max-width: 100%;">
20+
<input
21+
type="email"
22+
id="email_input"
23+
name="email"
24+
class="md-input md-input--stretch"
25+
style="flex: 1; background: var(--md-default-bg-color); color: var(--md-default-fg-color);"
26+
required
27+
placeholder="Email"
28+
data-1p-ignore
29+
data-lpignore="true"
30+
data-protonpass-ignore="true"
31+
data-bwignore="true"
32+
/>
33+
<input type="hidden" id="source_input" name="source" value="pydantic" />
34+
<button type="submit" class="md-button md-button--primary">Subscribe</button>
35+
</form>
7836

7937
## Why use Pydantic?
8038

0 commit comments

Comments
 (0)