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

feat(specs): add OpenAPI spec for Monitoring API #1683

Merged
merged 38 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e3086e2
feat: add OpenAPI spec for Monitoring API
kai687 Jul 3, 2023
e4580f6
Merge branch 'main' into feat/specs/monitoring
kai687 Jul 3, 2023
adb6641
Merge branch 'main' into feat/specs/monitoring
kai687 Jul 4, 2023
6774bc2
feat: enable monitoring specs
shortcuts Jul 4, 2023
0d5a269
Apply suggestions from code review
kai687 Jul 4, 2023
01c0ec2
Apply suggestions from code review
kai687 Jul 4, 2023
49405b1
fix: spec for docs
kai687 Jul 4, 2023
8e1f8bc
fix: throw errors when wrong tags
kai687 Jul 4, 2023
0f38136
fix: spec for docs
kai687 Jul 4, 2023
789d099
fix: parameters
kai687 Jul 4, 2023
d47390f
fix: clarify
kai687 Jul 4, 2023
9439820
fix: textual form for globs
shortcuts Jul 4, 2023
f59a57d
fix: format
shortcuts Jul 4, 2023
205102d
Merge branch 'main' into feat/specs/monitoring
shortcuts Jul 4, 2023
b49ef15
fix: add test
shortcuts Jul 4, 2023
6bb3fd9
Merge branch 'main' into feat/specs/monitoring
shortcuts Jul 4, 2023
911089b
feat: all tests
shortcuts Jul 4, 2023
a033956
fix: rename operations
kai687 Jul 4, 2023
10e01e6
Merge branch 'main' into feat/specs/monitoring
kai687 Jul 5, 2023
137fc2d
fix: titles to responses
kai687 Jul 6, 2023
e74da84
fix: titles in correct place
kai687 Jul 6, 2023
07f7d6a
fix: clusters type
kai687 Jul 6, 2023
3aa1bdf
fix: rename tests
kai687 Jul 10, 2023
d4aa8b0
fix: no monitoring for dart
kai687 Jul 10, 2023
9abad11
fix: json not yml here
kai687 Jul 10, 2023
08d9af6
Merge branch 'main' into feat/specs/monitoring
kai687 Jul 10, 2023
7be6970
Merge branch 'main' into feat/specs/monitoring
shortcuts Jul 10, 2023
b8c0a51
fix: tests
shortcuts Jul 10, 2023
db37952
fix: tests
shortcuts Jul 10, 2023
97fdea0
fix: cts gen javascript
shortcuts Jul 10, 2023
d68034d
Merge branch 'main' into feat/specs/monitoring
shortcuts Jul 10, 2023
8c8120c
fix: client requests
shortcuts Jul 10, 2023
5736378
feat: custom requests
shortcuts Jul 10, 2023
9dfe220
fix: immutable install
shortcuts Jul 10, 2023
2d049d4
Merge branch 'main' into feat/specs/monitoring
shortcuts Jul 10, 2023
fdd0ef0
chore: cleanup cache
shortcuts Jul 11, 2023
f0432da
fix: generate
shortcuts Jul 11, 2023
d9b9e2d
fix: track new files
shortcuts Jul 11, 2023
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
1 change: 1 addition & 0 deletions .redocly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apis:
analytics: specs/analytics/spec.yml
ingestion: specs/ingestion/spec.yml
insights: specs/insights/spec.yml
monitoring: specs/monitoring/spec.yml
personalization: specs/personalization/spec.yml
query-suggestions: specs/query-suggestions/spec.yml
recommend: specs/recommend/spec.yml
Expand Down
28 changes: 28 additions & 0 deletions config/openapitools.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@
"packageName": "ingestion"
}
},
"javascript-monitoring": {
"output": "#{cwd}/clients/algoliasearch-client-javascript/packages/monitoring",
"additionalProperties": {
"packageVersion": "1.0.0-alpha.1",
"packageName": "monitoring"
}
},
"java-search": {
"output": "#{cwd}/clients/algoliasearch-client-java-2"
},
Expand All @@ -96,6 +103,9 @@
"java-query-suggestions": {
"output": "#{cwd}/clients/algoliasearch-client-java-2"
},
"java-monitoring": {
"output": "#{cwd}/clients/algoliasearch-client-java-2"
},
"php-search": {
"output": "#{cwd}/clients/algoliasearch-client-php"
},
Expand All @@ -117,6 +127,9 @@
"php-query-suggestions": {
"output": "#{cwd}/clients/algoliasearch-client-php"
},
"php-monitoring": {
"output": "#{cwd}/clients/algoliasearch-client-php"
},
"go-analytics": {
"output": "#{cwd}/clients/algoliasearch-client-go",
"additionalProperties": {
Expand Down Expand Up @@ -165,6 +178,12 @@
"packageName": "predict"
}
},
"go-monitoring": {
"output": "#{cwd}/clients/algoliasearch-client-go",
"additionalProperties": {
"packageName": "monitoring"
}
},
"kotlin-search": {
"output": "#{cwd}/clients/algoliasearch-client-kotlin"
},
Expand Down Expand Up @@ -192,6 +211,9 @@
"kotlin-ingestion": {
"output": "#{cwd}/clients/algoliasearch-client-kotlin"
},
"kotlin-monitoring": {
"output": "#{cwd}/clients/algoliasearch-client-kotlin"
},
"dart-algoliasearch": {
"output": "#{cwd}/clients/algoliasearch-client-dart/packages/algoliasearch",
"additionalProperties": {
Expand All @@ -209,6 +231,12 @@
"additionalProperties": {
"packageVersion": "0.1.1+2"
}
},
"dart-monitoring": {
"output": "#{cwd}/clients/algoliasearch-client-dart/packages/monitoring",
"additionalProperties": {
"packageVersion": "0.1.1+1"
}
}
}
}
Expand Down
63 changes: 63 additions & 0 deletions specs/monitoring/common/parameters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# path
Clusters:
name: clusters
in: path
required: true
schema:
type: array
items:
type: string
title: Cluster names
description: List of clusters to test.
example:
- c1-de
- c2-de
- c3-de

MetricInPath:
name: metric
in: path
required: true
schema:
$ref: '#/Metric'

Metric:
type: string
description: |
Metric to report.

For more information about the individual metrics, see the response.
To include all metrics, use `*` as parameter.
enum:
- avg_build_time
- ssd_usage
- ram_search_usage
- ram_indexing_usage
- cpu_usage
- '*'
example: '*'

PeriodInPath:
name: period
in: path
required: true
schema:
$ref: '#/Period'

Period:
type: string
description: |
Period over which to aggregate the metrics:

- `minute`. Aggregate the last minute. 1 data point per 10 seconds.
- `hour`. Aggregate the last hour. 1 data point per minute.
- `day`. Aggregate the last day. 1 data point per 10 minutes.
- `week`. Aggregate the last week. 1 data point per hour.
- `month`. Aggregate the last month. 1 data point per day.
enum:
- minute
- hour
- day
- week
- month
example: week
13 changes: 13 additions & 0 deletions specs/monitoring/common/responses/BadRequestResponse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Bad Request.
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
reason:
type: string
examples:
BadRequest:
value:
reason: Unknown servers
13 changes: 13 additions & 0 deletions specs/monitoring/common/responses/ForbiddenResponse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
description: Forbidden
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
reason:
type: string
examples:
Forbidden:
value:
reason: invalid credentials
26 changes: 26 additions & 0 deletions specs/monitoring/common/responses/IncidentsResponse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
description: OK
content:
application/json:
schema:
type: object
properties:
incidents:
type: object
additionalProperties:
x-additionalPropertiesName: incidents
$ref: '../schemas/Incidents.yml'
examples:
success:
value:
incidents:
m134-de:
- t: 1687441685000
v:
title: 'Incident on cluster m134-de: Everything operating normally.'
status: operational
- t: 1687441579000
v:
title: >-
Incident on cluster m134-de: We are encountering a major
issue that impact all API calls.
status: major_outage
26 changes: 26 additions & 0 deletions specs/monitoring/common/responses/IndexingResponse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
description: OK
content:
application/json:
schema:
type: object
properties:
metrics:
type: object
additionalProperties: false
properties:
indexing:
additionalProperties:
x-additionalPropertiesName: times
$ref: '../schemas/Time.yml'
examples:
Success:
value:
metrics:
indexing:
c16-de:
- t: 1688056200000
v: 1562
- t: 1688056800000
v: 1637
- t: 1688057400000
v: 1754
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
description: Unauthorized
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
reason:
type: string
examples:
Unauthorized:
value:
reason: >-
The infrastructure usage API is only available on Enterprise plans.
Please contact enterprise@algolia.com for more detail.
77 changes: 77 additions & 0 deletions specs/monitoring/common/responses/InfrastructureResponse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
description: OK
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
metrics:
type: object
additionalProperties: false
properties:
cpu_usage:
type: object
description: CPU idleness in %.
additionalProperties:
x-additionalPropertiesName: probes
$ref: '../schemas/InfraProbes.yml'
ram_indexing_usage:
type: object
description: RAM usage for the indexing in MB.
additionalProperties:
x-additionalPropertiesName: probes
$ref: '../schemas/InfraProbes.yml'
ram_search_usage:
type: object
description: RAM usage for the search in MB.
additionalProperties:
x-additionalPropertiesName: probes
$ref: '../schemas/InfraProbes.yml'
ssd_usage:
type: object
description: >
Solid-state disk (SSD) usage expressed as % of RAM.

0% means no SSD usage. A value of 50% indicates 32 GB SSD
usage for a machine with 64 RAM.
additionalProperties:
x-additionalPropertiesName: probes
$ref: '../schemas/InfraProbes.yml'
avg_build_time:
type: object
description: Average build time of the indices in seconds.
additionalProperties:
x-additionalPropertiesName: probes
$ref: '../schemas/InfraProbes.yml'
examples:
success:
value:
metrics:
cpu_usage:
s4-fr:
- t: 1455101280
v: 46
- t: 1455101290
v: 46
- t: 1455101300
v: 46
c3-use-1:
- t: 1455101280
v: 42
- t: 1455101290
v: 42
- t: 1455101300
v: 42
- t: 1455101310
v: 37
c3-use-2:
- t: 1455101280
v: 56
- t: 1455101290
v: 56
- t: 1455101300
v: 56
- t: 1455101310
v: 56
- t: 1455101320
v: 51
35 changes: 35 additions & 0 deletions specs/monitoring/common/responses/InventoryResponse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
description: OK
content:
application/json:
schema:
type: object
properties:
inventory:
type: array
items:
$ref: '../schemas/Server.yml'
examples:
Success:
value:
inventory:
- name: c16-de-3
region: de
is_slave: false
is_replica: false
cluster: c16-de
status: PRODUCTION
type: cluster
- name: c16-de-2
region: de
is_slave: false
is_replica: false
cluster: c16-de
status: PRODUCTION
type: cluster
- name: c16-de-1
region: de
is_slave: false
is_replica: false
cluster: c16-de
status: PRODUCTION
type: cluster
26 changes: 26 additions & 0 deletions specs/monitoring/common/responses/LatencyResponse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
description: OK
content:
application/json:
schema:
type: object
properties:
metrics:
type: object
additionalProperties: false
properties:
latency:
additionalProperties:
x-additionalPropertiesName: latencies
$ref: '../schemas/Time.yml'
examples:
Success:
value:
metrics:
latency:
c16-de:
- t: 1688056200000
v: 64
- t: 1688056800000
v: 59
- t: 1688057400000
v: 55
8 changes: 8 additions & 0 deletions specs/monitoring/common/responses/NotFoundResponse.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
description: Not Found.
content:
text/plain:
schema:
type: string
examples:
NotFound:
value: Unknown cluster "test"
Loading