Skip to content

Commit 181640f

Browse files
authored
Stop collecting package versions (#387)
1 parent fe12714 commit 181640f

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

logfire/_internal/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,10 @@
5353
from logfire.version import VERSION
5454

5555
from .auth import DEFAULT_FILE, DefaultFile, is_logged_in
56-
from .collect_system_info import collect_package_info
5756
from .config_params import ParamManager, PydanticPluginRecordValues
5857
from .constants import (
5958
DEFAULT_FALLBACK_FILE_NAME,
6059
OTLP_MAX_BODY_SIZE,
61-
RESOURCE_ATTRIBUTES_PACKAGE_VERSIONS,
6260
LevelName,
6361
)
6462
from .exporters.console import (
@@ -583,8 +581,10 @@ def _initialize(self) -> ProxyTracerProvider:
583581
with suppress_instrumentation():
584582
otel_resource_attributes: dict[str, Any] = {
585583
ResourceAttributes.SERVICE_NAME: self.service_name,
586-
RESOURCE_ATTRIBUTES_PACKAGE_VERSIONS: json.dumps(collect_package_info(), separators=(',', ':')),
587584
ResourceAttributes.PROCESS_PID: os.getpid(),
585+
# Having this giant blob of data associated with every span/metric causes various problems so it's
586+
# disabled for now, but we may want to re-enable something like it in the future
587+
# RESOURCE_ATTRIBUTES_PACKAGE_VERSIONS: json.dumps(collect_package_info(), separators=(',', ':')),
588588
}
589589
if self.service_version:
590590
otel_resource_attributes[ResourceAttributes.SERVICE_VERSION] = self.service_version
Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,8 @@
1-
import json
2-
31
from dirty_equals import IsPartialDict
42

5-
from logfire import VERSION, info
6-
from logfire.testing import TestExporter
7-
8-
9-
def test_collect_resources(exporter: TestExporter) -> None:
10-
info('test')
11-
12-
resources = [
13-
span['resource']
14-
for span in exporter.exported_spans_as_dict(include_resources=True, include_package_versions=True)
15-
]
3+
from logfire import VERSION
4+
from logfire._internal.collect_system_info import collect_package_info
165

17-
assert len(resources) == 1
18-
resource = resources[0]
19-
data = json.loads(resource['attributes']['logfire.package_versions'])
206

21-
assert data == IsPartialDict({'logfire': VERSION})
7+
def test_collect_package_info() -> None:
8+
assert collect_package_info() == IsPartialDict({'logfire': VERSION})

0 commit comments

Comments
 (0)