add logfire instrumentation to services and repository code

Signed-off-by: phernandez <paul@basicmachines.co>
This commit is contained in:
phernandez
2025-11-28 12:47:29 -06:00
parent 28cc5225a7
commit 0ca02a7ebe
20 changed files with 201 additions and 14 deletions
@@ -4,6 +4,7 @@ import fnmatch
import logging
import os
from typing import Dict, List, Optional, Sequence
import logfire
from basic_memory.models import Entity
from basic_memory.repository import EntityRepository
@@ -23,6 +24,7 @@ class DirectoryService:
"""
self.entity_repository = entity_repository
@logfire.instrument(record_return=True)
async def get_directory_tree(self) -> DirectoryNode:
"""Build a hierarchical directory tree from indexed files."""
@@ -90,6 +92,7 @@ class DirectoryService:
# Return the root node with its children
return root_node
@logfire.instrument(record_return=True)
async def get_directory_structure(self) -> DirectoryNode:
"""Build a hierarchical directory structure without file details.
@@ -133,6 +136,7 @@ class DirectoryService:
return root_node
@logfire.instrument(record_return=True)
async def list_directory(
self,
dir_name: str = "/",