-
Notifications
You must be signed in to change notification settings - Fork 9
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
[feat] Add user tracking and enhance telemetry with execution context #286
base: main
Are you sure you want to change the base?
[feat] Add user tracking and enhance telemetry with execution context #286
Conversation
@toyamarinyon is attempting to deploy a commit to the Edge Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
I would like to ask @Rindrics to review the code as well! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I understand that userId
will be introduced to the Langfuse telemetry.
I left one should
suggestion .
tsconfig.json
Outdated
@@ -19,7 +19,11 @@ | |||
} | |||
], | |||
"paths": { | |||
"@/*": ["./*"] | |||
"@/*": ["./*"], | |||
"@giselles-ai/*": ["./packages/*"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
import { PropertiesPanelProvider } from "@giselles-ai/contexts/properties-panel"; | ||
import { ToastProvider } from "@giselles-ai/contexts/toast"; | ||
import { ToolbarContextProvider } from "@giselles-ai/contexts/toolbar"; | ||
import { persistGraph } from "@giselles-ai/giselle-provider/graph/persist"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -347,7 +305,7 @@ export default async function Page({ | |||
<DeveloperModeProvider developerMode={developerMode}> | |||
<GraphContextProvider | |||
defaultGraph={graph} | |||
onPersistAction={persistGraph} | |||
onPersistAction={persistGraphAction} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -335,6 +322,11 @@ async function performFlowExecution( | |||
), | |||
topP, | |||
temperature, | |||
experimental_telemetry: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
registerOTel({ | ||
serviceName: "giselle", | ||
spanProcessors: [noopSpanProcessor], | ||
metricReader, | ||
logRecordProcessor, | ||
traceExporter: new LangfuseExporter({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't expect where the telemetry sent because this initialization does not contain target endpoint.
But reading the Langfuse documant, this configuration seems ok.
Let's merge and check that new fields are included in the telemetry arrived to our Langfuse account
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think having "staging" environment is good if we accept pull requests from forked repo: we can check new functionalities before merging them into main
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rindrics It deployed to staging. please verify!
- Update background image import to use shared component - Import `waitForLangfuseFlush` and implement it in node actions - Add LangfuseExporter for OpenTelemetry integration - Refactor execution telemetry logic to use experimental telemetry - Enhance Tailwind config paths to include packages - Upgrade langfuse dependencies in package.json These changes introduce telemetry integration via Langfuse, enhancing observability. LangfuseExporter is configured with a flushing mechanism to ensure timely data export. Refactoring improves performance by reducing overhead from previous Langfuse traces within execution logic.
- Moved persistGraph logic from page.tsx to a new module at giselle-provider/graph/persist.ts for better modularity - Replaced inline persistGraph logic with import from new module - Simplified graph handling in page.tsx by outsourcing blob deletion and graph URL update functionality This refactor should make the codebase more maintainable by adhering to the single responsibility principle, without introducing breaking changes.
- Change waitForLangfuseFlush from a promise to a function that returns a promise in utils.ts for enhanced laziness - Remove redundant import of after from page.tsx - Call waitForLangfuseFlush using `after` in execution.ts to ensure proper scheduling of post-execution logic This update aims to address more efficient handling of post-execution scheduling and resolve potential memory overhead by improving how flush timing is managed. No breaking changes introduced.
- Introduce userId to the execution context for enhanced telemetry data, allowing better user-specific tracking and debugging - Modify performFlowExecution to include userId in experimental telemetry metadata - Implement parseExecutionContextToTelemetryMetadata to structure metadata, ensuring consistent formatting across different telemetry actions This change aims to improve telemetry insights by associating user identifiers with execution flows, thereby assisting in user behavior analysis and debugging. No breaking changes introduced.
- Add userId to execution parameters for executeStep and retryStep functions to capture user-specific telemetry data - Modify page functions to pass userId from the user context for more granular tracking and user-driven analytics - Ensure all execution paths maintain consistent userId propagation for future scalability in user data insights This enhancement improves the ability to trace executions back to specific users, enabling better analytics and debugging capabilities with no breaking changes introduced.
c13463e
to
5725481
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the errors occurring in Sentry, and SigNoz.
Route /p/[agentId] used "cookies" inside "after(...)". This is not supported. If you need this data inside an "after" callback, use "cookies" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
Changes
Stacks
This repository stacked on #285