Skip to content
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

[DOCS] Add openAPI specification for APM agent configuration endpoints #12948

Merged
merged 9 commits into from
Apr 12, 2024
178 changes: 178 additions & 0 deletions docs/spec/openapi/apm-openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
openapi: 3.1.0
info:
title: APM Server
description: OpenAPI schema for APM Server APIs
version: "0.1"
license:
name: Elastic License 2.0
url: https://www.elastic.co/licensing/elastic-license
contact:
name: APM Team
servers:
- url: /
tags:
- name: agent config
description: APIs that query the APM Server for configuration changes.
x-displayName: APM agent configuration
- name: server info
description: APIs that query general APM Server information.
x-displayName: APM server information
paths:
/:
get:
summary: Get general server information
description: |
This lightweight endpoint is useful as a server up/down health check.
To configure authenticated access to the APM server, the instructions at [APM API key](https://www.elastic.co/guide/en/observability/current/api-key.html) or [APM Secret Token](https://www.elastic.co/guide/en/observability/current/secret-token.html) must be followed to configure the correct permissions for APM access.
operationId: getServerHealth
tags:
- server info
responses:
'200':
$ref: '#/components/responses/200_server_info'
post:
summary: Get general server information
operationId: postServerHealth
tags:
- server info
responses:
'200':
$ref: '#/components/responses/200_server_info'
/config/v1/agents:
get:
summary: Get agent configuration changes
description: >
To configure authenticated access to the APM server, the instructions at [APM API key](https://www.elastic.co/guide/en/observability/current/api-key.html) or [APM Secret Token](https://www.elastic.co/guide/en/observability/current/secret-token.html) must be followed to configure the correct permissions for APM access.
operationId: getAgentConfig
tags:
- agent config
parameters:
- in: query
name: service.name
required: true
schema:
type: string
lcawl marked this conversation as resolved.
Show resolved Hide resolved
- in: query
name: service.environment
schema:
type: string
responses:
'200':
description: A successful response.
content:
application/json:
schema:
type: object
post:
summary: Get agent configuration changes
description: >
To configure authenticated access to the APM server, the instructions at [APM API key](https://www.elastic.co/guide/en/observability/current/api-key.html) or [APM Secret Token](https://www.elastic.co/guide/en/observability/current/secret-token.html) must be followed to configure the correct permissions for APM access.
operationId: postAgentConfig
tags:
- agent config
requestBody:
content:
application/json:
schema:
type: object
required:
- service
properties:
lcawl marked this conversation as resolved.
Show resolved Hide resolved
CAPTURE_BODY:
lcawl marked this conversation as resolved.
Show resolved Hide resolved
type: string
example: off
service:
type: object
required:
- name
properties:
environment:
type: string
example: all
name:
type: string
example: test-service
additionalProperties: true
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
capture_body:
type: string
enum: [ off, errors, transactions, all ]
description: >
For transactions that are HTTP requests, the agent can optionally capture the request body (for example, POST variables).
For transactions that are initiated by receiving a message from a message broker, the agent can capture the textual message body.
example: off
transaction_max_spans:
type: integer
minimum: 0
description: The maximum number of spans that are recorded per transaction.
example: 500
transaction_sample_rate:
type: number
format: float
minimum: 0.0
maximum: 1.0
description: The agent samples transactions at this rate.
example: 0.3
additionaProperties: true
'403':
description: APM Server is configured to fetch agent configuration from Elasticsearch but the configuration is invalid.
'503':
description: APM Server is starting up or Elasticsearch is unreachable.
/config/v1/rum/agents:
Copy link
Member

Choose a reason for hiding this comment

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

I thought rum agentcfg endpoint is almost identical to the regular one, with the exception of auth check and the actual endpoint

get:
summary: Get RUM agent configuration changes
description: >
To configure authenticated access to the APM server, the instructions at [APM API key](https://www.elastic.co/guide/en/observability/current/api-key.html) or [APM Secret Token](https://www.elastic.co/guide/en/observability/current/secret-token.html) must be followed to configure the correct permissions for APM access.
operationId: getRumAgentConfig
tags:
- agent config
responses:
'200':
description: Successful response.
components:
securitySchemes:
apiKeyAuth:
type: apiKey
in: header
name: Authorization
description: 'e.g. Authorization: ApiKey base64AccessApiKey'
secretToken:
type: http
scheme: bearer
bearerFormat: Secret token
responses:
200_server_info:
description: A successful response indicates that the server is up.
content:
application/json:
schema:
description: If an API key or a secret token is passed along with the request, the response payload includes some information about the APM server.
type: object
properties:
build_date:
type: string
format: time-date
build_sha:
type: string
publish_ready:
type: boolean
version:
type: string
examples:
getServerHealthAuthResponse:
summary: Example APM Server information request with a secret token
value:
build_date: '2021-12-18T19:59:06Z'
build_sha: 24fe620eeff5a19e2133c940c7e5ce1ceddb1445
publish_ready: true
version: 8.12.2
security:
- apiKeyAuth: [ ]
- secretToken: [ ]