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

Observability intake APIs #15837

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,10 @@ smoketest/all/cleanup:
api-docs: ## Generate bundled OpenAPI documents
@npx @redocly/cli bundle "docs/spec/openapi/apm-openapi.yaml" --ext yaml --output "docs/spec/openapi/bundled.yaml"
@npx @redocly/cli bundle "docs/spec/openapi/apm-openapi.yaml" --ext json --output "docs/spec/openapi/bundled.json"
@npx bump-cli overlay "docs/spec/openapi/bundled.yaml" "docs/spec/openapi/overlays/apm-docs.yaml" > "docs/spec/openapi/public-docs.yaml"


.PHONY: api-docs-lint
api-docs-lint: ## Run spectral API docs linter
@npx @stoplight/spectral-cli lint "docs/spec/openapi/bundled.yaml" --ruleset "docs/spec/openapi/.spectral.yaml"
@npx @stoplight/spectral-cli lint "docs/spec/openapi/public-docs.yaml" --ruleset "docs/spec/openapi/.spectral.yaml"

8 changes: 7 additions & 1 deletion docs/spec/openapi/apm-openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
openapi: 3.1.0
info:
title: Observability Intake APIs
description: OpenAPI schema for Observability Intake APIs
description: |
## Documentation source and versions

This documentation is derived from the `main` branch of the [apm-server](https://github.com/elastic/apm-server) repository.
For the unabbreviated OpenAPI document, refer to [docs/spec/openapi](https://github.com/elastic/apm-server/tree/main/docs/spec/openapi).

It is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/).
version: '0.1'
license:
name: Elastic License 2.0
Expand Down
7 changes: 5 additions & 2 deletions docs/spec/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.1.0",
"info": {
"title": "Observability Intake APIs",
"description": "OpenAPI schema for Observability Intake APIs",
"description": "## Documentation source and versions\n\nThis documentation is derived from the `main` branch of the [apm-server](https://github.com/elastic/apm-server) repository.\nFor the unabbreviated OpenAPI document, refer to [](https://github.com/elastic/apm-server/tree/main/docs/spec/openapi).\n\nIt is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/).\n",
"version": "0.1",
"license": {
"name": "Elastic License 2.0",
Expand Down Expand Up @@ -2937,6 +2937,9 @@
"object"
],
"properties": {
"body": {
"description": "The http request body usually as a string, but may be a dictionary for multipart/form-data content"
},
"id": {
"description": "ID holds the unique identifier for the http request.",
"type": [
Expand Down Expand Up @@ -7412,4 +7415,4 @@
}
}
}
}
}
10 changes: 9 additions & 1 deletion docs/spec/openapi/bundled.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
openapi: 3.1.0
info:
title: Observability Intake APIs
description: OpenAPI schema for Observability Intake APIs
description: |
## Documentation source and versions

This documentation is derived from the `main` branch of the [apm-server](https://github.com/elastic/apm-server) repository.
For the unabbreviated OpenAPI document, refer to [](https://github.com/elastic/apm-server/tree/main/docs/spec/openapi).

It is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/).
version: '0.1'
license:
name: Elastic License 2.0
Expand Down Expand Up @@ -2024,6 +2030,8 @@ components:
- 'null'
- object
properties:
body:
description: The http request body usually as a string, but may be a dictionary for multipart/form-data content
id:
description: ID holds the unique identifier for the http request.
type:
Expand Down
148 changes: 148 additions & 0 deletions docs/spec/openapi/overlays/apm-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# overlays.yaml
overlay: 1.0.0
info:
title: Overlays for the Observability intake API document
version: 0.0.1
actions:
# Remove patternProperties, add additionalProperties in error
- target: "$.components['schemas']['error'].properties['context'].properties['message'].properties['headers'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['error'].properties['context'].properties['message'].properties['headers']"
description: Update additionalProperties
update:
additionalProperties: true
- target: "$.components['schemas']['error'].properties['context'].properties['request'].properties['headers'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['error'].properties['context'].properties['request'].properties['headers']"
description: Update additionalProperties
update:
additionalProperties: true
- target: "$.components['schemas']['error'].properties['context'].properties['response'].properties['headers'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['error'].properties['context'].properties['response'].properties['headers']"
description: Update additionalProperties
update:
additionalProperties: true
# Remove patternProperties, add additionalProperties error-2
- target: "$.components['schemas']['error-2'].properties['c'].properties['r'].properties['he'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['error-2'].properties['c'].properties['r'].properties['he']"
description: Update additionalProperties
update:
additionalProperties: true
- target: "$.components['schemas']['error-2'].properties['c'].properties['q'].properties['he'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['error-2'].properties['c'].properties['q'].properties['he']"
description: Update additionalProperties
update:
additionalProperties: true
# Remove patternProperties, add additionalProperties in metricset component
- target: "$.components['schemas']['metricset'].properties['samples'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['metricset'].properties['samples']"
description: Update additionalProperties
update:
additionalProperties: true
# Remove patternProperties, add additionalProperties in span component
- target: "$.components['schemas']['span'].properties['context'].properties['message'].properties['headers'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['span'].properties['context'].properties['message'].properties['headers']"
description: Update additionalProperties
update:
additionalProperties: true
- target: "$.components['schemas']['span'].properties['context'].properties['http'].properties['response'].properties['headers'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['span'].properties['context'].properties['http'].properties['response'].properties['headers']"
description: Update additionalProperties
update:
additionalProperties: true
# Remove patternProperties, add additionalProperties in transaction component
- target: "$.components['schemas']['transaction'].properties['context'].properties['message'].properties['headers'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['transaction'].properties['context'].properties['message'].properties['headers']"
description: Update additionalProperties
update:
additionalProperties: true
- target: "$.components['schemas']['transaction'].properties['context'].properties['request'].properties['headers'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['transaction'].properties['context'].properties['request'].properties['headers']"
description: Update additionalProperties
update:
additionalProperties: true
- target: "$.components['schemas']['transaction'].properties['context'].properties['response'].properties['headers'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['transaction'].properties['context'].properties['response'].properties['headers']"
description: Update additionalProperties
update:
additionalProperties: true
# Remove patternProperties, add additionalProperties in transaction-2 component
- target: "$.components['schemas']['transaction-2'].properties['c'].properties['r'].properties['he'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['transaction-2'].properties['c'].properties['r'].properties['he']"
description: Update additionalProperties
update:
additionalProperties: true
- target: "$.components['schemas']['transaction-2'].properties['c'].properties['q'].properties['he'].patternProperties"
description: Remove patternProperties from the components
remove: true
- target: "$.components['schemas']['transaction-2'].properties['c'].properties['q'].properties['he']"
description: Update additionalProperties
update:
additionalProperties: true
# Remove problematic allOf from error
- target: "$.components['schemas']['error'].allOf"
description: Remove the allOf
remove: true
# Remove problematic allOf from error-2
- target: "$.components['schemas']['error-2'].allOf"
description: Remove the allOf
remove: true
# Remove problematic anyOf from error
- target: "$.components['schemas']['error'].properties['context'].properties['service'].properties['target'].anyOf"
description: Remove the anyOf
remove: true
- target: "$.components['schemas']['error'].properties['exception'].properties['stacktrace'].items.anyOf"
description: Remove the anyOf
remove: true
- target: "$.components['schemas']['error'].properties['exception'].anyOf"
description: Remove the anyOf
remove: true
- target: "$.components['schemas']['error'].properties['log'].properties['stacktrace'].items.anyOf"
description: Remove the anyOf
remove: true
- target: "$.components['schemas']['error'].anyOf"
description: Remove the anyOf
remove: true
# Remove problematic anyOf from error-2
- target: "$.components['schemas']['error-2'].properties['ex'].anyOf"
description: Remove the anyOf
remove: true
- target: "$.components['schemas']['error-2'].anyOf"
description: Remove the anyOf
remove: true
# Remove problematic anyOf from span
- target: "$.components['schemas']['span'].properties['context'].properties['service'].properties['target'].anyOf"
description: Remove the anyOf
remove: true
- target: "$.components['schemas']['span'].properties['stacktrace'].items.anyOf"
description: Remove the anyOf
remove: true
- target: "$.components['schemas']['span'].anyOf"
description: Remove the anyOf
remove: true
# Remove problematic anyOf from transaction
- target: "$.components['schemas']['transaction'].properties['context'].properties['service'].properties['target'].anyOf"
description: Remove the anyOf
remove: true
Loading