Skip to content

Commit

Permalink
Keep METRICS_PREFERRED_TEMPORALITY private (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmojaki authored and petyosi committed Oct 1, 2024
1 parent bd4273d commit 2886e54
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions logfire-api/logfire_api/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from ._internal.auto_trace import AutoTraceModule as AutoTraceModule
from ._internal.auto_trace.rewrite_ast import no_auto_trace as no_auto_trace
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
from ._internal.config import AdvancedOptions as AdvancedOptions, ConsoleOptions as ConsoleOptions, MetricsOptions as MetricsOptions, PydanticPlugin as PydanticPlugin, configure as configure
from ._internal.constants import LevelName as LevelName
from ._internal.exporters.file import load_file as load_spans_from_file
from ._internal.main import Logfire as Logfire, LogfireSpan as LogfireSpan
Expand All @@ -11,7 +11,7 @@ from .integrations.structlog import LogfireProcessor as StructlogProcessor
from .version import VERSION as VERSION
from logfire.sampling import SamplingOptions as SamplingOptions

__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']
__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']

DEFAULT_LOGFIRE_INSTANCE = Logfire()
span = DEFAULT_LOGFIRE_INSTANCE.span
Expand Down
2 changes: 0 additions & 2 deletions logfire/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from ._internal.auto_trace import AutoTraceModule
from ._internal.auto_trace.rewrite_ast import no_auto_trace
from ._internal.config import (
METRICS_PREFERRED_TEMPORALITY,
AdvancedOptions,
ConsoleOptions,
MetricsOptions,
Expand Down Expand Up @@ -133,7 +132,6 @@ def loguru_handler() -> dict[str, Any]:
'shutdown',
'load_spans_from_file',
'no_auto_trace',
'METRICS_PREFERRED_TEMPORALITY',
'ScrubMatch',
'ScrubbingOptions',
'VERSION',
Expand Down
5 changes: 4 additions & 1 deletion logfire/_internal/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,10 @@
ObservableUpDownCounter: AggregationTemporality.CUMULATIVE,
ObservableGauge: AggregationTemporality.CUMULATIVE,
}
"""This should be passed as the `preferred_temporality` argument of metric readers and exporters."""
"""
This should be passed as the `preferred_temporality` argument of metric readers and exporters
which send to the Logfire backend.
"""


@dataclass
Expand Down
3 changes: 0 additions & 3 deletions tests/test_logfire_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,6 @@ def func() -> None: ...
logfire_api.MetricsOptions()
logfire__all__.remove('MetricsOptions')

assert hasattr(logfire_api, 'METRICS_PREFERRED_TEMPORALITY')
logfire__all__.remove('METRICS_PREFERRED_TEMPORALITY')

assert hasattr(logfire_api, 'load_spans_from_file')
logfire_api.load_spans_from_file(file_path='test')
logfire__all__.remove('load_spans_from_file')
Expand Down

0 comments on commit 2886e54

Please sign in to comment.