Skip to content

Commit

Permalink
chore(glue-alpha): Enable observability metrics in Glue Jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
cbcoutinho committed Nov 29, 2023
1 parent 1a586f2 commit 6cf96c2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/@aws-cdk/aws-glue-alpha/lib/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,15 @@ export interface JobProps {
*/
readonly enableProfilingMetrics? :boolean;

/**
* Enables the collection of observability metrics for resource profiling.
*
* @default - no observability metrics emitted.
*
* @see `--enable-observability-metrics` at https://docs.aws.amazon.com/glue/latest/dg/aws-glue-programming-etl-glue-arguments.html
*/
readonly enableObservabilityMetrics? :boolean;

/**
* Enables the Spark UI debugging and monitoring with the specified props.
*
Expand Down Expand Up @@ -701,12 +710,14 @@ export class Job extends JobBase {
const sparkUI = props.sparkUI?.enabled ? this.setupSparkUI(executable, this.role, props.sparkUI) : undefined;
this.sparkUILoggingLocation = sparkUI?.location;
const continuousLoggingArgs = props.continuousLogging?.enabled ? this.setupContinuousLogging(this.role, props.continuousLogging) : {};
const profilingMetricsArgs = props.enableProfilingMetrics ? { '--enable-metrics': '' } : {};
const profilingMetricsArgs = props.enableProfilingMetrics ? { '--enable-metrics': '' } : {};
const observabilityMetricsArgs = props.enableObservabilityMetrics ? { '--enable-observability-metrics': '' } : {};

const defaultArguments = {
...this.executableArguments(executable),
...continuousLoggingArgs,
...profilingMetricsArgs,
...observabilityMetricsArgs,
...sparkUI?.args,
...this.checkNoReservedArgs(props.defaultArguments),
};
Expand Down

0 comments on commit 6cf96c2

Please sign in to comment.