Skip to content

Commit

Permalink
Add API Reference to the same section as Redis & PyMongo (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kludex authored Dec 31, 2024
1 parent a1702d5 commit a124067
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 2 deletions.
34 changes: 34 additions & 0 deletions docs/integrations/databases/pymongo.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,39 @@ The following script connects to a MongoDB database, inserts a document, and que

The keyword arguments of `logfire.instrument_pymongo()` are passed to the `PymongoInstrumentor().instrument()` method of the OpenTelemetry pymongo Instrumentation package, read more about it [here][opentelemetry-pymongo].

## API Reference

::: logfire.Logfire.instrument_pymongo
options:
heading_level: 4
show_source: false
show_root_doc_entry: true
show_root_heading: true
show_root_full_path: false

::: logfire.integrations.pymongo.RequestHook
options:
heading_level: 4
show_root_heading: true
show_root_full_path: false
show_source: false
filters: []

::: logfire.integrations.pymongo.ResponseHook
options:
heading_level: 4
show_root_heading: true
show_root_full_path: false
show_source: false
filters: []

::: logfire.integrations.pymongo.FailedHook
options:
heading_level: 4
show_root_heading: true
show_root_full_path: false
show_source: false
filters: []

[pymongo]: https://pymongo.readthedocs.io/en/stable/
[opentelemetry-pymongo]: https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/pymongo/pymongo.html
29 changes: 28 additions & 1 deletion docs/integrations/databases/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,34 @@ if __name__ == "__main__":

By default, it is set to `False` given that Redis commands can contain sensitive information.

The keyword arguments of `logfire.instrument_redis()` are passed to the `RedisInstrumentor().instrument()` method of the OpenTelemetry Redis Instrumentation package, read more about it [here][opentelemetry-redis].
The keyword arguments of `logfire.instrument_redis()` are passed to the `RedisInstrumentor().instrument()`
method of the OpenTelemetry Redis Instrumentation package, read more about it [here][opentelemetry-redis].

## API Reference

::: logfire.Logfire.instrument_redis
options:
heading_level: 4
show_source: false
show_root_doc_entry: true
show_root_heading: true
show_root_full_path: false

::: logfire.integrations.redis.RequestHook
options:
heading_level: 4
show_root_heading: true
show_root_full_path: false
show_source: false
filters: []

::: logfire.integrations.redis.ResponseHook
options:
heading_level: 4
show_root_heading: true
show_root_full_path: false
show_source: false
filters: []

[redis]: https://redis.readthedocs.io/en/stable/
[opentelemetry-redis]: https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/redis/redis.html
7 changes: 6 additions & 1 deletion docs/reference/api/logfire.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
options:
show_root_heading: true
show_root_full_path: false
filters: ["!^with_trace_sample_rate$", "!^_[^_]"]
exclude:
filters:
- "!instrument_redis"
- "!instrument_pymongo"
- "!^with_trace_sample_rate$"
- "!^_[^_]"


::: logfire
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ plugins:
- url: https://typing-extensions.readthedocs.io/en/latest/objects.inv
- url: https://rich.readthedocs.io/en/stable/objects.inv
- url: https://faststream.airt.ai/latest/objects.inv
- url: https://redis-py.readthedocs.io/en/stable/objects.inv
- url: https://pymongo.readthedocs.io/en/stable/objects.inv
- redirects:
redirect_maps:
"guides/first_steps/index.md": "index.md"
Expand Down

0 comments on commit a124067

Please sign in to comment.