Skip to content

Commit 73ca8c6

Browse files
[DOC] Configure the Spark metrics properties while creating a s3 Glue Connector (#2504) (#2508)
* Configure the Spark metrics properties while creating a s3 Glue Connector * Address comments from Vamsi * Refactor the whole config section --------- (cherry picked from commit 4f54d46) Signed-off-by: Louis Chu <clingzhi@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent db45846 commit 73ca8c6

1 file changed

Lines changed: 42 additions & 14 deletions

File tree

docs/user/interfaces/asyncqueryinterface.rst

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,49 @@ All the queries to be executed on spark execution engine can only be submitted v
2020

2121
Required Spark Execution Engine Config for Async Query APIs
2222
===========================================================
23-
Currently, we only support AWS EMRServerless as SPARK execution engine. The details of execution engine should be configured under
24-
``plugins.query.executionengine.spark.config`` in cluster settings. The value should be a stringified json comprising of ``applicationId``, ``executionRoleARN``,``region``, ``sparkSubmitParameter``.
25-
Sample Setting Value ::
26-
27-
plugins.query.executionengine.spark.config:
28-
'{ "applicationId":"xxxxx",
29-
"executionRoleARN":"arn:aws:iam::***********:role/emr-job-execution-role",
30-
"region":"eu-west-1",
31-
"sparkSubmitParameter": "--conf spark.dynamicAllocation.enabled=false"
32-
}'
33-
The user must be careful before transitioning to a new application or region, as changing these parameters might lead to failures in the retrieval of results from previous async query jobs.
34-
The system relies on the default AWS credentials chain for making calls to the EMR serverless application. It is essential to confirm that the default credentials possess the necessary permissions to pass the role required for EMR job execution, as specified in the engine configuration.
35-
* ``applicationId``, ``executionRoleARN`` and ``region`` are required parameters.
36-
* ``sparkSubmitParameter`` is an optional parameter. It can take the form ``--conf A=1 --conf B=2 ...``.
23+
Currently, the system supports only AWS EMRServerless as the SPARK execution engine. Configuration details for the execution engine should be specified under ``plugins.query.executionengine.spark.config`` in the opensearch.yml or cluster settings. The configuration value is expected to be a JSON string that includes ``applicationId``, ``executionRoleARN``, ``region``, and ``sparkSubmitParameter``.
24+
25+
Sample Setting Value in opensearch.yml
26+
--------------------
27+
28+
.. code-block:: yaml
29+
30+
"plugins.query.executionengine.spark.config: '{\"applicationId\":\"xxxxx\",\"executionRoleARN\":\"arn:aws:iam::xxxxx:role/emr-job-execution-role\",\"region\":\"us-west-2\", \"sparkSubmitParameters\": \"--conf spark.dynamicAllocation.enabled=false\"}'"
31+
32+
Caution
33+
-------
34+
35+
Users must exercise caution when transitioning to a new application or region, as changes to these parameters may lead to failures in retrieving results from previous asynchronous query jobs.
36+
37+
The system utilizes the default AWS credentials chain for calls to the EMR serverless application. It is critical to ensure that the default credentials have the necessary permissions to assume the role required for EMR job execution, as delineated in the engine configuration.
38+
39+
Requirements
40+
-------------
41+
42+
- **Required Parameters**: ``applicationId``, ``executionRoleARN``, and ``region`` must be provided.
43+
- **Optional Parameter**: ``sparkSubmitParameter`` is optional and can be formatted as ``--conf A=1 --conf B=2 ...``.
44+
45+
AWS CloudWatch metrics configuration
46+
-------------
47+
48+
Starting with Flint 0.1.1, users can utilize AWS CloudWatch as an external metrics sink while configuring their own metric sources. Below is an example of a console request for setting this up:
49+
50+
.. code-block:: json
51+
52+
PUT _cluster/settings
53+
{
54+
"persistent": {
55+
"plugins.query.executionengine.spark.config": "{\"applicationId\":\"xxxxx\",\"executionRoleARN\":\"arn:aws:iam::xxxxx:role/emr-job-execution-role\",\"region\":\"us-east-1\",\"sparkSubmitParameters\":\"--conf spark.dynamicAllocation.enabled=false --conf spark.metrics.conf.*.sink.cloudwatch.class=org.apache.spark.metrics.sink.CloudWatchSink --conf spark.metrics.conf.*.sink.cloudwatch.namespace=OpenSearchSQLSpark --conf spark.metrics.conf.*.sink.cloudwatch.regex=(opensearch|numberAllExecutors).* --conf spark.metrics.conf.*.source.cloudwatch.class=org.apache.spark.metrics.source.FlintMetricSource \"}"
56+
}
57+
}
58+
59+
For a comprehensive list of Spark configuration options related to metrics, please refer to the Spark documentation on monitoring:
60+
61+
- Spark Monitoring Documentation: https://spark.apache.org/docs/latest/monitoring.html#metrics
62+
63+
Additionally, for details on setting up CloudWatch metric sink and Flint metric source, consult the OpenSearch Spark project:
3764

65+
- OpenSearch Spark GitHub Repository: https://github.com/opensearch-project/opensearch-spark
3866

3967
Async Query Creation API
4068
======================================

0 commit comments

Comments
 (0)