logfire-api 5.0.0__tar.gz → 6.0.0b2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/PKG-INFO +1 -1
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/__init__.py +7 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/__init__.pyi +3 -1
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/cli/run.pyi +9 -1
- logfire_api-6.0.0b2/logfire_api/_internal/integrations/litestar.pyi +7 -0
- logfire_api-6.0.0b2/logfire_api/_internal/integrations/snowflake.pyi +7 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/logs.pyi +2 -2
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/main.pyi +40 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/pyproject.toml +1 -1
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/.gitignore +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/README.md +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/__init__.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/ast_utils.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/async_.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/auth.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/auto_trace/__init__.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/auto_trace/import_hook.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/auto_trace/rewrite_ast.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/auto_trace/types.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/baggage.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/cli/__init__.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/cli/ai_tools.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/cli/auth.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/cli/gateway.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/cli/gateway_auth.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/cli/prompt.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/cli.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/client.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/collect_system_info.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/config.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/config_params.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/constants.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/db_statement_summary.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/__init__.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/console.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/dynamic_batch.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/logs.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/otlp.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/processor_wrapper.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/quiet_metrics.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/remove_pending.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/tail_sampling.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/wrapper.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/formatter.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/forwarding.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/instrument.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/__init__.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/aiohttp_client.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/aiohttp_server.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/asgi.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/asyncpg.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/aws_lambda.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/celery.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/claude_agent_sdk.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/django.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/dspy.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/executors.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/fastapi.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/flask.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/google_genai.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/httpx.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/litellm.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/mcp.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/mysql.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/openai_agents.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/print.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/psycopg.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/pydantic_ai.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/pymongo.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/pytest.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/redis.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/requests.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/sqlalchemy.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/sqlite3.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/starlette.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/surrealdb.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/system_metrics.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/wsgi.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/interactive.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/json_encoder.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/json_formatter.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/json_schema.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/json_types.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/metrics.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/scrubbing.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/server_response.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/stack_info.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/tracer.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/ulid.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/utils.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/cli.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/db_api.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/exceptions.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/experimental/__init__.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/experimental/annotations.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/experimental/api_client.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/experimental/datasets/__init__.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/experimental/query_client.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/__init__.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/aiohttp_client.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/flask.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/httpx.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/logging.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/loguru.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/psycopg.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/pydantic.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/redis.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/sqlalchemy.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/structlog.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/integrations/wsgi.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/propagate.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/py.typed +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/query_client.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/sampling/__init__.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/sampling/_tail_sampling.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/types.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/variables/__init__.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/variables/_handlebars.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/variables/abstract.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/variables/composition.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/variables/config.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/variables/local.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/variables/remote.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/variables/template_validation.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/variables/variable.pyi +0 -0
- {logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/version.pyi +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: logfire-api
|
|
3
|
-
Version:
|
|
3
|
+
Version: 6.0.0b2
|
|
4
4
|
Summary: Shim for the Logfire SDK which does nothing unless Logfire is installed
|
|
5
5
|
Author-email: Pydantic Team <engineering@pydantic.dev>, Samuel Colvin <samuel@pydantic.dev>, Hasan Ramezani <hasan@pydantic.dev>, Adrian Garcia Badaracco <adrian@pydantic.dev>, David Montague <david@pydantic.dev>, Marcelo Trylesinski <marcelo@pydantic.dev>, David Hewitt <david.hewitt@pydantic.dev>, Alex Hall <alex@pydantic.dev>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -167,12 +167,17 @@ except ImportError:
|
|
|
167
167
|
|
|
168
168
|
def instrument_starlette(self, *args, **kwargs) -> None: ...
|
|
169
169
|
|
|
170
|
+
def instrument_litestar(self, app, *args, **kwargs):
|
|
171
|
+
return app
|
|
172
|
+
|
|
170
173
|
def instrument_django(self, *args, **kwargs) -> None: ...
|
|
171
174
|
|
|
172
175
|
def instrument_psycopg(self, *args, **kwargs) -> None: ...
|
|
173
176
|
|
|
174
177
|
def instrument_surrealdb(self, *args, **kwargs) -> None: ...
|
|
175
178
|
|
|
179
|
+
def instrument_snowflake(self, *args, **kwargs) -> None: ...
|
|
180
|
+
|
|
176
181
|
def instrument_requests(self, *args, **kwargs) -> None: ...
|
|
177
182
|
|
|
178
183
|
def instrument_httpx(self, *args, **kwargs) -> None: ...
|
|
@@ -252,10 +257,12 @@ except ImportError:
|
|
|
252
257
|
instrument_httpx = DEFAULT_LOGFIRE_INSTANCE.instrument_httpx
|
|
253
258
|
instrument_requests = DEFAULT_LOGFIRE_INSTANCE.instrument_requests
|
|
254
259
|
instrument_surrealdb = DEFAULT_LOGFIRE_INSTANCE.instrument_surrealdb
|
|
260
|
+
instrument_snowflake = DEFAULT_LOGFIRE_INSTANCE.instrument_snowflake
|
|
255
261
|
instrument_psycopg = DEFAULT_LOGFIRE_INSTANCE.instrument_psycopg
|
|
256
262
|
instrument_django = DEFAULT_LOGFIRE_INSTANCE.instrument_django
|
|
257
263
|
instrument_flask = DEFAULT_LOGFIRE_INSTANCE.instrument_flask
|
|
258
264
|
instrument_starlette = DEFAULT_LOGFIRE_INSTANCE.instrument_starlette
|
|
265
|
+
instrument_litestar = DEFAULT_LOGFIRE_INSTANCE.instrument_litestar
|
|
259
266
|
instrument_aiohttp_client = DEFAULT_LOGFIRE_INSTANCE.instrument_aiohttp_client
|
|
260
267
|
instrument_aiohttp_server = DEFAULT_LOGFIRE_INSTANCE.instrument_aiohttp_server
|
|
261
268
|
instrument_sqlalchemy = DEFAULT_LOGFIRE_INSTANCE.instrument_sqlalchemy
|
|
@@ -16,7 +16,7 @@ from logfire.propagate import attach_context as attach_context, get_context as g
|
|
|
16
16
|
from logfire.sampling import SamplingOptions as SamplingOptions
|
|
17
17
|
from typing import Any
|
|
18
18
|
|
|
19
|
-
__all__ = ['Logfire', 'LogfireSpan', 'LevelName', 'AdvancedOptions', 'ConsoleOptions', 'CodeSource', 'PydanticPlugin', 'configure', 'span', 'instrument', 'log', 'trace', 'debug', 'notice', 'info', 'warn', 'warning', 'error', 'exception', 'fatal', 'force_flush', 'log_slow_async_callbacks', 'install_auto_tracing', 'instrument_asgi', 'instrument_wsgi', 'instrument_pydantic', 'instrument_pydantic_ai', 'instrument_fastapi', 'instrument_openai', 'instrument_openai_agents', 'instrument_anthropic', 'instrument_google_genai', 'instrument_litellm', 'instrument_dspy', 'instrument_print', 'instrument_asyncpg', 'instrument_httpx', 'instrument_celery', 'instrument_requests', 'instrument_psycopg', 'instrument_django', 'instrument_flask', 'instrument_starlette', 'instrument_aiohttp_client', 'instrument_aiohttp_server', 'instrument_sqlalchemy', 'instrument_sqlite3', 'instrument_aws_lambda', 'instrument_redis', 'instrument_pymongo', 'instrument_mysql', 'instrument_surrealdb', 'instrument_system_metrics', 'instrument_mcp', 'instrument_claude_agent_sdk', 'AutoTraceModule', 'with_tags', 'with_settings', 'suppress_scopes', 'shutdown', 'no_auto_trace', 'ScrubMatch', 'ScrubbingOptions', 'VERSION', 'add_non_user_code_prefix', 'suppress_instrumentation', 'StructlogProcessor', 'LogfireLoggingHandler', 'loguru_handler', 'SamplingOptions', 'MetricsOptions', 'VariablesOptions', 'LocalVariablesOptions', 'variables', 'var', 'template_var', 'variables_get', 'variables_push', 'variables_push_types', 'variables_validate', 'variables_push_config', 'variables_pull_config', 'variables_build_config', 'logfire_info', 'get_baggage', 'set_baggage', 'get_context', 'attach_context', 'url_from_eval', 'forward_export_request', 'forward_export_request_starlette']
|
|
19
|
+
__all__ = ['Logfire', 'LogfireSpan', 'LevelName', 'AdvancedOptions', 'ConsoleOptions', 'CodeSource', 'PydanticPlugin', 'configure', 'span', 'instrument', 'log', 'trace', 'debug', 'notice', 'info', 'warn', 'warning', 'error', 'exception', 'fatal', 'force_flush', 'log_slow_async_callbacks', 'install_auto_tracing', 'instrument_asgi', 'instrument_wsgi', 'instrument_pydantic', 'instrument_pydantic_ai', 'instrument_fastapi', 'instrument_openai', 'instrument_openai_agents', 'instrument_anthropic', 'instrument_google_genai', 'instrument_litellm', 'instrument_dspy', 'instrument_print', 'instrument_asyncpg', 'instrument_httpx', 'instrument_celery', 'instrument_requests', 'instrument_psycopg', 'instrument_django', 'instrument_flask', 'instrument_starlette', 'instrument_litestar', 'instrument_aiohttp_client', 'instrument_aiohttp_server', 'instrument_sqlalchemy', 'instrument_sqlite3', 'instrument_aws_lambda', 'instrument_redis', 'instrument_pymongo', 'instrument_mysql', 'instrument_surrealdb', 'instrument_snowflake', 'instrument_system_metrics', 'instrument_mcp', 'instrument_claude_agent_sdk', 'AutoTraceModule', 'with_tags', 'with_settings', 'suppress_scopes', 'shutdown', 'no_auto_trace', 'ScrubMatch', 'ScrubbingOptions', 'VERSION', 'add_non_user_code_prefix', 'suppress_instrumentation', 'StructlogProcessor', 'LogfireLoggingHandler', 'loguru_handler', 'SamplingOptions', 'MetricsOptions', 'VariablesOptions', 'LocalVariablesOptions', 'variables', 'var', 'template_var', 'variables_get', 'variables_push', 'variables_push_types', 'variables_validate', 'variables_push_config', 'variables_pull_config', 'variables_build_config', 'logfire_info', 'get_baggage', 'set_baggage', 'get_context', 'attach_context', 'url_from_eval', 'forward_export_request', 'forward_export_request_starlette']
|
|
20
20
|
|
|
21
21
|
DEFAULT_LOGFIRE_INSTANCE = Logfire()
|
|
22
22
|
span = DEFAULT_LOGFIRE_INSTANCE.span
|
|
@@ -44,6 +44,7 @@ instrument_psycopg = DEFAULT_LOGFIRE_INSTANCE.instrument_psycopg
|
|
|
44
44
|
instrument_django = DEFAULT_LOGFIRE_INSTANCE.instrument_django
|
|
45
45
|
instrument_flask = DEFAULT_LOGFIRE_INSTANCE.instrument_flask
|
|
46
46
|
instrument_starlette = DEFAULT_LOGFIRE_INSTANCE.instrument_starlette
|
|
47
|
+
instrument_litestar = DEFAULT_LOGFIRE_INSTANCE.instrument_litestar
|
|
47
48
|
instrument_aiohttp_client = DEFAULT_LOGFIRE_INSTANCE.instrument_aiohttp_client
|
|
48
49
|
instrument_aiohttp_server = DEFAULT_LOGFIRE_INSTANCE.instrument_aiohttp_server
|
|
49
50
|
instrument_sqlalchemy = DEFAULT_LOGFIRE_INSTANCE.instrument_sqlalchemy
|
|
@@ -53,6 +54,7 @@ instrument_redis = DEFAULT_LOGFIRE_INSTANCE.instrument_redis
|
|
|
53
54
|
instrument_pymongo = DEFAULT_LOGFIRE_INSTANCE.instrument_pymongo
|
|
54
55
|
instrument_mysql = DEFAULT_LOGFIRE_INSTANCE.instrument_mysql
|
|
55
56
|
instrument_surrealdb = DEFAULT_LOGFIRE_INSTANCE.instrument_surrealdb
|
|
57
|
+
instrument_snowflake = DEFAULT_LOGFIRE_INSTANCE.instrument_snowflake
|
|
56
58
|
instrument_system_metrics = DEFAULT_LOGFIRE_INSTANCE.instrument_system_metrics
|
|
57
59
|
instrument_mcp = DEFAULT_LOGFIRE_INSTANCE.instrument_mcp
|
|
58
60
|
instrument_claude_agent_sdk = DEFAULT_LOGFIRE_INSTANCE.instrument_claude_agent_sdk
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import argparse
|
|
2
2
|
from _typeshed import Incomplete
|
|
3
|
-
from collections.abc import Collection, Generator, Mapping
|
|
3
|
+
from collections.abc import Callable, Collection, Generator, Mapping
|
|
4
4
|
from contextlib import contextmanager
|
|
5
5
|
from dataclasses import dataclass
|
|
6
6
|
from logfire._internal.utils import get_version as get_version
|
|
@@ -14,6 +14,7 @@ TARGET_PACKAGE_ALIASES: Incomplete
|
|
|
14
14
|
INSTRUMENTATION_CALL_ARGUMENTS: Incomplete
|
|
15
15
|
MINIMUM_INSTRUMENTATION_VERSIONS: Incomplete
|
|
16
16
|
OTEL_INSTRUMENTATION_MAP: Incomplete
|
|
17
|
+
INSTRUMENTATION_TO_EXTRA: dict[str, str]
|
|
17
18
|
|
|
18
19
|
@dataclass(frozen=True, order=True)
|
|
19
20
|
class InstrumentationRecommendation:
|
|
@@ -33,6 +34,13 @@ class InstrumentationContext:
|
|
|
33
34
|
recommendations: set[InstrumentationRecommendation]
|
|
34
35
|
|
|
35
36
|
def parse_run(args: argparse.Namespace) -> None: ...
|
|
37
|
+
def load_console_entry_point(name: str) -> Callable[[], object] | None:
|
|
38
|
+
"""Load one installed `console_scripts` entry point before local modules can shadow it."""
|
|
39
|
+
@contextmanager
|
|
40
|
+
def without_working_directory_on_sys_path() -> Generator[None, None, None]:
|
|
41
|
+
"""Temporarily give entry-point imports the path behavior of an installed launcher."""
|
|
42
|
+
def run_console_entry_point(entry_point: Callable[[], object], argv: list[str]) -> None:
|
|
43
|
+
"""Run a loaded console entry point with the target command's arguments."""
|
|
36
44
|
@contextmanager
|
|
37
45
|
def alter_sys_argv(argv: list[str], cmd: str) -> Generator[None, None, None]: ...
|
|
38
46
|
def is_uv_installed() -> bool:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
from .asgi import ASGIApp as ASGIApp, ASGIInstrumentKwargs as ASGIInstrumentKwargs, instrument_asgi as instrument_asgi
|
|
2
|
+
from litestar import Litestar
|
|
3
|
+
from logfire import Logfire as Logfire
|
|
4
|
+
from typing_extensions import Unpack
|
|
5
|
+
|
|
6
|
+
def instrument_litestar(logfire_instance: Logfire, app: Litestar, *, record_send_receive: bool = False, capture_headers: bool = False, **kwargs: Unpack[ASGIInstrumentKwargs]) -> ASGIApp:
|
|
7
|
+
"""Wrap a Litestar app with OpenTelemetry middleware configured for Logfire."""
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
from logfire import Logfire as Logfire
|
|
2
|
+
from logfire._internal.stack_info import warn_at_user_stacklevel as warn_at_user_stacklevel
|
|
3
|
+
from logfire._internal.utils import handle_internal_errors as handle_internal_errors
|
|
4
|
+
from snowflake.connector.connection import SnowflakeConnection
|
|
5
|
+
from types import ModuleType
|
|
6
|
+
|
|
7
|
+
def instrument_snowflake(logfire_instance: Logfire, conn_or_module: ModuleType | SnowflakeConnection | None, capture_parameters: bool) -> None: ...
|
|
@@ -3,7 +3,7 @@ from dataclasses import dataclass
|
|
|
3
3
|
from logfire._internal.constants import LEVEL_NUMBERS as LEVEL_NUMBERS
|
|
4
4
|
from opentelemetry._logs import LogRecord, Logger, LoggerProvider
|
|
5
5
|
from opentelemetry.util.types import _ExtendedAttributes
|
|
6
|
-
from threading import
|
|
6
|
+
from threading import RLock
|
|
7
7
|
from typing import Any, overload
|
|
8
8
|
from weakref import WeakSet
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ class ProxyLoggerProvider(LoggerProvider):
|
|
|
12
12
|
"""A logger provider that wraps another internal logger provider allowing it to be re-assigned."""
|
|
13
13
|
provider: LoggerProvider
|
|
14
14
|
loggers: WeakSet[ProxyLogger] = dataclasses.field(default_factory=WeakSet['ProxyLogger'])
|
|
15
|
-
lock:
|
|
15
|
+
lock: RLock = dataclasses.field(default_factory=RLock)
|
|
16
16
|
suppressed_scopes: set[str] = dataclasses.field(default_factory=set[str])
|
|
17
17
|
min_level: int = ...
|
|
18
18
|
def get_logger(self, name: str, version: str | None = None, schema_url: str | None = None, attributes: _ExtendedAttributes | None = None) -> Logger: ...
|
|
@@ -42,6 +42,7 @@ from contextlib import AbstractContextManager
|
|
|
42
42
|
from django.http import HttpRequest as HttpRequest, HttpResponse as HttpResponse
|
|
43
43
|
from fastapi import FastAPI
|
|
44
44
|
from flask.app import Flask
|
|
45
|
+
from litestar import Litestar
|
|
45
46
|
from opentelemetry.context import Context as Context
|
|
46
47
|
from opentelemetry.instrumentation.asgi.types import ClientRequestHook, ClientResponseHook, ServerRequestHook
|
|
47
48
|
from opentelemetry.metrics import CallbackT as CallbackT, Counter, Histogram, UpDownCounter, _Gauge as Gauge
|
|
@@ -50,6 +51,7 @@ from opentelemetry.trace import SpanContext, SpanKind
|
|
|
50
51
|
from opentelemetry.util import types as otel_types
|
|
51
52
|
from pydantic_evals.reporting import EvaluationReport
|
|
52
53
|
from pymongo.monitoring import CommandFailedEvent as CommandFailedEvent, CommandStartedEvent as CommandStartedEvent, CommandSucceededEvent as CommandSucceededEvent
|
|
54
|
+
from snowflake.connector.connection import SnowflakeConnection
|
|
53
55
|
from sqlalchemy import Engine
|
|
54
56
|
from sqlalchemy.ext.asyncio import AsyncEngine
|
|
55
57
|
from starlette.applications import Starlette
|
|
@@ -439,6 +441,21 @@ class Logfire:
|
|
|
439
441
|
Pass a connection class to instrument all instances of that class.
|
|
440
442
|
By default, all connection classes are instrumented.
|
|
441
443
|
"""
|
|
444
|
+
def instrument_snowflake(self, conn_or_module: ModuleType | SnowflakeConnection | None = None, *, capture_parameters: bool = False) -> None:
|
|
445
|
+
"""Instrument the [Snowflake Connector for Python](https://docs.snowflake.com/en/developer-guide/python-connector/python-connector) so that a span is created for each query.
|
|
446
|
+
|
|
447
|
+
Calls to `execute_async()` create a `snowflake execute async` span that measures query submission,
|
|
448
|
+
not server-side execution.
|
|
449
|
+
|
|
450
|
+
Args:
|
|
451
|
+
conn_or_module: Pass a single connection instance to instrument only that connection.
|
|
452
|
+
By default (`None`), all connections are instrumented, including ones created later.
|
|
453
|
+
capture_parameters: Set to `True` to capture query parameters as span attributes.
|
|
454
|
+
Be cautious when enabling this, as it may lead to sensitive data being captured in traces.
|
|
455
|
+
Instrumenting the same target again has no effect; the first call determines this setting,
|
|
456
|
+
and a later call with a different value emits a warning.
|
|
457
|
+
A connection keeps the setting it was instrumented with, even if the module is instrumented later.
|
|
458
|
+
"""
|
|
442
459
|
def instrument_mcp(self, *, propagate_otel_context: bool = True) -> None:
|
|
443
460
|
"""Instrument the [MCP Python SDK](https://github.com/modelcontextprotocol/python-sdk).
|
|
444
461
|
|
|
@@ -800,6 +817,29 @@ class Logfire:
|
|
|
800
817
|
response_hook: A function called right before a span is finished for the response.
|
|
801
818
|
**kwargs: Additional keyword arguments to pass to the OpenTelemetry Flask instrumentation.
|
|
802
819
|
"""
|
|
820
|
+
def instrument_litestar(self, app: Litestar, *, capture_headers: bool = False, record_send_receive: bool = False, **kwargs: Unpack[ASGIInstrumentKwargs]) -> ASGIApp:
|
|
821
|
+
"""Instrument a Litestar app to record requests with canonical route templates.
|
|
822
|
+
|
|
823
|
+
Uses `instrument_asgi()` with a Litestar route extractor, so requests to
|
|
824
|
+
`/users/1` and `/users/2` share the route `/users/{user_id}`.
|
|
825
|
+
|
|
826
|
+
Warning:
|
|
827
|
+
This method returns an ASGI wrapper instead of modifying the app in place.
|
|
828
|
+
Pass the returned app to your server. Access Litestar-specific attributes
|
|
829
|
+
through the original app.
|
|
830
|
+
|
|
831
|
+
Args:
|
|
832
|
+
app: The Litestar app to instrument.
|
|
833
|
+
capture_headers: Set to `True` to capture all request and response headers.
|
|
834
|
+
record_send_receive: Set to `True` to record low-level ASGI send and receive spans.
|
|
835
|
+
These are disabled by default to reduce noise.
|
|
836
|
+
**kwargs: Additional options for the OpenTelemetry ASGI middleware, including
|
|
837
|
+
`server_request_hook`, `client_request_hook`, `client_response_hook`,
|
|
838
|
+
`excluded_urls`, and `default_span_details`.
|
|
839
|
+
|
|
840
|
+
Returns:
|
|
841
|
+
The instrumented ASGI application.
|
|
842
|
+
"""
|
|
803
843
|
def instrument_starlette(self, app: Starlette, *, capture_headers: bool = False, record_send_receive: bool = False, server_request_hook: ServerRequestHook | None = None, client_request_hook: ClientRequestHook | None = None, client_response_hook: ClientResponseHook | None = None, **kwargs: Any) -> None:
|
|
804
844
|
"""Instrument `app` so that spans are automatically created for each request.
|
|
805
845
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "logfire-api"
|
|
7
|
-
version = "
|
|
7
|
+
version = "6.0.0b2"
|
|
8
8
|
description = "Shim for the Logfire SDK which does nothing unless Logfire is installed"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "Pydantic Team", email = "engineering@pydantic.dev" },
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/processor_wrapper.pyi
RENAMED
|
File without changes
|
|
File without changes
|
{logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/exporters/remove_pending.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/aiohttp_client.pyi
RENAMED
|
File without changes
|
{logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/aiohttp_server.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/claude_agent_sdk.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/google_genai.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/openai_agents.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/pydantic_ai.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{logfire_api-5.0.0 → logfire_api-6.0.0b2}/logfire_api/_internal/integrations/system_metrics.pyi
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|