---
title: "Get SPA Recommendations"
method: GET
path: "/api/v2/spa/recommendations/{service}"
tags: ["Spa"]
---

# Get SPA Recommendations

`GET /api/v2/spa/recommendations/{service}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/spa/recommendations/{service}`
- Auth: OAuth 2
  - Authorization code: `/oauth2/v1/authorize`
  - Token URL: `/oauth2/v1/token`

This endpoint is currently experimental and restricted to Datadog internal use only. Retrieve resource recommendations for a Spark job. The caller (Spark Gateway or DJM UI) provides a service name and SPA returns structured recommendations for driver and executor resources. The version with a shard should be preferred, where possible, as it gives more accurate results.

## Path parameters

- `service` string, required

## Query parameters

- `bypass_cache` string

## Response `200`

OK

- RecommendationDocument: JSON:API document containing a single Recommendation resource. Returned by SPA when the Spark Gateway requests recommendations.
  - `data` RecommendationData, required: JSON:API resource object for SPA Recommendation. Includes type, optional ID, and resource attributes with structured recommendations.
    - `attributes` RecommendationAttributes, required: Attributes of the SPA Recommendation resource. Contains recommendations for both driver and executor components.
      - `confidence_level` number, double: The confidence level of the recommendation, expressed as a value between 0.0 (low confidence) and 1.0 (high confidence).
      - `driver` ComponentRecommendation, required: Resource recommendation for a single Spark component (driver or executor). Contains estimation data used to patch Spark job specs.
        - `estimation` Estimation, required: Recommended resource values for a Spark driver or executor, derived from recent real usage metrics. Used by SPA to propose more efficient pod sizing.
          - `cpu` Cpu: CPU usage statistics derived from historical Spark job metrics. Provides multiple estimates so users can choose between conservative and cost-saving risk profiles.
            - `max` integer: Maximum CPU usage observed for the job, expressed in millicores. This represents the upper bound of usage.
            - `p75` integer: 75th percentile of CPU usage (millicores). Represents a cost-saving configuration while covering most workloads.
            - `p95` integer: 95th percentile of CPU usage (millicores). Balances performance and cost, providing a safer margin than p75.
          - `ephemeral_storage` integer: Recommended ephemeral storage allocation (in MiB). Derived from job temporary storage patterns.
          - `heap` integer: Recommended JVM heap size (in MiB).
          - `memory` integer: Recommended total memory allocation (in MiB). Includes both heap and overhead.
          - `overhead` integer: Recommended JVM overhead (in MiB). Computed as total memory - heap.
      - `executor` ComponentRecommendation, required: Resource recommendation for a single Spark component (driver or executor). Contains estimation data used to patch Spark job specs.
        - `estimation` Estimation, required: Recommended resource values for a Spark driver or executor, derived from recent real usage metrics. Used by SPA to propose more efficient pod sizing.
          - `cpu` Cpu: CPU usage statistics derived from historical Spark job metrics. Provides multiple estimates so users can choose between conservative and cost-saving risk profiles.
            - `max` integer: Maximum CPU usage observed for the job, expressed in millicores. This represents the upper bound of usage.
            - `p75` integer: 75th percentile of CPU usage (millicores). Represents a cost-saving configuration while covering most workloads.
            - `p95` integer: 95th percentile of CPU usage (millicores). Balances performance and cost, providing a safer margin than p75.
          - `ephemeral_storage` integer: Recommended ephemeral storage allocation (in MiB). Derived from job temporary storage patterns.
          - `heap` integer: Recommended JVM heap size (in MiB).
          - `memory` integer: Recommended total memory allocation (in MiB). Includes both heap and overhead.
          - `overhead` integer: Recommended JVM overhead (in MiB). Computed as total memory - heap.
    - `id` string: Resource identifier for the recommendation. Optional in responses.
    - `type` 'recommendation', required: JSON:API resource type for Spark Pod Autosizing recommendations. Identifies the Recommendation resource returned by SPA.

## Other responses

- `400`: Bad Request
- `403`: Not Authorized
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/da68bf029e4c?raw)
