Skip to content

Conversation

@dongjoon-hyun
Copy link
Member

@dongjoon-hyun dongjoon-hyun commented Jan 27, 2024

What changes were proposed in this pull request?

spark.ui.prometheus.enabled has been used since Apache Spark 3.0.0.

This PR aims to enable spark.ui.prometheus.enabled by default like Driver JSON API in Apache Spark 4.0.0.

JSON End Point Prometheus End Point
Driver /api/v1/applications/{id}/executors/ /metrics/executors/prometheus/

Why are the changes needed?

BEFORE

$ bin/spark-shell
$ curl -s http://localhost:4040/metrics/executors/prometheus | wc -l
       0

AFTER

$ bin/spark-shell
 $ curl -s http://localhost:4040/metrics/executors/prometheus | wc -l
      20

Does this PR introduce any user-facing change?

No, this is only a new endpoint.

How was this patch tested?

Pass the CIs and do manual test.

Was this patch authored or co-authored using generative AI tooling?

No.

@github-actions github-actions bot added the DOCS label Jan 27, 2024
@dongjoon-hyun
Copy link
Member Author

Could you review this when you have some time, @viirya ?

Executor-level metrics are sent from each executor to the driver as part of the Heartbeat to describe the performance metrics of Executor itself like JVM heap memory, GC information.
Executor metric values and their measured memory peak values per executor are exposed via the REST API in JSON format and in Prometheus format.
The JSON end point is exposed at: `/applications/[app-id]/executors`, and the Prometheus endpoint at: `/metrics/executors/prometheus`.
The Prometheus endpoint is conditional to a configuration parameter: `spark.ui.prometheus.enabled=true` (the default is `false`).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, why we need to remove it from document?

Copy link
Member Author

@dongjoon-hyun dongjoon-hyun Jan 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous sentence already mentioned this endpoint. And, this sentence is invalid because we enabled it by default, @viirya .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I means that the config now is not mentioned in this doc. Is any other place we have mentioned this config?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, for that, I can add it to the config table officially.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, a few other UI configs are missing too. I can handle them together.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thanks.

@dongjoon-hyun
Copy link
Member Author

Thank you, @viirya ! For the UI config PR, I'll make a PR today.

@dongjoon-hyun
Copy link
Member Author

Merged to master for Apache Spark 4.0.0.

@dongjoon-hyun dongjoon-hyun deleted the SPARK-46886 branch January 27, 2024 23:15
@viirya
Copy link
Member

viirya commented Jan 27, 2024

Thank you @dongjoon-hyun . Please pine me once you create the doc PR.

@dongjoon-hyun
Copy link
Member Author

Sure! I'm make a PR in 5 minutes.

szehon-ho pushed a commit to szehon-ho/spark that referenced this pull request Feb 7, 2024
### What changes were proposed in this pull request?

`spark.ui.prometheus.enabled` has been used since Apache Spark 3.0.0.

- apache#25770

This PR aims to enable `spark.ui.prometheus.enabled` by default like Driver `JSON` API in Apache Spark 4.0.0.

|              |                JSON End Point                    |            Prometheus End Point         |
| ------- | ------------------------------------ | --------------------------------- |
| Driver   | /api/v1/applications/{id}/executors/   | /metrics/executors/prometheus/   |

### Why are the changes needed?

**BEFORE**
```
$ bin/spark-shell
$ curl -s http://localhost:4040/metrics/executors/prometheus | wc -l
       0
```

**AFTER**
```
$ bin/spark-shell
 $ curl -s http://localhost:4040/metrics/executors/prometheus | wc -l
      20
```

### Does this PR introduce _any_ user-facing change?

No, this is only a new endpoint.

### How was this patch tested?

Pass the CIs and do manual test.

### Was this patch authored or co-authored using generative AI tooling?

No.

Closes apache#44912 from dongjoon-hyun/SPARK-46886.

Authored-by: Dongjoon Hyun <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants