-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into alex/scrub-once
- Loading branch information
Showing
50 changed files
with
1,001 additions
and
267 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/asyncpg.md → docs/integrations/databases/asyncpg.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/bigquery.md → docs/integrations/databases/bigquery.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/mysql.md → docs/integrations/databases/mysql.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/psycopg.md → docs/integrations/databases/psycopg.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/pymongo.md → docs/integrations/databases/pymongo.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/redis.md → docs/integrations/databases/redis.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/sqlalchemy.md → docs/integrations/databases/sqlalchemy.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/sqlite3.md → docs/integrations/databases/sqlite3.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/celery.md → docs/integrations/event-streams/celery.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
integration: built-in | ||
--- | ||
|
||
# FastStream | ||
|
||
To instrument [FastStream][faststream] with OpenTelemetry, you need to: | ||
|
||
1. Call `logfire.configure()`. | ||
2. Add the needed middleware according to your broker. | ||
|
||
Let's see an example: | ||
|
||
```python title="main.py" | ||
from faststream import FastStream | ||
from faststream.redis import RedisBroker | ||
from faststream.redis.opentelemetry import RedisTelemetryMiddleware | ||
|
||
import logfire | ||
|
||
logfire.configure() | ||
|
||
broker = RedisBroker(middlewares=(RedisTelemetryMiddleware(),)) | ||
|
||
app = FastStream(broker) | ||
|
||
|
||
@broker.subscriber("test-channel") | ||
@broker.publisher("another-channel") | ||
async def handle(): | ||
return "Hi!" | ||
|
||
|
||
@broker.subscriber("another-channel") | ||
async def handle_next(msg: str): | ||
assert msg == "Hi!" | ||
|
||
|
||
@app.after_startup | ||
async def test(): | ||
await broker.publish("", channel="test-channel") | ||
``` | ||
|
||
Since we are using Redis, we added the [`RedisTelemetryMiddleware`][faststream.redis.opentelemetry.RedisTelemetryMiddleware] | ||
to the broker. In case you use a different broker, you need to add the corresponding middleware. | ||
|
||
See more about FastStream OpenTelemetry integration in [their documentation][faststream-otel]. | ||
|
||
[faststream]: https://faststream.airt.ai/latest/ | ||
[faststream-otel]: https://faststream.airt.ai/latest/getting-started/opentelemetry/#faststream-tracing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/httpx.md → docs/integrations/http-clients/httpx.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/requests.md → docs/integrations/http-clients/requests.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 4 additions & 1 deletion
5
docs/integrations/third-party/litellm.md → docs/integrations/llms/litellm.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 5 additions & 1 deletion
6
docs/integrations/third-party/magentic.md → docs/integrations/llms/magentic.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
docs/integrations/third-party/mirascope.md → docs/integrations/llms/mirascope.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.