Skip to content

Commit 16de925

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 (#1142)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent a55a32f commit 16de925

File tree

9 files changed

+380
-37
lines changed

9 files changed

+380
-37
lines changed

.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

examples/v2_spa_GetSPARecommendations.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Get SPA Recommendations returns "OK" response
22
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_spa::GetSPARecommendationsOptionalParams;
34
use datadog_api_client::datadogV2::api_spa::SpaAPI;
45

56
#[tokio::main]
@@ -8,7 +9,10 @@ async fn main() {
89
configuration.set_unstable_operation_enabled("v2.GetSPARecommendations", true);
910
let api = SpaAPI::with_config(configuration);
1011
let resp = api
11-
.get_spa_recommendations("shard".to_string(), "service".to_string())
12+
.get_spa_recommendations(
13+
"service".to_string(),
14+
GetSPARecommendationsOptionalParams::default(),
15+
)
1216
.await;
1317
if let Ok(value) = resp {
1418
println!("{:#?}", value);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Get SPA Recommendations with a shard parameter returns "OK" response
2+
use datadog_api_client::datadog;
3+
use datadog_api_client::datadogV2::api_spa::GetSPARecommendationsWithShardOptionalParams;
4+
use datadog_api_client::datadogV2::api_spa::SpaAPI;
5+
6+
#[tokio::main]
7+
async fn main() {
8+
let mut configuration = datadog::Configuration::new();
9+
configuration.set_unstable_operation_enabled("v2.GetSPARecommendationsWithShard", true);
10+
let api = SpaAPI::with_config(configuration);
11+
let resp = api
12+
.get_spa_recommendations_with_shard(
13+
"shard".to_string(),
14+
"service".to_string(),
15+
GetSPARecommendationsWithShardOptionalParams::default(),
16+
)
17+
.await;
18+
if let Ok(value) = resp {
19+
println!("{:#?}", value);
20+
} else {
21+
println!("{:#?}", resp.unwrap_err());
22+
}
23+
}

src/datadog/configuration.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ impl Default for Configuration {
276276
("v2.get_slo_report".to_owned(), false),
277277
("v2.get_slo_report_job_status".to_owned(), false),
278278
("v2.get_spa_recommendations".to_owned(), false),
279+
("v2.get_spa_recommendations_with_shard".to_owned(), false),
279280
("v2.create_sca_resolve_vulnerable_symbols".to_owned(), false),
280281
("v2.create_sca_result".to_owned(), false),
281282
("v2.add_member_team".to_owned(), false),

0 commit comments

Comments
 (0)