03 - Spacetime apm api shared#268992
Conversation
b5c54f8 to
e94edf6
Compare
87ada6d to
8d12376
Compare
4512b55 to
46b7d51
Compare
f13e396 to
7c59999
Compare
46b7d51 to
fb27ffa
Compare
7c59999 to
b45fed3
Compare
fb27ffa to
3288f6e
Compare
## Summary Extracts agent configuration definitions from the `apm` plugin into the `@kbn/apm-common` package (`x-pack/platform/packages/shared/kbn-apm-common`). This moves agent configuration types, constants, runtime types (duration, bytes, boolean, integer, capture body, etc.), setting definitions (general, Java, mobile, eDOT SDK), and related tests out of `x-pack/solutions/observability/plugins/apm/common/agent_configuration/` into the shared platform package. The APM plugin files now re-export from `@kbn/apm-common` to maintain backwards compatibility. The package is placed under `x-pack/` since its only consumer is the APM plugin, which is already in x-pack. This is the second PR in a stack: - **PR 1:** [01 - Spacetime apm types](#268981) - **PR 2 (this):** Move agent configuration definitions to `@kbn/apm-common` - **PR 3:** [03 - Spacetime apm api shared](#268992) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
## Summary Extracts agent configuration definitions from the `apm` plugin into the `@kbn/apm-common` package (`x-pack/platform/packages/shared/kbn-apm-common`). This moves agent configuration types, constants, runtime types (duration, bytes, boolean, integer, capture body, etc.), setting definitions (general, Java, mobile, eDOT SDK), and related tests out of `x-pack/solutions/observability/plugins/apm/common/agent_configuration/` into the shared platform package. The APM plugin files now re-export from `@kbn/apm-common` to maintain backwards compatibility. The package is placed under `x-pack/` since its only consumer is the APM plugin, which is already in x-pack. This is the second PR in a stack: - **PR 1:** [01 - Spacetime apm types](elastic#268981) - **PR 2 (this):** Move agent configuration definitions to `@kbn/apm-common` - **PR 3:** [03 - Spacetime apm api shared](elastic#268992) --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…ally, or add an exception to src/dev/yarn_deduplicate/index.ts and then commit the changes and push to your branch
b45fed3 to
1de363c
Compare
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]
History
|
lucaslopezf
left a comment
There was a problem hiding this comment.
LGTM! Just a few comments to take into account just in case, but I'll compare every file with the original in part 04.
Note for other reviewer: you might think some options, security-related metadata, etc, are missing, but they're addressed in part 04. For example source_maps/route.ts#L61-L75. I’m saying this because at first I left comments referring to these points, but when I saw part 04, I realized they were already addressed there
| params: t.type({ | ||
| body: t.type({ | ||
| name: t.string, | ||
| privileges: t.array(t.union([t.literal('event:write'), t.literal('config_agent:read')])), |
|
|
||
| export const fieldValueStatsTransactionsRoute = defineRoute<FieldValueStatsTransactionsResponse>()({ | ||
| endpoint: 'GET /internal/apm/correlations/field_value_stats/transactions', | ||
| params: t.type({ |
There was a problem hiding this comment.
Why these params are different to the original?
| endpoint: 'GET /internal/apm/service-map', | ||
| params: t.type({ | ||
| query: t.intersection([ | ||
| t.partial({ |
| service_name: t.string, | ||
| service_version: t.string, | ||
| bundle_filepath: t.string, | ||
| sourcemap: t.union([t.string, t.any]).pipe(jsonRt).pipe(sourceMapRt), |
There was a problem hiding this comment.
This is different from the original just take in account for the next PR
| @@ -0,0 +1,86 @@ | |||
| /* | |||
There was a problem hiding this comment.
If C and me checked well, we are missing the nexts routes:
- https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/apm/server/routes/services/route.ts#L311-L319
- https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/apm/server/routes/services/route.ts#L946-L984
- https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/apm/server/routes/services/route.ts#L447-L520
Is it dead code?
Summary
Creates the
@kbn/apm-api-sharedpackage (x-pack/platform/packages/shared/kbn-apm-api-shared) and defines all APM route definitions as typed contracts.This introduces:
defineRouteutility and shared default API types (kueryRt,rangeRt,probabilityRt, etc.)callApiandcreateCallApmApiclient utilities for type-safe API consumptionThis is the third PR in a stack:
@kbn/apm-api-sharedwith APM route definitions