Skip to content

Commit da2155d

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add a new end point that allows the SPA recommendation to be called without the shard parameter (#3251)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 34dfeb3 commit da2155d

7 files changed

Lines changed: 323 additions & 26 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42828,6 +42828,9 @@ components:
4282842828
description: Attributes of the SPA Recommendation resource. Contains recommendations
4282942829
for both driver and executor components.
4283042830
properties:
42831+
confidence_level:
42832+
format: double
42833+
type: number
4283142834
driver:
4283242835
$ref: '#/components/schemas/ComponentRecommendation'
4283342836
executor:
@@ -86626,13 +86629,79 @@ paths:
8662686629
x-unstable: '**Note**: This feature is in private beta. To request access, use
8662786630
the request access form in the [Service Level Objectives](https://docs.datadoghq.com/service_management/service_level_objectives/#slo-csv-export)
8662886631
docs.'
86629-
/api/v2/spa/recommendations/{service}/{shard}:
86632+
/api/v2/spa/recommendations/{service}:
8663086633
get:
86631-
description: Retrieve resource recommendations for a Spark job. The caller (Spark
86632-
Gateway or DJM UI) provides a service name and shard identifier, and SPA returns
86633-
structured recommendations for driver and executor resources.
86634+
description: This endpoint is currently experimental and restricted to Datadog
86635+
internal use only. Retrieve resource recommendations for a Spark job. The
86636+
caller (Spark Gateway or DJM UI) provides a service name and SPA returns structured
86637+
recommendations for driver and executor resources. The version with a shard
86638+
should be preferred, where possible, as it gives more accurate results.
8663486639
operationId: GetSPARecommendations
8663586640
parameters:
86641+
- description: The recommendation service should not use its metrics cache.
86642+
in: query
86643+
name: bypass_cache
86644+
schema:
86645+
type: string
86646+
- description: The service name for a spark job.
86647+
in: path
86648+
name: service
86649+
required: true
86650+
schema:
86651+
type: string
86652+
responses:
86653+
'200':
86654+
content:
86655+
application/json:
86656+
example:
86657+
data:
86658+
attributes:
86659+
driver:
86660+
estimation:
86661+
cpu:
86662+
max: 1500
86663+
p75: 1000
86664+
p95: 1200
86665+
ephemeral_storage: 896
86666+
heap: 6144
86667+
memory: 7168
86668+
overhead: 1024
86669+
executor:
86670+
estimation:
86671+
cpu:
86672+
max: 2000
86673+
p75: 1200
86674+
p95: 1500
86675+
ephemeral_storage: 512
86676+
heap: 3072
86677+
memory: 4096
86678+
overhead: 1024
86679+
id: dedupeactivecontexts:adp_dedupeactivecontexts_org2
86680+
type: recommendation
86681+
schema:
86682+
$ref: '#/components/schemas/RecommendationDocument'
86683+
description: OK
86684+
'400':
86685+
$ref: '#/components/responses/BadRequestResponse'
86686+
'403':
86687+
$ref: '#/components/responses/NotAuthorizedResponse'
86688+
'429':
86689+
$ref: '#/components/responses/TooManyRequestsResponse'
86690+
security:
86691+
- AuthZ: []
86692+
summary: Get SPA Recommendations
86693+
tags:
86694+
- Spa
86695+
x-unstable: '**Note**: This endpoint is in preview and may change in the future.
86696+
It is not yet recommended for production use.'
86697+
/api/v2/spa/recommendations/{service}/{shard}:
86698+
get:
86699+
description: This endpoint is currently experimental and restricted to Datadog
86700+
internal use only. Retrieve resource recommendations for a Spark job. The
86701+
caller (Spark Gateway or DJM UI) provides a service name and shard identifier,
86702+
and SPA returns structured recommendations for driver and executor resources.
86703+
operationId: GetSPARecommendationsWithShard
86704+
parameters:
8663686705
- description: The shard tag for a spark job, which differentiates jobs within
8663786706
the same service that have different resource needs
8663886707
in: path
@@ -86646,6 +86715,11 @@ paths:
8664686715
required: true
8664786716
schema:
8664886717
type: string
86718+
- description: The recommendation service should not use its metrics cache.
86719+
in: query
86720+
name: bypass_cache
86721+
schema:
86722+
type: string
8664986723
responses:
8665086724
'200':
8665186725
content:
@@ -86684,11 +86758,13 @@ paths:
8668486758
$ref: '#/components/responses/NotAuthorizedResponse'
8668586759
'429':
8668686760
$ref: '#/components/responses/TooManyRequestsResponse'
86687-
summary: Get SPA Recommendations
86761+
security:
86762+
- AuthZ: []
86763+
summary: Get SPA Recommendations with a shard parameter
8668886764
tags:
8668986765
- Spa
86690-
x-unstable: '**Note**: This endpoint is in public beta and may change in the
86691-
future. It is not yet recommended for production use.'
86766+
x-unstable: '**Note**: This endpoint is in preview and may change in the future.
86767+
It is not yet recommended for production use.'
8669286768
/api/v2/spans/analytics/aggregate:
8669386769
post:
8669486770
description: 'The API endpoint to aggregate spans into buckets and compute metrics

features/v2/spa.feature

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,49 @@ Feature: Spa
44
insights to help optimize Spark job configurations.
55

66
Background:
7-
Given a valid "apiKeyAuth" key in the system
8-
And a valid "appKeyAuth" key in the system
9-
And an instance of "Spa" API
10-
And operation "GetSPARecommendations" enabled
11-
And new "GetSPARecommendations" request
7+
Given an instance of "Spa" API
128

139
@generated @skip @team:DataDog/data-and-analytics-processing
1410
Scenario: Get SPA Recommendations returns "Bad Request" response
15-
Given request contains "shard" parameter from "REPLACE.ME"
11+
Given operation "GetSPARecommendations" enabled
12+
And new "GetSPARecommendations" request
1613
And request contains "service" parameter from "REPLACE.ME"
1714
When the request is sent
1815
Then the response status is 400 Bad Request
1916

2017
@generated @skip @team:DataDog/data-and-analytics-processing
2118
Scenario: Get SPA Recommendations returns "OK" response
22-
Given request contains "shard" parameter from "REPLACE.ME"
19+
Given operation "GetSPARecommendations" enabled
20+
And new "GetSPARecommendations" request
21+
And request contains "service" parameter from "REPLACE.ME"
22+
When the request is sent
23+
Then the response status is 200 OK
24+
25+
@generated @skip @team:DataDog/data-and-analytics-processing
26+
Scenario: Get SPA Recommendations with a shard parameter returns "Bad Request" response
27+
Given operation "GetSPARecommendationsWithShard" enabled
28+
And new "GetSPARecommendationsWithShard" request
29+
And request contains "shard" parameter from "REPLACE.ME"
30+
And request contains "service" parameter from "REPLACE.ME"
31+
When the request is sent
32+
Then the response status is 400 Bad Request
33+
34+
@generated @skip @team:DataDog/data-and-analytics-processing
35+
Scenario: Get SPA Recommendations with a shard parameter returns "OK" response
36+
Given operation "GetSPARecommendationsWithShard" enabled
37+
And new "GetSPARecommendationsWithShard" request
38+
And request contains "shard" parameter from "REPLACE.ME"
2339
And request contains "service" parameter from "REPLACE.ME"
2440
When the request is sent
2541
Then the response status is 200 OK
2642

2743
@skip @team:DataDog/data-and-analytics-processing
2844
Scenario: GetSPARecommendations returns a JSON:API Recommendation with driver and executor estimations
29-
Given request contains "service" parameter with value "dedupeactivecontexts"
45+
Given new "GetSPARecommendations" request
46+
And a valid "apiKeyAuth" key in the system
47+
And a valid "appKeyAuth" key in the system
48+
And operation "GetSPARecommendations" enabled
49+
And request contains "service" parameter with value "dedupeactivecontexts"
3050
And request contains "shard" parameter with value "adp_dedupeactivecontexts_org2"
3151
When the request is sent
3252
Then the response status is 404 Not Found

features/v2/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4484,6 +4484,12 @@
44844484
"type": "safe"
44854485
}
44864486
},
4487+
"GetSPARecommendationsWithShard": {
4488+
"tag": "Spa",
4489+
"undo": {
4490+
"type": "safe"
4491+
}
4492+
},
44874493
"AggregateSpans": {
44884494
"tag": "Spans",
44894495
"undo": {

private/bdd_runner/src/support/scenarios_model_mapping.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9071,6 +9071,17 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
90719071
operationResponseType: "SLOReportStatusGetResponse",
90729072
},
90739073
"SpaApi.V2.GetSPARecommendations": {
9074+
bypassCache: {
9075+
type: "string",
9076+
format: "",
9077+
},
9078+
service: {
9079+
type: "string",
9080+
format: "",
9081+
},
9082+
operationResponseType: "RecommendationDocument",
9083+
},
9084+
"SpaApi.V2.GetSPARecommendationsWithShard": {
90749085
shard: {
90759086
type: "string",
90769087
format: "",
@@ -9079,6 +9090,10 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = {
90799090
type: "string",
90809091
format: "",
90819092
},
9093+
bypassCache: {
9094+
type: "string",
9095+
format: "",
9096+
},
90829097
operationResponseType: "RecommendationDocument",
90839098
},
90849099
"SpansApi.V2.AggregateSpans": {

0 commit comments

Comments
 (0)