Skip to content

Commit a996819

Browse files
authored
Keep METRICS_PREFERRED_TEMPORALITY private (#456)
1 parent e6b0f8c commit a996819

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

logfire-api/logfire_api/__init__.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from ._internal.auto_trace import AutoTraceModule as AutoTraceModule
22
from ._internal.auto_trace.rewrite_ast import no_auto_trace as no_auto_trace
3-
from ._internal.config import AdvancedOptions as AdvancedOptions, ConsoleOptions as ConsoleOptions, METRICS_PREFERRED_TEMPORALITY as METRICS_PREFERRED_TEMPORALITY, MetricsOptions as MetricsOptions, PydanticPlugin as PydanticPlugin, configure as configure
3+
from ._internal.config import AdvancedOptions as AdvancedOptions, ConsoleOptions as ConsoleOptions, MetricsOptions as MetricsOptions, PydanticPlugin as PydanticPlugin, configure as configure
44
from ._internal.constants import LevelName as LevelName
55
from ._internal.exporters.file import load_file as load_spans_from_file
66
from ._internal.main import Logfire as Logfire, LogfireSpan as LogfireSpan
@@ -11,7 +11,7 @@ from .integrations.structlog import LogfireProcessor as StructlogProcessor
1111
from .version import VERSION as VERSION
1212
from logfire.sampling import SamplingOptions as SamplingOptions
1313

14-
__all__ = ['Logfire', 'LogfireSpan', 'LevelName', 'AdvancedOptions', 'ConsoleOptions', 'PydanticPlugin', 'configure', 'span', 'instrument', 'log', 'trace', 'debug', 'notice', 'info', 'warn', 'error', 'exception', 'fatal', 'force_flush', 'log_slow_async_callbacks', 'install_auto_tracing', 'instrument_fastapi', 'instrument_openai', 'instrument_anthropic', 'instrument_asyncpg', 'instrument_httpx', 'instrument_celery', 'instrument_requests', 'instrument_psycopg', 'instrument_django', 'instrument_flask', 'instrument_starlette', 'instrument_aiohttp_client', 'instrument_sqlalchemy', 'instrument_redis', 'instrument_pymongo', 'instrument_mysql', 'instrument_system_metrics', 'AutoTraceModule', 'with_tags', 'with_settings', 'shutdown', 'load_spans_from_file', 'no_auto_trace', 'METRICS_PREFERRED_TEMPORALITY', 'ScrubMatch', 'ScrubbingOptions', 'VERSION', 'suppress_instrumentation', 'StructlogProcessor', 'LogfireLoggingHandler', 'SamplingOptions', 'MetricsOptions']
14+
__all__ = ['Logfire', 'LogfireSpan', 'LevelName', 'AdvancedOptions', 'ConsoleOptions', 'PydanticPlugin', 'configure', 'span', 'instrument', 'log', 'trace', 'debug', 'notice', 'info', 'warn', 'error', 'exception', 'fatal', 'force_flush', 'log_slow_async_callbacks', 'install_auto_tracing', 'instrument_fastapi', 'instrument_openai', 'instrument_anthropic', 'instrument_asyncpg', 'instrument_httpx', 'instrument_celery', 'instrument_requests', 'instrument_psycopg', 'instrument_django', 'instrument_flask', 'instrument_starlette', 'instrument_aiohttp_client', 'instrument_sqlalchemy', 'instrument_redis', 'instrument_pymongo', 'instrument_mysql', 'instrument_system_metrics', 'AutoTraceModule', 'with_tags', 'with_settings', 'shutdown', 'load_spans_from_file', 'no_auto_trace', 'ScrubMatch', 'ScrubbingOptions', 'VERSION', 'suppress_instrumentation', 'StructlogProcessor', 'LogfireLoggingHandler', 'SamplingOptions', 'MetricsOptions']
1515

1616
DEFAULT_LOGFIRE_INSTANCE = Logfire()
1717
span = DEFAULT_LOGFIRE_INSTANCE.span

logfire/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
from ._internal.auto_trace import AutoTraceModule
1010
from ._internal.auto_trace.rewrite_ast import no_auto_trace
1111
from ._internal.config import (
12-
METRICS_PREFERRED_TEMPORALITY,
1312
AdvancedOptions,
1413
ConsoleOptions,
1514
MetricsOptions,
@@ -133,7 +132,6 @@ def loguru_handler() -> dict[str, Any]:
133132
'shutdown',
134133
'load_spans_from_file',
135134
'no_auto_trace',
136-
'METRICS_PREFERRED_TEMPORALITY',
137135
'ScrubMatch',
138136
'ScrubbingOptions',
139137
'VERSION',

logfire/_internal/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@
112112
ObservableUpDownCounter: AggregationTemporality.CUMULATIVE,
113113
ObservableGauge: AggregationTemporality.CUMULATIVE,
114114
}
115-
"""This should be passed as the `preferred_temporality` argument of metric readers and exporters."""
115+
"""
116+
This should be passed as the `preferred_temporality` argument of metric readers and exporters
117+
which send to the Logfire backend.
118+
"""
116119

117120

118121
@dataclass

tests/test_logfire_api.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@ def func() -> None: ...
172172
logfire_api.MetricsOptions()
173173
logfire__all__.remove('MetricsOptions')
174174

175-
assert hasattr(logfire_api, 'METRICS_PREFERRED_TEMPORALITY')
176-
logfire__all__.remove('METRICS_PREFERRED_TEMPORALITY')
177-
178175
assert hasattr(logfire_api, 'load_spans_from_file')
179176
logfire_api.load_spans_from_file(file_path='test')
180177
logfire__all__.remove('load_spans_from_file')

0 commit comments

Comments
 (0)