Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observability #1484

Merged
merged 305 commits into from
Apr 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
305 commits
Select commit Hold shift + click to select a range
06d9ba5
Refactor - modified models for Span document
aybruhm Feb 23, 2024
f540c1c
Refactor - removde redundant testcases
aybruhm Feb 23, 2024
ab96b4e
:art: Format - ran black
aybruhm Feb 23, 2024
0fe22ac
refactored sidebar to be config based
MohammedMaaz Feb 23, 2024
00bf5d6
Merge branch 'feature/observability' of https://github.com/agenta-ai/…
MohammedMaaz Feb 23, 2024
364ecb0
fixed tailwind import issues
MohammedMaaz Feb 23, 2024
577bbfd
moved dev dependencies to dependencies
MohammedMaaz Feb 23, 2024
00ef66b
fixed global tailwind issue | sidebar refactored
MohammedMaaz Feb 23, 2024
8749f46
Feat - created api router to delete a span of trace and db function t…
aybruhm Feb 27, 2024
1a4911f
Update - replace variant_id with base_id and config_name
aybruhm Feb 27, 2024
b518b13
Refactor - update create trace span
aybruhm Feb 27, 2024
28e97ab
Refactor - regenerate client backend with fern
aybruhm Feb 27, 2024
7a65a04
Update - import db query to fetch app by name and parameters
aybruhm Feb 27, 2024
ab4626c
Update - remove arguments in ag.init()
aybruhm Feb 27, 2024
06d45ac
:art: Format - ran black for agenta-cli
aybruhm Feb 27, 2024
13fb891
Refactor - update trace db and db function to create trace span
aybruhm Feb 27, 2024
da2480f
Refactor - modified llm tracing module
aybruhm Feb 27, 2024
1fe9609
Refactor - remove ag.trace function
aybruhm Feb 27, 2024
ae7dafd
Feat - integrate llm tracing to sdk
aybruhm Feb 28, 2024
a3f54a2
Refactor - change status value from INITIATED to SUCCESS
aybruhm Feb 28, 2024
47225bb
Merge branch 'feature/llm-tracing' into feature/observability
aybruhm Feb 28, 2024
668a8f8
Update - brought back use of ag.trace and added comments
aybruhm Feb 28, 2024
91c9fd1
Refactor - update ag.trace comment
aybruhm Feb 28, 2024
4c44a67
Refactor - update ag.trace comment
aybruhm Feb 28, 2024
a1ca3a3
Refactor - replace mock data with real data
aybruhm Feb 28, 2024
766fbec
Feat - created db function to fetch app variant by base and config name
aybruhm Feb 28, 2024
a3580fe
Refactor - replaced mock functions
aybruhm Feb 28, 2024
53e8130
Refactor - update base_span model
aybruhm Feb 28, 2024
6360f3c
Refactor - moved SpanDB to bottom
aybruhm Feb 28, 2024
d0ab203
Refactor - modified spans_to_pydantic use
aybruhm Feb 28, 2024
bd2ba56
Update - refactored llm tracing
aybruhm Feb 28, 2024
19b346c
Refactor - improve function to get prompt system
aybruhm Feb 28, 2024
150c155
:art: Format - ran black
aybruhm Feb 28, 2024
90ab763
Update - regenerate sdk client backend with fern
aybruhm Feb 28, 2024
12af162
Update - removed and added fields in create span/trace model
aybruhm Feb 28, 2024
65aa2c9
Update - modified trace update db function
aybruhm Feb 28, 2024
8bc3507
Refactor - remove redundant fields
aybruhm Feb 28, 2024
2eddd26
Update - modified observability client
aybruhm Feb 28, 2024
e42b996
Update - refactor fetch app by name and parameters query
aybruhm Feb 28, 2024
1d760d9
Refactor - remove duplicate comment
aybruhm Feb 28, 2024
0a68c47
Update - fix keyerror in create_span function
aybruhm Feb 28, 2024
31b010a
Refactor - change inputs type to Dict
aybruhm Feb 28, 2024
87498c2
Update - refactor dashboard for observability
aybruhm Feb 28, 2024
bf21381
:art: Format - ran black
aybruhm Feb 28, 2024
cf1ed6b
Update - add logic to store active app configuration
aybruhm Feb 29, 2024
7df0fa0
Refactor - modified agenta_init to retrieve app config from singleton
aybruhm Feb 29, 2024
6dc1443
Update - added app_id to env vars when building llm app image
aybruhm Feb 29, 2024
721e94e
servertable improved
MohammedMaaz Feb 29, 2024
8ec02a3
Merge branch 'feature/observability' of https://github.com/agenta-ai/…
MohammedMaaz Feb 29, 2024
2d1b157
fixed observability router return type
MohammedMaaz Feb 29, 2024
58b463d
Feat - created filters service
aybruhm Mar 1, 2024
7b53a90
Feat - created redis cache service
aybruhm Mar 1, 2024
2dfde32
Update - add function to convert generation span inputs variables
aybruhm Mar 1, 2024
83aee0e
Feat - created traces view endpoint(s) and db functions and refactore…
aybruhm Mar 1, 2024
cb268cd
Refactor - switch to ids to follow design document
aybruhm Mar 1, 2024
adcc7f9
Merge branch 'main' into feature/observability
aybruhm Mar 1, 2024
1f3206f
Update - set default environment to playground
aybruhm Mar 2, 2024
d54a481
Refactor - update data in ObservabilityDashboardData
aybruhm Mar 2, 2024
dde04aa
Refactor - remove filtering and aggregation logic from redis cache se…
aybruhm Mar 2, 2024
618dcf5
Update - revert back to previous sidebar
aybruhm Mar 2, 2024
22902e9
Update - refactor agenta sdk to previous state and modified wrapped_d…
aybruhm Mar 2, 2024
45048c5
Refactor - added environment to llm tracing, observability client and…
aybruhm Mar 2, 2024
20217bb
Update - remove default from trace and span db to event db function
aybruhm Mar 2, 2024
52eb941
:art: Format - ran black
aybruhm Mar 2, 2024
fb67db2
Update - created get_pagination_skip_limit converter
aybruhm Mar 5, 2024
f8907cd
Refactor - update pagination and sorting logic when retrieving spans …
aybruhm Mar 5, 2024
8e7efa7
default value capability to ServerTable
MohammedMaaz Mar 5, 2024
6b9f9e1
Merge branch 'feature/observability' of https://github.com/agenta-ai/…
MohammedMaaz Mar 5, 2024
915a508
Update - added metadata for generation span detail
aybruhm Mar 5, 2024
6cf77fe
Update - modified fetch_generation_spans query
aybruhm Mar 5, 2024
ab018fc
Update - modified get spans of trace router
aybruhm Mar 5, 2024
e83cb94
Minor update - ensure environment is visible in span generation detail
aybruhm Mar 5, 2024
77e6cc0
Update - return list of spans if trace_id is provided when retriving …
aybruhm Mar 5, 2024
337b4af
Update - set response_model of get_spans_of_trace to Any
aybruhm Mar 5, 2024
1b039b1
Refactor - remove custom type and make use of typing.Any
aybruhm Mar 5, 2024
53b359c
Update - allow unique cache key for observability dashboard
aybruhm Mar 6, 2024
32effff
Update - resolve filtering by timestamp
aybruhm Mar 6, 2024
1a328e1
fixed sidebar links for evaluation and annotations
MohammedMaaz Mar 7, 2024
f40fbe9
Update - resolve concerns in pr#1427
aybruhm Mar 10, 2024
68b2406
Update - revamp trace and span db documents
aybruhm Mar 10, 2024
195e9fa
Feat - created llm logger
aybruhm Mar 10, 2024
d1d2d96
Feat - created module responsible for handling async tasks
aybruhm Mar 10, 2024
e86c76c
Feat - implemented module for handling stateful operations
aybruhm Mar 10, 2024
39b8887
Feat - implemented llm tracing with new tracing sdk
aybruhm Mar 10, 2024
d456bd1
Update - pass trace/span generated objectid to request
aybruhm Mar 10, 2024
b9e46ac
Refactor - change user from linked document to str
aybruhm Mar 11, 2024
e15d335
UI enhancements | sidebar | fillers
MohammedMaaz Mar 11, 2024
93db6f6
Update - improve cache key for observability data
aybruhm Mar 12, 2024
9610eed
Refactor - update retrieve_observability_dashboard db function
aybruhm Mar 12, 2024
98854cc
Update - refactor pagination logic for traces/spans
aybruhm Mar 12, 2024
f21e86f
:art: Format - ran black
aybruhm Mar 12, 2024
e9915d5
Update - refactor observability dashboard data request params
aybruhm Mar 14, 2024
09f4d49
Feat - created filters for obs dashboard
aybruhm Mar 14, 2024
13d9008
Refactor - rewrote retrieve obs dashboard aggregation logic
aybruhm Mar 14, 2024
8fb36a6
Refactor - set expiry time for obs dashboard agg to 15 minutes
aybruhm Mar 14, 2024
1110157
:art: Format - ran black
aybruhm Mar 14, 2024
d0a13ee
Refactor - sort obs data by timestamp and fix success/failure count
aybruhm Mar 14, 2024
94b2bdc
sidebar tag feature
MohammedMaaz Mar 14, 2024
a3c76ea
Merge branch 'feature/observability' of https://github.com/agenta-ai/…
MohammedMaaz Mar 14, 2024
91cdaea
Feat - created helper function to fill observability dashboard missin…
aybruhm Mar 15, 2024
11cef09
Refactor - simplified spans aggregation logic by timerange
aybruhm Mar 15, 2024
571de62
Update - set condition to cache data if its len exceeds/equals 1
aybruhm Mar 15, 2024
dd5649f
Refactor - sort full observability data
aybruhm Mar 15, 2024
03e59a9
:art: Format - ran black
aybruhm Mar 15, 2024
b20d5a5
Refactor - update cache_observability_data
aybruhm Mar 15, 2024
9e49ea1
Update - added logic to fill data for 24_hours
aybruhm Mar 15, 2024
d0a954f
Refactor - truncate timestamp
aybruhm Mar 15, 2024
f918a7b
Update - fix truncate date issue
aybruhm Mar 15, 2024
5cf54c0
Update - fix count of traces/spans by filter
aybruhm Mar 15, 2024
cec89b9
Update - modified latency sum aggregation logic
aybruhm Mar 15, 2024
2b42271
Update - divide duration by 100 to get seconds
aybruhm Mar 15, 2024
05daeb6
Update - remove redundant function
aybruhm Mar 15, 2024
b45d222
Refactor - remove / 100 from traces and spans converter to pydantic
aybruhm Mar 18, 2024
e063578
Update - improve spans/traces count by filters_param
aybruhm Mar 18, 2024
8e25aad
Refactor - update trace/span db models based on pr#1432 review
aybruhm Mar 18, 2024
ca49587
Refactor - replace base_id and config_name with variant_id
aybruhm Mar 18, 2024
71660ac
Refactor - update base and create trace pydantic model
aybruhm Mar 18, 2024
a89fc8d
Feat - created endpoint to retrieve variant using base id
aybruhm Mar 18, 2024
6b5d74e
Refactor - rewrite tracing sdk
aybruhm Mar 18, 2024
6fda935
Feat - created span tracing decorator
aybruhm Mar 18, 2024
8c583c2
Update - integrated tracing to agenta sdk
aybruhm Mar 18, 2024
444e2c3
Cleanup - remove redundant file(s)
aybruhm Mar 18, 2024
eda8540
formatters utils | evaluators link fixed
MohammedMaaz Mar 18, 2024
095dbcc
Merge branch 'feature/observability' of https://github.com/agenta-ai/…
MohammedMaaz Mar 18, 2024
1a81b07
Refactor - update example to make use of observability tracing
aybruhm Mar 18, 2024
ecc2007
:art: Format - ran black
aybruhm Mar 18, 2024
e63247a
Refactor - update pydantic models to create and update trace/span
aybruhm Mar 19, 2024
925590d
Refactor - allow tracing object state to be shared across the llm app
aybruhm Mar 19, 2024
eb495ff
fixed sidebar links for evaluation and annotations
MohammedMaaz Mar 7, 2024
98d0024
UI enhancements | sidebar | fillers
MohammedMaaz Mar 11, 2024
6f5118d
sidebar tag feature
MohammedMaaz Mar 14, 2024
52b1e34
Update - improve cache key for observability data
aybruhm Mar 12, 2024
81fe046
Refactor - update retrieve_observability_dashboard db function
aybruhm Mar 12, 2024
5607c0c
Update - refactor pagination logic for traces/spans
aybruhm Mar 12, 2024
bc29045
:art: Format - ran black
aybruhm Mar 12, 2024
3528ba6
Update - refactor observability dashboard data request params
aybruhm Mar 14, 2024
657adc1
Feat - created filters for obs dashboard
aybruhm Mar 14, 2024
34fa185
Refactor - rewrote retrieve obs dashboard aggregation logic
aybruhm Mar 14, 2024
c094fcf
Refactor - set expiry time for obs dashboard agg to 15 minutes
aybruhm Mar 14, 2024
dd955c6
:art: Format - ran black
aybruhm Mar 14, 2024
84b0e69
Refactor - sort obs data by timestamp and fix success/failure count
aybruhm Mar 14, 2024
cc072ad
formatters utils | evaluators link fixed
MohammedMaaz Mar 18, 2024
0cca82b
Feat - created helper function to fill observability dashboard missin…
aybruhm Mar 15, 2024
3ef4ccd
Refactor - simplified spans aggregation logic by timerange
aybruhm Mar 15, 2024
cb9e7ce
Update - set condition to cache data if its len exceeds/equals 1
aybruhm Mar 15, 2024
739e552
Refactor - sort full observability data
aybruhm Mar 15, 2024
be688a4
:art: Format - ran black
aybruhm Mar 15, 2024
400373a
Refactor - update cache_observability_data
aybruhm Mar 15, 2024
d724007
Update - added logic to fill data for 24_hours
aybruhm Mar 15, 2024
dd39b9c
Refactor - truncate timestamp
aybruhm Mar 15, 2024
d487f69
Update - fix truncate date issue
aybruhm Mar 15, 2024
2ab603a
Update - fix count of traces/spans by filter
aybruhm Mar 15, 2024
2ddaf1a
Update - modified latency sum aggregation logic
aybruhm Mar 15, 2024
32f71a0
Update - divide duration by 100 to get seconds
aybruhm Mar 15, 2024
fda4748
Update - remove redundant function
aybruhm Mar 15, 2024
5f1420a
Refactor - remove / 100 from traces and spans converter to pydantic
aybruhm Mar 18, 2024
838c69e
Update - improve spans/traces count by filters_param
aybruhm Mar 18, 2024
4e6dc81
Update - regenerate backend cli client with fern
aybruhm Mar 19, 2024
5d04cab
Cleanup - remove lru_cache decorator
aybruhm Mar 19, 2024
7e08cd0
:art: Format - ran black
aybruhm Mar 19, 2024
98adad4
Merge branch 'feature/observability' into v1/observability-sdk
aybruhm Mar 19, 2024
84df2fd
Refactor - update app_async llm example
aybruhm Mar 19, 2024
1732b42
Major refactor - update observability sdk
aybruhm Mar 19, 2024
c2a48b0
Update - regenerate cli backend client
aybruhm Mar 20, 2024
05b2f1c
Refactor - update observability workflow -> sdk, pydantic api models,…
aybruhm Mar 20, 2024
9d1bbf4
Refactor - update observability workflow -> sdk, pydantic api models,…
aybruhm Mar 20, 2024
ba03238
Minor refactor - update trace outputs incase of exception
aybruhm Mar 20, 2024
0450424
Refactor - cleanup observability sdk and update backend response
aybruhm Mar 20, 2024
0ce7092
Add new files and update .gitignore
mmabrouk Mar 21, 2024
91ebb5b
Update - modify trace and span detail response
aybruhm Mar 24, 2024
7c967f2
Minor update - refactor trace detail response types
aybruhm Mar 25, 2024
b844614
Minor refactor - rename input to inputs
aybruhm Mar 25, 2024
e3313b4
Added new feature flag for cloudDev that serves the apps locally
mmabrouk Mar 25, 2024
121034e
Refactor - modified tracing sdk and backend logic
aybruhm Mar 25, 2024
33f9c30
Minor refactor - update trace/span detail response
aybruhm Mar 25, 2024
f33a84f
Minor refactor - remove print statement in trace method
aybruhm Mar 25, 2024
a409093
Refactor - modified obs sdk and backend logic
aybruhm Mar 25, 2024
d622b93
Minor refactor - added logging for create_span
aybruhm Mar 25, 2024
8acfb3c
style
mmabrouk Mar 25, 2024
bd6ae0b
oo
mmabrouk Mar 25, 2024
7abe8f4
Merge branch 'v1/observability-sdk' into v1/patch
aybruhm Mar 25, 2024
46f7ad1
bf
mmabrouk Mar 25, 2024
d130f65
Merge branch 'v1/patch' of https://github.com/agenta-ai/agenta into v…
mmabrouk Mar 25, 2024
78db3c3
format
mmabrouk Mar 25, 2024
590345c
Merge pull request #1461 from Agenta-AI/v1/patch
mmabrouk Mar 25, 2024
6e79904
Minor refactor - remove latency divide by 1000
aybruhm Mar 26, 2024
40be464
Minor refactor - fix formatLatency formatter
aybruhm Mar 26, 2024
c5b4b38
Refactor - revert back to previous state
aybruhm Mar 26, 2024
34ff693
Refactor - update tracing sdk
aybruhm Mar 28, 2024
e04c63b
Update - modified trace/generate detail content
aybruhm Mar 28, 2024
6b9966a
Minor refactor - update format latency to not divide by 1000
aybruhm Mar 28, 2024
3dce1c4
Minor refactor - rename llm content ouput to outputs
aybruhm Mar 28, 2024
4d29336
Minor refactor - replace content type 'LLMContent' to 'Dict'
aybruhm Mar 28, 2024
64769ae
Minor refactor - revert formatLatency back to previous state and mult…
aybruhm Mar 28, 2024
c071ab0
Update - created app_with_observability folder along with llm examples
aybruhm Apr 2, 2024
ad411ea
Cleanup - refactor observability to follow otel best practices
aybruhm Apr 3, 2024
eccdb70
Minor refactor - update use of tracing in obs examples
aybruhm Apr 3, 2024
dd81a35
Merge branch 'main' into v1/observability-sdk
aybruhm Apr 3, 2024
18e0508
Refactor - make use of llm_tracing func directly
aybruhm Apr 4, 2024
7f9310f
removed Lucide icons and installed react-icons
bekossy Apr 4, 2024
c60146c
Merge pull request #1486 from Agenta-AI/oss/issue-323/-change-token-icon
aakrem Apr 4, 2024
f30c5e3
updated package lock
bekossy Apr 4, 2024
301406e
installed missing tremor package
bekossy Apr 4, 2024
728c55e
Refactor - added pagination filtering for traces/spans, update meta u…
aybruhm Apr 5, 2024
da3deaa
Update - added support for nth tree for spans
aybruhm Apr 5, 2024
40dfa58
Update - added logic to flush queue and its size
aybruhm Apr 7, 2024
906ee7a
Minor refactor - clean up cache observability data function
aybruhm Apr 7, 2024
638e9ef
Minor refactor - set DEBUG to False and remove redundant imports
aybruhm Apr 7, 2024
deef706
Refactor - raise exception in case of error in running execute_function
aybruhm Apr 7, 2024
642afb8
:art: Format - ran black
aybruhm Apr 7, 2024
d39e043
Cleanup - remove old version of observability backend
aybruhm Apr 9, 2024
8885095
Refactor - added pagination filtering for traces/spans, update meta u…
aybruhm Apr 5, 2024
15bf395
Cleanup - remove event_db_manager
aybruhm Apr 9, 2024
aa900b3
Cleanup - remove redunant codes belonging to observability
aybruhm Apr 9, 2024
3fb3a17
Cleanup - remove redundant codes relating to observability
aybruhm Apr 9, 2024
02d5129
Update - fix issue with request body with fern-python-sdk and regener…
aybruhm Apr 11, 2024
81a523b
Update - regenerate sdk client backend
aybruhm Apr 11, 2024
8654866
Refactor - update tracing sdk
aybruhm Apr 11, 2024
2861e6d
Refactor - update tracing sdk
aybruhm Apr 12, 2024
4afcd60
Minor refactor - fix traces creation after ending trace recording
aybruhm Apr 12, 2024
97f77ac
Update - fix 307 temporary redirect for POST /traces/
aybruhm Apr 12, 2024
5746d02
Minor refactor - set appropriate type of span to ag.span decorator
aybruhm Apr 12, 2024
82eee82
Minor update - rename /traces/ to /trace/ to fix 307 permanently
aybruhm Apr 12, 2024
ccf3a10
Minor refactor - include loggers in each tracing step and update entr…
aybruhm Apr 12, 2024
e9e462a
bump pyproject.toml
mmabrouk Apr 13, 2024
86d18f7
Update pyproject.toml
mmabrouk Apr 13, 2024
1ed5be0
Update pyproject.toml
mmabrouk Apr 13, 2024
092a7d0
Minor refactor - add function to clear recorded spans after trace rec…
aybruhm Apr 13, 2024
878b547
:art: Format - ran black
aybruhm Apr 13, 2024
d33c43e
Minor refactor - include app_id & variant_id to (child) span creation…
aybruhm Apr 13, 2024
d006f68
Minor refactor - update import for observability
aybruhm Apr 13, 2024
f92a3ab
Minor refactor - include environment where trace is been recording to…
aybruhm Apr 14, 2024
210d8c3
Minor refactor - update config when starting parent span
aybruhm Apr 14, 2024
56b24a0
Merge remote-tracking branch 'origin/main' into v1/observability-sdk
mmabrouk Apr 14, 2024
749271b
bump v
mmabrouk Apr 14, 2024
bd99150
center sidebar menuitems on expand
bekossy Apr 15, 2024
20cc3d3
removed cloud related menuitems from oss
bekossy Apr 15, 2024
190ed31
fixed logout conditional
bekossy Apr 15, 2024
338312a
disabled observability menitem in oss
bekossy Apr 15, 2024
8f41136
Update - ingest variant_name, and revision to config when running llm…
aybruhm Apr 15, 2024
da33178
Update - bump alpha release of sdk
aybruhm Apr 15, 2024
5013a5a
bug fix
bekossy Apr 15, 2024
57f5b5c
Update pyproject.toml
mmabrouk Apr 15, 2024
ce06dd1
Minor refactor - make use or right environment when llm app is deploy…
aybruhm Apr 15, 2024
9919a76
Minor refactor - bump alpha release
aybruhm Apr 15, 2024
7b75bc4
added newrelic
mmabrouk Apr 16, 2024
62a564b
updated useEffect onDeleteRow
bekossy Apr 16, 2024
badf758
fixed failing cypress test
bekossy Apr 16, 2024
175878d
Cleanup - remove observability testcases and fixtures
aybruhm Apr 16, 2024
13dce94
version bump
mmabrouk Apr 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor - modified spans_to_pydantic use
  • Loading branch information
aybruhm committed Feb 28, 2024
commit d0ab20309fb1a16aabb2c8d564cd5a41a5555c2b
28 changes: 15 additions & 13 deletions agenta-backend/agenta_backend/models/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,27 +519,29 @@ def testset_db_to_pydantic(test_set_db: TestSetDB) -> TestSetOutput:
)


async def spans_to_pydantic(spans: List[ObjectId], trace_db: TraceDB) -> List[Span]:
app_variant_db = await db_manager.fetch_app_variant_by_id(trace_db.variant_id)
spans_db = [
await SpanDB.find_one(SpanDB.id == ObjectId(span_id)) for span_id in spans
]
return [
Span(
async def spans_to_pydantic(spans_db: List[SpanDB]) -> List[Span]:
spans = []
for span_db in spans_db:
app_variant_db = await db_manager.fetch_app_variant_by_base_id_and_config_name(
span_db.trace.base_id, span_db.trace.config_name
)

span = Span(
id=str(span_db.id),
created_at=span_db.created_at,
created_at=span_db.created_at.isoformat(),
variant=SpanVariant(
variant_id=str(app_variant_db.id),
variant_name=app_variant_db.variant_name,
revision=app_variant_db.revision,
),
environment="",
status=SpanStatus(value=trace_db.status.value, error=trace_db.status.error),
status=SpanStatus(value=span_db.status.value, error=span_db.status.error),
metadata=span_db.meta,
user_id=str(trace_db.user.id),
).dict(exclude_unset=True)
for span_db in spans_db
]
user_id=str(span_db.trace.user.id), # Assuming trace_db exists
)
spans.append(span.dict(exclude_unset=True))

return spans


def feedback_db_to_pydantic(feedback_db: FeedbackDB) -> FeedbackOutput:
Expand Down