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

Add APM OpenAPI spec #180096

Merged
merged 8 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 169 additions & 0 deletions x-pack/plugins/observability_solution/apm/docs/openapi/apm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
openapi: 3.0.0
info:
title: APM UI
version: 1.0.0
paths:
/api/apm/agent_keys:
post:
summary: Create an APM agent key
description: Create a new agent key for APM.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
name:
type: string
privileges:
type: array
items:
type: string
enum:
- event:write
- config_agent:read
responses:
Copy link
Contributor

Choose a reason for hiding this comment

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

This endpoint also returns 400 and 403. Should we doc that too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not at this time. These specs are incomplete and we're going to be updating them.

"200":
description: Agent key created successfully
content:
application/json:
schema:
type: object
properties:
api_key:
type: string
expiration:
type: integer
format: int64
id:
type: string
name:
type: string
encoded:
type: string
/api/apm/services/{serviceName}/annotation/search:
get:
summary: Search for annotations
description: Search for annotations related to a specific service.
parameters:
- name: serviceName
in: path
required: true
description: The name of the service
schema:
type: string
- name: environment
in: query
required: false
description: The environment to filter annotations by
schema:
type: string
- name: start
in: query
required: false
description: The start date for the search
schema:
type: string
- name: end
in: query
required: false
description: The end date for the search
schema:
type: string
responses:
"200":
Copy link
Contributor

Choose a reason for hiding this comment

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

This one seems to return 500 when business logic error happens - should be 400 though.

description: Successful response
content:
application/json:
schema:
type: object
properties:
annotations:
type: array
items:
type: object
properties:
type:
type: string
enum:
- version
id:
type: string
"@timestamp":
type: number
text:
type: string
/api/apm/services/{serviceName}/annotation:
post:
summary: Create a service annotation
description: Create a new annotation for a specific service.
parameters:
- name: serviceName
in: path
required: true
description: The name of the service
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
'@timestamp':
type: string
service:
type: object
properties:
version:
type: string
environment:
type: string
message:
type: string
tags:
type: array
items:
type: string

responses:
'200':
Copy link
Contributor

Choose a reason for hiding this comment

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

It also responds with 404

description: Annotation created successfully
content:
application/json:
schema:
type: object
properties:
_id:
type: string
_index:
type: string
_source:
type: object
properties:
annotation:
type: string
tags:
type: array
items:
type: string
message:
type: string
service:
type: object
properties:
name:
type: string
environment:
type: string
version:
type: string
event:
type: object
properties:
created:
type: string
'@timestamp':
type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# APM app OpenAPI documentation

This directory contains [OpenAPI specifications](https://swagger.io/specification/) for the [APM app API](https://www.elastic.co/guide/en/kibana/current/apm-api.html) in Kibana.

Included:

* [Agent Configuration API](https://www.elastic.co/guide/en/kibana/current/agent-config-api.html)
* [Annotation API](https://www.elastic.co/guide/en/kibana/current/apm-annotation-api.html)

Not included:

* [APM agent Key API](https://www.elastic.co/guide/en/kibana/current/agent-key-api.html)
* [RUM source map API](https://www.elastic.co/guide/en/kibana/current/rum-sourcemap-api.html)

The specifications for the included APIs are in the apm.yaml file in this directory.

These specifications are manually written. The missing ones will be included in the future.
Loading