feat: create agent_traces plugin in observability workspace#11387
Conversation
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
✨ Finishing Touches
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Stylelint (17.3.0)src/plugins/agent_traces/public/application/legacy/discover/application/components/loading_spinner/loading_spinner.scssConfigurationError: Could not find "@osd/stylelint-config". Do you need to install the package or use the "configBasedir" option? src/plugins/agent_traces/public/application/legacy/discover/application/components/no_index_patterns/no_index_patterns.scssConfigurationError: Could not find "@osd/stylelint-config". Do you need to install the package or use the "configBasedir" option? src/plugins/agent_traces/public/application/legacy/discover/application/components/no_results/no_results.scssConfigurationError: Could not find "@osd/stylelint-config". Do you need to install the package or use the "configBasedir" option?
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Comment |
|
Do we want consistency on where to collapse the trace calls for the child calls? The discover trace page has the collapse button on the left, but in the trace details side panel, it is on the left. This created an odd inconsistency experience. |
I believe for the tree view, it's not clear to users if we use the "Kind" label as collapse/expand button, so the button moved and aligned on the right. The traditional gantt chart view still has collapse button on the left for both discover traces and agent traces. But I agree it appears inconsistent. @jasonlhamazon what do you think |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #11387 +/- ##
==========================================
+ Coverage 60.26% 61.02% +0.75%
==========================================
Files 4661 4898 +237
Lines 130163 135501 +5338
Branches 22189 23502 +1313
==========================================
+ Hits 78439 82685 +4246
- Misses 46130 46876 +746
- Partials 5594 5940 +346
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
…tion Signed-off-by: Joshua Li <joshuali925@gmail.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 44a2725. 'Diff too large, requires skip by maintainers after manual review' Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
| return response; | ||
| }; | ||
|
|
||
| export const escapePPLValue = (value: any): string => { |
There was a problem hiding this comment.
can we reuse something that exists in discover traces?
There was a problem hiding this comment.
i don't want agent traces to depend on explore bundle, right now they are independent plugins to reduce impact
ps48
left a comment
There was a problem hiding this comment.
Just a general comment - Multiple files (ppl_request_helpers.tsx, ppl_request_trace.tsx, ppl_resolve_helpers.tsx, etc.) contain no JSX. Should use .ts.
| traceSpansCache, | ||
| traceLoadingState, |
There was a problem hiding this comment.
Including Map state objects (traceSpansCache, spanSpansCache) in useCallback deps creates new function references on every cache update, cascading re-renders to child tables. Use useRef for the cache instead.
There was a problem hiding this comment.
i think using ref the consumer will never re-render, i added a ref along with state for now, will check it later
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit a5e4011. 'Diff too large, requires skip by maintainers after manual review' Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
Signed-off-by: Joshua Li <joshuali925@gmail.com>
a5e4011 to
17c186a
Compare
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 17c186a. 'Diff too large, requires skip by maintainers after manual review' Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
Signed-off-by: Joshua Li <joshuali925@gmail.com>
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit f99c449. 'Diff too large, reduce your PR size or requires skip by maintainers after manual review' Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
@lezzago @joshuali925 , we should keep this for the trace tree. This is a known pattern for the trace tree view that we observe in this space in the industry. |
…ch-project#11387) * add agent_traces plugin similar to explore Signed-off-by: Joshua Li <joshuali925@gmail.com> * add explore.agentTraces.enabled feature flag Signed-off-by: Joshua Li <joshuali925@gmail.com> * copy explore plugin as agent_traces plugin Signed-off-by: Joshua Li <joshuali925@gmail.com> * add plugin entry files with dynamic feature flag Signed-off-by: Joshua Li <joshuali925@gmail.com> * add agent_traces page Signed-off-by: Joshua Li <joshuali925@gmail.com> * Changeset file for PR opensearch-project#11387 created/updated * fix lint Signed-off-by: Joshua Li <joshuali925@gmail.com> * update table styles Signed-off-by: Joshua Li <joshuali925@gmail.com> * feat: add copy button to parent span field in detail panel Signed-off-by: Joshua Li <joshuali925@gmail.com> * feat: add hover tooltip to timeline gantt bars Signed-off-by: Joshua Li <joshuali925@gmail.com> * refactor: use EuiBadge for span category badges and expand categorization Signed-off-by: Joshua Li <joshuali925@gmail.com> * address comments Signed-off-by: Joshua Li <joshuali925@gmail.com> * show token acount when input or output tokens is missing Signed-off-by: Joshua Li <joshuali925@gmail.com> --------- Signed-off-by: Joshua Li <joshuali925@gmail.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Signed-off-by: Mark Boyd <mark.boyd@gsa.gov>
Description
This PR copies the explore plugin and modifies it to agent_traces plugin (see #11345 for details on agent tracing) by implementing the following:
exploreplugin and rename it toagent_traces--explore.agentTraces.enabled=true. It is kept underexplorefor easier management. This feature is disabled by default.This is a very large PR since the plugin is duplicated from an existing large plugin, not built from scratch. I'd recommend reviewing the changes outside of the
agent_tracesdirectory and insidesrc/plugins/agent_traces/public/application/pages/. The other parts are duplicated code, and they may still contain code unused by agent traces plugin.There are some pending items will be added as followup:
Issues Resolved
closes #11345
Screenshot
Testing the changes
UT
Changelog
Check List
yarn test:jestyarn test:jest_integration