Skip to content

Comments

Move helpers required for trace metrics to the apm-data-access plugin#248513

Merged
viduni94 merged 16 commits intoelastic:mainfrom
viduni94:move-helpers-to-apm-data-access-plugin
Jan 13, 2026
Merged

Move helpers required for trace metrics to the apm-data-access plugin#248513
viduni94 merged 16 commits intoelastic:mainfrom
viduni94:move-helpers-to-apm-data-access-plugin

Conversation

@viduni94
Copy link
Contributor

@viduni94 viduni94 commented Jan 9, 2026

Closes https://github.com/elastic/obs-ai-team/issues/452

Summary

This PR moves the trace metrics implementation from the APM plugin to the Observability Agent Builder plugin.

  • The reason for this change is to keep all the tool implementations within the Observability Agent Builder plugin.
    (The trace metrics implementation was originally included in the APM plugin as it used some helpers defined in the APM plugin)

Changes

  • The trace metrics implementation was removed from the APM plugin and moved to the Observability Agent Builder plugin
  • Helpers used to calculate trace metrics that were located in the APM plugin were moved to the apm-data-access plugin (The Observability Agent Builder plugin already depends on the apm-data-access plugin)

Helpers that were moved from the APM plugin to the apm-data-access plugin:

  • calculateThroughputWithRange
  • getOutcomeAggregation
  • calculateFailedTransactionRate
  • getDurationFieldForTransactions
  • isSummaryFieldSupportedByDocType
  • getHasTransactionsEvents

Additionally, getRollupIntervalForTimeRange helper that was defined in the Observability Agent Builder plugin was also moved to the apm-data-access plugin. (See comment)

Checklist

  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@viduni94 viduni94 self-assigned this Jan 9, 2026
@viduni94 viduni94 added release_note:skip Skip the PR/issue when compiling release notes backport:version Backport to applied version labels v9.3.0 Team:obs-ai Observability AI team v9.4.0 labels Jan 9, 2026
@viduni94
Copy link
Contributor Author

viduni94 commented Jan 9, 2026

/ci

@viduni94
Copy link
Contributor Author

viduni94 commented Jan 9, 2026

/ci

@viduni94
Copy link
Contributor Author

viduni94 commented Jan 9, 2026

/ci

@viduni94
Copy link
Contributor Author

viduni94 commented Jan 9, 2026

/ci

@viduni94
Copy link
Contributor Author

viduni94 commented Jan 9, 2026

/ci

1 similar comment
@viduni94
Copy link
Contributor Author

viduni94 commented Jan 9, 2026

/ci

@viduni94 viduni94 force-pushed the move-helpers-to-apm-data-access-plugin branch from 1deab51 to 3e14fe0 Compare January 12, 2026 18:10
@viduni94
Copy link
Contributor Author

/ci

1 similar comment
@viduni94
Copy link
Contributor Author

/ci

@viduni94 viduni94 changed the title Move helpers required for traceMetrics to the apm-data-access plugin Move helpers required for trace metrics to the apm-data-access plugin Jan 12, 2026
@viduni94 viduni94 marked this pull request as ready for review January 12, 2026 19:37
@viduni94 viduni94 requested a review from a team as a code owner January 12, 2026 19:37
@viduni94 viduni94 requested a review from a team as a code owner January 12, 2026 19:37
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-team (Team:obs-ai)

@botelastic botelastic bot added the Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation label Jan 12, 2026
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-presentation-team (Team:obs-presentation)

@elasticmachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps

History

cc @viduni94

const durationField = getDurationFieldForTransactions(documentType, hasDurationSummaryField);
const outcomeAggs = getOutcomeAggregation(documentType);

const response = await apmEventClient.search('get_trace_metrics', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woop! Awesome to see the apmEventClient working outside of the APM plugin!!

Copy link
Member

@sorenlouv sorenlouv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you Viduni!
I was worried how many new dependencies this would add to the apm-data-access plugin. It looks like zero? That's awesome!
With this change APM data is much more accessible.

@sorenlouv
Copy link
Member

sorenlouv commented Jan 13, 2026

Are there other Agent Builder specifics queries in APM plugin that we can now move back to observability_agent_builder? Or was get_trace_metrics the only one?

Edit: yes, this one: #247810

Copy link
Contributor

@rmyz rmyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presentation changes LGTM

@viduni94
Copy link
Contributor Author

viduni94 commented Jan 13, 2026

Thank you Viduni! I was worried how many new dependencies this would add to the apm-data-access plugin. It looks like zero? That's awesome! With this change APM data is much more accessible.

@sorenlouv
Yeah, no dependencies were added 🎉 Removed 1 dependency from the APM plugin as well (zod)

@viduni94 viduni94 merged commit 9d99b7e into elastic:main Jan 13, 2026
13 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.3

https://github.com/elastic/kibana/actions/runs/20959174415

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
9.3 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 248513

Questions ?

Please refer to the Backport tool documentation

@viduni94 viduni94 removed the v9.3.0 label Jan 13, 2026
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jan 14, 2026
@kibanamachine
Copy link
Contributor

Friendly reminder: Looks like this PR hasn’t been backported yet.
To create automatically backports add a backport:* label or prevent reminders by adding the backport:skip label.
You can also create backports manually by running node scripts/backport --pr 248513 locally
cc: @viduni94

@viduni94 viduni94 added backport:skip This PR does not require backporting and removed backport:version Backport to applied version labels labels Jan 14, 2026
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Jan 14, 2026
smith pushed a commit to smith/kibana that referenced this pull request Jan 16, 2026
…elastic#248513)

Closes elastic/obs-ai-team#452

## Summary

This PR moves the trace metrics implementation from the APM plugin to
the Observability Agent Builder plugin.
- The reason for this change is to keep all the tool implementations
within the Observability Agent Builder plugin.
(The trace metrics implementation was originally included in the APM
plugin as it used some helpers defined in the APM plugin)

### Changes
- The trace metrics implementation was removed from the APM plugin and
moved to the Observability Agent Builder plugin
- Helpers used to calculate trace metrics that were located in the APM
plugin were moved to the `apm-data-access` plugin (The Observability
Agent Builder plugin already depends on the `apm-data-access` plugin)

Helpers that were moved from the APM plugin to the `apm-data-access`
plugin:
- `calculateThroughputWithRange`
- `getOutcomeAggregation`
- `calculateFailedTransactionRate`
- `getDurationFieldForTransactions`
- `isSummaryFieldSupportedByDocType`
- `getHasTransactionsEvents`

Additionally, `getRollupIntervalForTimeRange` helper that was defined in
the Observability Agent Builder plugin was also moved to the
`apm-data-access` plugin. (See
[comment](elastic#247474 (comment)))

### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:obs-ai Observability AI team Team:obs-presentation Focus: APM UI, Infra UI, Hosts UI, Universal Profiling, Obs Overview and left Navigation v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants