Skip to content

Commit

Permalink
[HTTP/OAS] Add operation tags for APM APIs (elastic#181353)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcawl authored and saikatsarkar056 committed Jun 13, 2024
1 parent 1a24fbf commit 38c0bbd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 3 deletions.
14 changes: 14 additions & 0 deletions x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@ openapi: 3.0.0
info:
title: APM UI
version: 1.0.0
tags:
- name: APM agent keys
description: >
Configure APM agent keys to authorize requests from APM agents to the APM Server.
- name: APM annotations
description: >
Annotate visualizations in the APM app with significant events.
Annotations enable you to easily see how events are impacting the performance of your applications.
paths:
/api/apm/agent_keys:
post:
summary: Create an APM agent key
description: Create a new agent key for APM.
tags:
- APM agent keys
requestBody:
required: true
content:
Expand Down Expand Up @@ -46,6 +56,8 @@ paths:
get:
summary: Search for annotations
description: Search for annotations related to a specific service.
tags:
- APM annotations
parameters:
- name: serviceName
in: path
Expand Down Expand Up @@ -98,6 +110,8 @@ paths:
post:
summary: Create a service annotation
description: Create a new annotation for a specific service.
tags:
- APM annotations
parameters:
- name: serviceName
in: path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const invalidateAgentKeyRoute = createApmServerRoute({

const createAgentKeyRoute = createApmServerRoute({
endpoint: 'POST /api/apm/agent_keys 2023-10-31',
options: { tags: ['access:apm', 'access:apm_write'] },
options: { tags: ['access:apm', 'access:apm_write', 'oas-tag:APM agent keys'] },
params: t.type({
body: t.type({
name: t.string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ const serviceAnnotationsRoute = createApmServerRoute({
}),
query: t.intersection([environmentRt, rangeRt]),
}),
options: { tags: ['access:apm'] },
options: { tags: ['access:apm', 'oas-tag:APM annotations'] },
handler: async (resources): Promise<ServiceAnnotationResponse> => {
const apmEventClient = await getApmEventClient(resources);
const { params, plugins, context, request, logger, config } = resources;
Expand Down Expand Up @@ -416,7 +416,7 @@ const serviceAnnotationsRoute = createApmServerRoute({
const serviceAnnotationsCreateRoute = createApmServerRoute({
endpoint: 'POST /api/apm/services/{serviceName}/annotation 2023-10-31',
options: {
tags: ['access:apm', 'access:apm_write'],
tags: ['access:apm', 'access:apm_write', 'oas-tag:APM annotations'],
},
params: t.type({
path: t.type({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export interface APMRouteCreateOptions {
| 'access:ml:canCreateJob'
| 'access:ml:canCloseJob'
| 'access:ai_assistant'
| 'oas-tag:APM agent keys'
| 'oas-tag:APM annotations'
>;
body?: { accepts: Array<'application/json' | 'multipart/form-data'> };
disableTelemetry?: boolean;
Expand Down

0 comments on commit 38c0bbd

Please sign in to comment.