Skip to content

Commit 55ce77a

Browse files
author
awstools
committed
feat(client-rum): CloudWatch RUM now supports custom events. To use custom events, create an app monitor or update an app monitor with CustomEvent Status as ENABLED.
1 parent e477f4a commit 55ce77a

File tree

7 files changed

+204
-97
lines changed

7 files changed

+204
-97
lines changed

clients/client-rum/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ AWS SDK for JavaScript RUM Client for Node.js, Browser and React Native.
1313
your web application performance from actual user sessions in real time. The data collected includes page load
1414
times, client-side errors, and user behavior. When you view this data, you can see it all aggregated together and
1515
also see breakdowns by the browsers and devices that your customers use.</p>
16-
1716
<p>You can use the collected data to quickly identify and debug client-side performance issues. CloudWatch
1817
RUM helps you visualize anomalies in your application performance and find relevant debugging data such as error
1918
messages, stack traces, and user sessions. You can also use RUM to

clients/client-rum/src/RUM.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ import { RUMClient } from "./RUMClient";
8989
* your web application performance from actual user sessions in real time. The data collected includes page load
9090
* times, client-side errors, and user behavior. When you view this data, you can see it all aggregated together and
9191
* also see breakdowns by the browsers and devices that your customers use.</p>
92-
*
9392
* <p>You can use the collected data to quickly identify and debug client-side performance issues. CloudWatch
9493
* RUM helps you visualize anomalies in your application performance and find relevant debugging data such as error
9594
* messages, stack traces, and user sessions. You can also use RUM to
@@ -111,7 +110,6 @@ export class RUM extends RUMClient {
111110
* Extended metrics that you can send to CloudWatch and CloudWatch Evidently</a>.</p>
112111
* <p>The maximum number of metric definitions that you can specify in one
113112
* <code>BatchCreateRumMetricDefinitions</code> operation is 200.</p>
114-
*
115113
* <p>The maximum number of metric definitions that one destination can contain is 2000.</p>
116114
* <p>Extended metrics sent are charged as CloudWatch custom metrics. Each combination of additional dimension name and dimension
117115
* value counts as a custom metric. For more information, see

clients/client-rum/src/RUMClient.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ export interface RUMClientResolvedConfig extends RUMClientResolvedConfigType {}
288288
* your web application performance from actual user sessions in real time. The data collected includes page load
289289
* times, client-side errors, and user behavior. When you view this data, you can see it all aggregated together and
290290
* also see breakdowns by the browsers and devices that your customers use.</p>
291-
*
292291
* <p>You can use the collected data to quickly identify and debug client-side performance issues. CloudWatch
293292
* RUM helps you visualize anomalies in your application performance and find relevant debugging data such as error
294293
* messages, stack traces, and user sessions. You can also use RUM to

clients/client-rum/src/commands/BatchCreateRumMetricDefinitionsCommand.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export interface BatchCreateRumMetricDefinitionsCommandOutput
4545
* Extended metrics that you can send to CloudWatch and CloudWatch Evidently</a>.</p>
4646
* <p>The maximum number of metric definitions that you can specify in one
4747
* <code>BatchCreateRumMetricDefinitions</code> operation is 200.</p>
48-
*
4948
* <p>The maximum number of metric definitions that one destination can contain is 2000.</p>
5049
* <p>Extended metrics sent are charged as CloudWatch custom metrics. Each combination of additional dimension name and dimension
5150
* value counts as a custom metric. For more information, see

clients/client-rum/src/models/models_0.ts

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ export interface AppMonitorConfiguration {
5858

5959
/**
6060
* <p>If this app monitor is to collect data from only certain pages in your application, this structure lists those pages. </p>
61-
*
6261
* <p>You can't include both <code>ExcludedPages</code> and <code>IncludedPages</code> in the same operation.</p>
6362
*/
6463
IncludedPages?: string[];
@@ -124,6 +123,22 @@ export interface AppMonitorConfiguration {
124123
EnableXRay?: boolean;
125124
}
126125

126+
export enum CustomEventsStatus {
127+
DISABLED = "DISABLED",
128+
ENABLED = "ENABLED",
129+
}
130+
131+
/**
132+
* <p>A structure that contains information about custom events for this app monitor.</p>
133+
*/
134+
export interface CustomEvents {
135+
/**
136+
* <p>Specifies whether this app monitor allows the web client to define and send
137+
* custom events. The default is for custom events to be <code>DISABLED</code>.</p>
138+
*/
139+
Status?: CustomEventsStatus | string;
140+
}
141+
127142
/**
128143
* <p>A structure that contains the information about whether the app monitor stores copies of the data
129144
* that RUM collects in CloudWatch Logs. If it does, this structure also contains the name of the log group.</p>
@@ -210,6 +225,14 @@ export interface AppMonitor {
210225
* the telemetry data that RUM collects using CloudWatch Logs.</p>
211226
*/
212227
DataStorage?: DataStorage;
228+
229+
/**
230+
* <p>Specifies whether this app monitor allows the web client to define and send
231+
* custom events.</p>
232+
* <p>For more information about custom events, see
233+
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-events.html">Send custom events</a>.</p>
234+
*/
235+
CustomEvents?: CustomEvents;
213236
}
214237

215238
/**
@@ -450,7 +473,6 @@ export interface MetricDefinitionRequest {
450473
* </p>
451474
* </li>
452475
* </ul>
453-
*
454476
* <p> All dimensions listed in this field
455477
* must also be included in <code>EventPattern</code>.</p>
456478
*/
@@ -910,7 +932,6 @@ export interface CreateAppMonitorRequest {
910932
* permissions by granting a user
911933
* permission to access or change only resources with certain tag values.</p>
912934
* <p>Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of characters.</p>
913-
*
914935
* <p>You can associate as many as 50 tags with an app monitor.</p>
915936
* <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services resources</a>.</p>
916937
*/
@@ -935,6 +956,14 @@ export interface CreateAppMonitorRequest {
935956
* <p>If you omit this parameter, the default is <code>false</code>.</p>
936957
*/
937958
CwLogEnabled?: boolean;
959+
960+
/**
961+
* <p>Specifies whether this app monitor allows the web client to define and send
962+
* custom events. If you omit this parameter, custom events are <code>DISABLED</code>.</p>
963+
* <p>For more information about custom events, see
964+
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-events.html">Send custom events</a>.</p>
965+
*/
966+
CustomEvents?: CustomEvents;
938967
}
939968

940969
export interface CreateAppMonitorResponse {
@@ -1248,6 +1277,14 @@ export interface UpdateAppMonitorRequest {
12481277
* Amazon CloudWatch Logs charges.</p>
12491278
*/
12501279
CwLogEnabled?: boolean;
1280+
1281+
/**
1282+
* <p>Specifies whether this app monitor allows the web client to define and send
1283+
* custom events. The default is for custom events to be <code>DISABLED</code>.</p>
1284+
* <p>For more information about custom events, see
1285+
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-custom-events.html">Send custom events</a>.</p>
1286+
*/
1287+
CustomEvents?: CustomEvents;
12511288
}
12521289

12531290
export interface UpdateAppMonitorResponse {}
@@ -1419,6 +1456,13 @@ export const AppMonitorConfigurationFilterSensitiveLog = (obj: AppMonitorConfigu
14191456
...obj,
14201457
});
14211458

1459+
/**
1460+
* @internal
1461+
*/
1462+
export const CustomEventsFilterSensitiveLog = (obj: CustomEvents): any => ({
1463+
...obj,
1464+
});
1465+
14221466
/**
14231467
* @internal
14241468
*/

clients/client-rum/src/protocols/Aws_restJson1.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ import {
7575
BatchCreateRumMetricDefinitionsError,
7676
BatchDeleteRumMetricDefinitionsError,
7777
ConflictException,
78+
CustomEvents,
7879
CwLog,
7980
DataStorage,
8081
InternalServerException,
@@ -216,6 +217,9 @@ export const serializeAws_restJson1CreateAppMonitorCommand = async (
216217
...(input.AppMonitorConfiguration != null && {
217218
AppMonitorConfiguration: serializeAws_restJson1AppMonitorConfiguration(input.AppMonitorConfiguration, context),
218219
}),
220+
...(input.CustomEvents != null && {
221+
CustomEvents: serializeAws_restJson1CustomEvents(input.CustomEvents, context),
222+
}),
219223
...(input.CwLogEnabled != null && { CwLogEnabled: input.CwLogEnabled }),
220224
...(input.Domain != null && { Domain: input.Domain }),
221225
...(input.Name != null && { Name: input.Name }),
@@ -549,6 +553,9 @@ export const serializeAws_restJson1UpdateAppMonitorCommand = async (
549553
...(input.AppMonitorConfiguration != null && {
550554
AppMonitorConfiguration: serializeAws_restJson1AppMonitorConfiguration(input.AppMonitorConfiguration, context),
551555
}),
556+
...(input.CustomEvents != null && {
557+
CustomEvents: serializeAws_restJson1CustomEvents(input.CustomEvents, context),
558+
}),
552559
...(input.CwLogEnabled != null && { CwLogEnabled: input.CwLogEnabled }),
553560
...(input.Domain != null && { Domain: input.Domain }),
554561
});
@@ -1673,6 +1680,12 @@ const serializeAws_restJson1AppMonitorDetails = (input: AppMonitorDetails, conte
16731680
};
16741681
};
16751682

1683+
const serializeAws_restJson1CustomEvents = (input: CustomEvents, context: __SerdeContext): any => {
1684+
return {
1685+
...(input.Status != null && { Status: input.Status }),
1686+
};
1687+
};
1688+
16761689
const serializeAws_restJson1DimensionKeysMap = (input: Record<string, string>, context: __SerdeContext): any => {
16771690
return Object.entries(input).reduce((acc: Record<string, any>, [key, value]: [string, any]) => {
16781691
if (value === null) {
@@ -1805,6 +1818,8 @@ const deserializeAws_restJson1AppMonitor = (output: any, context: __SerdeContext
18051818
? deserializeAws_restJson1AppMonitorConfiguration(output.AppMonitorConfiguration, context)
18061819
: undefined,
18071820
Created: __expectString(output.Created),
1821+
CustomEvents:
1822+
output.CustomEvents != null ? deserializeAws_restJson1CustomEvents(output.CustomEvents, context) : undefined,
18081823
DataStorage:
18091824
output.DataStorage != null ? deserializeAws_restJson1DataStorage(output.DataStorage, context) : undefined,
18101825
Domain: __expectString(output.Domain),
@@ -1914,6 +1929,12 @@ const deserializeAws_restJson1BatchDeleteRumMetricDefinitionsErrors = (
19141929
return retVal;
19151930
};
19161931

1932+
const deserializeAws_restJson1CustomEvents = (output: any, context: __SerdeContext): CustomEvents => {
1933+
return {
1934+
Status: __expectString(output.Status),
1935+
} as any;
1936+
};
1937+
19171938
const deserializeAws_restJson1CwLog = (output: any, context: __SerdeContext): CwLog => {
19181939
return {
19191940
CwLogEnabled: __expectBoolean(output.CwLogEnabled),

0 commit comments

Comments
 (0)