Skip to content

Commit eb05025

Browse files
committed
obs
1 parent e5b5230 commit eb05025

File tree

10 files changed

+229
-9
lines changed

10 files changed

+229
-9
lines changed

specs/ingestion/common/parameters.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,24 @@ taskID:
3434
type: string
3535
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
3636

37+
runID:
38+
name: runID
39+
in: path
40+
description: The run uuid.
41+
required: true
42+
schema:
43+
type: string
44+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
45+
46+
eventID:
47+
name: eventID
48+
in: path
49+
description: The event uuid.
50+
required: true
51+
schema:
52+
type: string
53+
example: 6c02aeb1-775e-418e-870b-1faccd4b2c0f
54+
3755
itemsPerPage:
3856
name: itemsPerPage
3957
in: query
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Event:
2+
type: object
3+
additionalProperties: false
4+
properties:
5+
eventID:
6+
type: string
7+
runID:
8+
type: string
9+
parentID:
10+
type: string
11+
status:
12+
$ref: '#/EventStatus'
13+
type:
14+
$ref: '#/EventType'
15+
data:
16+
type: object
17+
additionalProperties: true
18+
publishedAt:
19+
$ref: './common.yml#/publishedAt'
20+
required:
21+
- eventID
22+
- runID
23+
- status
24+
- type
25+
- publishedAt
26+
27+
EventStatus:
28+
type: string
29+
enum: ['created', 'started', 'retried', 'failed', 'succeeded']
30+
31+
EventType:
32+
type: string
33+
enum: ['fetch', 'record', 'internal']

specs/ingestion/common/schemas/observability.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
RunResponse:
2+
type: object
3+
additionalProperties: false
4+
properties:
5+
runID:
6+
type: string
7+
required:
8+
- runID
9+
10+
Run:
11+
type: object
12+
additionalProperties: false
13+
properties:
14+
runID:
15+
type: string
16+
appID:
17+
type: string
18+
taskID:
19+
type: string
20+
status:
21+
$ref: '#/RunStatus'
22+
progress:
23+
type: object
24+
additionalProperties: false
25+
properties:
26+
expectedNbOfEvents:
27+
type: integer
28+
receivedNbOfEvents:
29+
type: integer
30+
outcome:
31+
$ref: '#/RunOutcome'
32+
type:
33+
$ref: '#/RunType'
34+
createdAt:
35+
$ref: './common.yml#/createdAt'
36+
updatedAt:
37+
$ref: './common.yml#/updatedAt'
38+
startedAt:
39+
$ref: './common.yml#/startedAt'
40+
finishedAt:
41+
$ref: './common.yml#/finishedAt'
42+
required:
43+
- runID
44+
- appID
45+
- taskID
46+
- status
47+
- type
48+
- createdAt
49+
- updatedAt
50+
51+
RunStatus:
52+
type: string
53+
enum: ['created', 'started', 'finished']
54+
55+
RunOutcome:
56+
type: string
57+
enum: ['success', 'failure']
58+
59+
RunType:
60+
type: string
61+
enum: ['reindex', 'update']
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
get:
2+
tags:
3+
- observability
4+
summary: Get an event in a specific run.
5+
description: Get an event in a specific run.
6+
operationId: getEvent
7+
parameters:
8+
- $ref: '../../common/parameters.yml#/runID'
9+
- $ref: '../../common/parameters.yml#/eventID'
10+
responses:
11+
'200':
12+
description: OK
13+
content:
14+
application/json:
15+
schema:
16+
$ref: '../../common/schemas/event.yml#/Event'
17+
'400':
18+
$ref: '../../../common/responses/BadRequest.yml'
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
get:
2+
tags:
3+
- observability
4+
summary: Get a list of events for a specific run.
5+
description: Get a list of events for a specific run.
6+
operationId: getEvents
7+
parameters:
8+
- $ref: '../../common/parameters.yml#/runID'
9+
- $ref: '../../common/parameters.yml#/itemsPerPage'
10+
- $ref: '../../common/parameters.yml#/page'
11+
responses:
12+
'200':
13+
description: OK
14+
content:
15+
application/json:
16+
schema:
17+
title: listEventsResponse
18+
type: object
19+
additionalProperties: false
20+
properties:
21+
events:
22+
type: array
23+
items:
24+
$ref: '../../common/schemas/event.yml#/Event'
25+
pagination:
26+
$ref: '../../common/schemas/pagination.yml#/Pagination'
27+
required:
28+
- events
29+
- pagination
30+
'400':
31+
$ref: '../../../common/responses/BadRequest.yml'

specs/ingestion/paths/runs/runID.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
get:
2+
tags:
3+
- observability
4+
summary: Get a run.
5+
description: Get a run.
6+
operationId: getRun
7+
parameters:
8+
- $ref: '../../common/parameters.yml#/runID'
9+
responses:
10+
'200':
11+
description: OK
12+
content:
13+
application/json:
14+
schema:
15+
$ref: '../../common/schemas/run.yml#/Run'
16+
'400':
17+
$ref: '../../../common/responses/BadRequest.yml'

specs/ingestion/paths/runs/runs.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
get:
2+
tags:
3+
- observability
4+
summary: Get a list of runs.
5+
description: Get a list of runs.
6+
operationId: getRuns
7+
parameters:
8+
- $ref: '../../common/parameters.yml#/itemsPerPage'
9+
- $ref: '../../common/parameters.yml#/page'
10+
responses:
11+
'200':
12+
description: OK
13+
content:
14+
application/json:
15+
schema:
16+
title: listRunsResponse
17+
type: object
18+
additionalProperties: false
19+
properties:
20+
runs:
21+
type: array
22+
items:
23+
$ref: '../../common/schemas/run.yml#/Run'
24+
pagination:
25+
$ref: '../../common/schemas/pagination.yml#/Pagination'
26+
required:
27+
- runs
28+
- pagination
29+
'400':
30+
$ref: '../../../common/responses/BadRequest.yml'

specs/ingestion/paths/tasks/runTask.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ post:
1212
content:
1313
application/json:
1414
schema:
15-
$ref: '../../common/schemas/observability.yml#/RunResponse'
15+
$ref: '../../common/schemas/run.yml#/RunResponse'
1616
'400':
1717
$ref: '../../../common/responses/BadRequest.yml'

specs/ingestion/spec.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,29 @@ tags:
3232
- name: tasks
3333
x-displayName: Tasks
3434
description: Tasks refers to all type of Ingestion we can do (Reindex, On demand update, ...).
35+
- name: observability
36+
x-displayName: Observability
37+
description: Observability api tracks each runs and events
3538
paths:
39+
# authentications api
3640
/1/authentications:
3741
$ref: 'paths/authentications/authentications.yml'
3842
/1/authentications/{authenticationID}:
3943
$ref: 'paths/authentications/authenticationID.yml'
44+
45+
# destinations api
4046
/1/destinations:
4147
$ref: 'paths/destinations/destinations.yml'
4248
/1/destinations/{destinationID}:
4349
$ref: 'paths/destinations/destinationID.yml'
50+
51+
# sources api
4452
/1/sources:
4553
$ref: 'paths/sources/sources.yml'
4654
/1/sources/{sourceID}:
4755
$ref: 'paths/sources/sourceID.yml'
56+
57+
# tasks api
4858
/1/tasks:
4959
$ref: 'paths/tasks/tasks.yml'
5060
/1/tasks/{taskID}:
@@ -55,3 +65,13 @@ paths:
5565
$ref: 'paths/tasks/enableTask.yml'
5666
/1/tasks/{taskID}/disable:
5767
$ref: 'paths/tasks/disableTask.yml'
68+
69+
# observability api
70+
/1/runs:
71+
$ref: 'paths/runs/runs.yml'
72+
/1/runs/{runID}:
73+
$ref: 'paths/runs/runID.yml'
74+
/1/runs/{runID}/events:
75+
$ref: 'paths/runs/events/events.yml'
76+
/1/runs/{runID}/events/{eventID}:
77+
$ref: 'paths/runs/events/eventID.yml'

0 commit comments

Comments
 (0)