Skip to content

Commit

Permalink
feat: enable monitoring specs
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Jul 4, 2023
1 parent adb6641 commit c67cf54
Show file tree
Hide file tree
Showing 23 changed files with 127 additions and 87 deletions.
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
66 changes: 36 additions & 30 deletions specs/monitoring/common/parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,50 @@ Clusters:
- c2-de
- c3-de

Metric:
MetricInPath:
name: metric
in: path
required: true
schema:
type: string
description: |
Metric to report.
$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: '*'
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: '*'

Period:
PeriodInPath:
name: period
in: path
required: true
schema:
type: string
description: |
Period over which to aggregate the metrics:
$ref: '#/Period'

Perid:
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
- `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
2 changes: 1 addition & 1 deletion specs/monitoring/common/responses/BadRequestResponse.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Bad Request
description: Bad Request.
content:
application/json:
schema:
Expand Down
2 changes: 1 addition & 1 deletion specs/monitoring/common/responses/IndexingResponse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ content:
indexing:
additionalProperties:
x-additionalPropertiesName: times
$ref: ../schemas/Time.yml
$ref: '../schemas/Time.yml'
examples:
Success:
value:
Expand Down
10 changes: 5 additions & 5 deletions specs/monitoring/common/responses/InfrastructureResponse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ content:
description: CPU idleness in %.
additionalProperties:
x-additionalPropertiesName: probes
$ref: ../schemas/InfraProbes.yml
$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
$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
$ref: '../schemas/InfraProbes.yml'
ssd_usage:
type: object
description: >
Expand All @@ -36,13 +36,13 @@ content:
usage for a machine with 64 RAM.
additionalProperties:
x-additionalPropertiesName: probes
$ref: ../schemas/InfraProbes.yml
$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
$ref: '../schemas/InfraProbes.yml'
examples:
success:
value:
Expand Down
2 changes: 1 addition & 1 deletion specs/monitoring/common/responses/InventoryResponse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ content:
inventory:
type: array
items:
$ref: ../schemas/Server.yml
$ref: '../schemas/Server.yml'
examples:
Success:
value:
Expand Down
2 changes: 1 addition & 1 deletion specs/monitoring/common/responses/LatencyResponse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ content:
latency:
additionalProperties:
x-additionalPropertiesName: latencies
$ref: ../schemas/Time.yml
$ref: '../schemas/Time.yml'
examples:
Success:
value:
Expand Down
2 changes: 1 addition & 1 deletion specs/monitoring/common/responses/NotFoundResponse.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
description: Not Found
description: Not Found.
content:
text/plain:
schema:
Expand Down
2 changes: 1 addition & 1 deletion specs/monitoring/common/responses/ReachabilityResponse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ content:
type: object
additionalProperties:
x-additionalPropertiesName: Server
$ref: ../schemas/Probes.yml
$ref: '../schemas/Probes.yml'
examples:
Success:
value:
Expand Down
2 changes: 1 addition & 1 deletion specs/monitoring/common/responses/StatusResponse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ content:
type: object
additionalProperties:
x-additionalPropertiesName: status
$ref: ../schemas/status.yml
$ref: '../schemas/status.yml'
examples:
Success:
value:
Expand Down
2 changes: 1 addition & 1 deletion specs/monitoring/common/responses/UnauthorizedResponse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ content:
type: string
examples:
Unauthorized:
summary: Invalid credentials
summary: Invalid credentials.
description: Make sure to use the Monitoring API key if you authenticate your API requests.
value: Invalid credentials
2 changes: 1 addition & 1 deletion specs/monitoring/common/schemas/Incidents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ items:
format: int64
description: Timestamp of the incident report.
v:
$ref: ./Incident.yml
$ref: './Incident.yml'
2 changes: 1 addition & 1 deletion specs/monitoring/common/schemas/InfraProbes.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
title: probes
type: array
items:
$ref: ./Metric.yml
$ref: './Metric.yml'
18 changes: 12 additions & 6 deletions specs/monitoring/common/schemas/Server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@ properties:
description: Name of the cluster to which this server belongs.
example: c16-de
status:
type: string
enum:
- PRODUCTION
$ref: '#/Status'
type:
type: string
enum:
- cluster
$ref: '#/Type'

Status:
type: string
enum:
- PRODUCTION

Type:
type: string
enum:
- cluster
6 changes: 3 additions & 3 deletions specs/monitoring/paths/getIncidents.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
get:
summary: List incidents
summary: List incidents.
description: List known incidents for all clusters.
operationId: getIncidents
security: []
tags:
- incidents
responses:
'200':
$ref: ../common/responses/IncidentsResponse.yaml
$ref: '../common/responses/IncidentsResponse.yaml'
'401':
$ref: ../common/responses/UnauthorizedResponse.yaml
$ref: '../common/responses/UnauthorizedResponse.yaml'
10 changes: 5 additions & 5 deletions specs/monitoring/paths/getIncidentsSingle.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
get:
summary: List incidents for selected clusters
summary: List incidents for selected clusters.
description: List known incidents for selected clusters.
operationId: getIncidentsSingle
tags:
- incidents
security: []
parameters:
- $ref: ../common/parameters.yml/#Clusters
- $ref: '../common/parameters.yml/#Clusters'
responses:
'200':
$ref: ../common/responses/IncidentsResponse.yaml
$ref: '../common/responses/IncidentsResponse.yaml'
'401':
$ref: ../common/responses/UnauthorizedResponse.yaml
$ref: '../common/responses/UnauthorizedResponse.yaml'
'404':
$ref: ../common/responses/NotFoundResponse.yaml
$ref: '../common/responses/NotFoundResponse.yaml'
8 changes: 4 additions & 4 deletions specs/monitoring/paths/getIndexingTime.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
get:
summary: Get indexing times
summary: Get indexing times.
description: List the average times for indexing operations for selected clusters.
operationId: getIndexingTime
security: []
tags:
- monitoring
parameters:
- $ref: ../common/parameters.yml#/Clusters
- $ref: '../common/parameters.yml#/Clusters'
responses:
'200':
$ref: ../common/responses/IndexingResponse.yaml
$ref: '../common/responses/IndexingResponse.yaml'
'400':
$ref: ../common/responses/BadRequestResponse.yaml
$ref: '../common/responses/BadRequestResponse.yaml'
6 changes: 3 additions & 3 deletions specs/monitoring/paths/getInventory.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
get:
summary: List servers
summary: List servers.
operationId: getInventory
security:
- appId: []
Expand All @@ -18,6 +18,6 @@ get:
- monitoring
responses:
'200':
$ref: ../common/responses/InventoryResponse.yaml
$ref: '../common/responses/InventoryResponse.yaml'
'403':
$ref: ../common/responses/ForbiddenResponse.yaml
$ref: '../common/responses/ForbiddenResponse.yaml'
8 changes: 4 additions & 4 deletions specs/monitoring/paths/getLatency.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
get:
summary: Get search latency times
summary: Get search latency times.
description: List the average latency for search requests for selected clusters.
operationId: getLatency
security: []
tags:
- monitoring
parameters:
- $ref: ../common/parameters.yml#/Clusters
- $ref: '../common/parameters.yml#/Clusters'
responses:
'200':
$ref: ../common/responses/LatencyResponse.yaml
$ref: '../common/responses/LatencyResponse.yaml'
'400':
$ref: ../common/responses/BadRequestResponse.yaml
$ref: '../common/responses/BadRequestResponse.yaml'
Loading

0 comments on commit c67cf54

Please sign in to comment.