Skip to content

Commit 2504883

Browse files
committed
Add telemetry
1 parent ee5b527 commit 2504883

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/services/CfnService.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ import {
5757
OnStackFailure,
5858
} from '@aws-sdk/client-cloudformation';
5959
import { WaiterConfiguration, WaiterResult } from '@smithy/util-waiter';
60-
import { Measure } from '../telemetry/TelemetryDecorator';
60+
import { Count } from '../telemetry/TelemetryDecorator';
6161
import { AwsClient } from './AwsClient';
6262

6363
export class CfnService {
@@ -105,7 +105,7 @@ export class CfnService {
105105
return await this.withClient((client) => client.send(new CreateStackCommand(params)));
106106
}
107107

108-
@Measure({ name: 'describeStacks' })
108+
@Count({ name: 'describeStacks' })
109109
public async describeStacks(params?: {
110110
StackName?: string;
111111
NextToken?: string;
@@ -118,7 +118,7 @@ export class CfnService {
118118
return response.TemplateBody;
119119
}
120120

121-
@Measure({ name: 'createChangeSet' })
121+
@Count({ name: 'createChangeSet' })
122122
public async createChangeSet(params: {
123123
StackName: string;
124124
ChangeSetName: string;
@@ -137,7 +137,7 @@ export class CfnService {
137137
return await this.withClient((client) => client.send(new CreateChangeSetCommand(params)));
138138
}
139139

140-
@Measure({ name: 'describeChangeSet' })
140+
@Count({ name: 'describeChangeSet' })
141141
public async describeChangeSet(params: {
142142
ChangeSetName: string;
143143
IncludePropertyValues: boolean;
@@ -174,7 +174,7 @@ export class CfnService {
174174
return await this.withClient((client) => client.send(new DetectStackDriftCommand(params)));
175175
}
176176

177-
@Measure({ name: 'describeStackEvents' })
177+
@Count({ name: 'describeStackEvents' })
178178
public async describeStackEvents(
179179
params: {
180180
StackName: string;
@@ -191,7 +191,7 @@ export class CfnService {
191191
});
192192
}
193193

194-
@Measure({ name: 'describeStackResources' })
194+
@Count({ name: 'describeStackResources' })
195195
public async describeStackResources(params: {
196196
StackName?: string;
197197
LogicalResourceId?: string;
@@ -274,7 +274,7 @@ export class CfnService {
274274
});
275275
}
276276

277-
@Measure({ name: 'executeChangeSet' })
277+
@Count({ name: 'executeChangeSet' })
278278
public async executeChangeSet(params: {
279279
ChangeSetName: string;
280280
StackName?: string;
@@ -283,15 +283,15 @@ export class CfnService {
283283
return await this.withClient((client) => client.send(new ExecuteChangeSetCommand(params)));
284284
}
285285

286-
@Measure({ name: 'deleteChangeSet' })
286+
@Count({ name: 'deleteChangeSet' })
287287
public async deleteChangeSet(params: {
288288
ChangeSetName: string;
289289
StackName?: string;
290290
}): Promise<DeleteChangeSetCommandOutput> {
291291
return await this.withClient((client) => client.send(new DeleteChangeSetCommand(params)));
292292
}
293293

294-
@Measure({ name: 'deleteStack' })
294+
@Count({ name: 'deleteStack' })
295295
public async deleteStack(params: { StackName: string }): Promise<DeleteStackCommandOutput> {
296296
return await this.withClient((client) => client.send(new DeleteStackCommand(params)));
297297
}
@@ -361,12 +361,12 @@ export class CfnService {
361361
});
362362
}
363363

364-
@Measure({ name: 'validateTemplate' })
364+
@Count({ name: 'validateTemplate' })
365365
public async validateTemplate(params: ValidateTemplateInput): Promise<ValidateTemplateOutput> {
366366
return await this.withClient((client) => client.send(new ValidateTemplateCommand(params)));
367367
}
368368

369-
@Measure({ name: 'listChangeSets' })
369+
@Count({ name: 'listChangeSets' })
370370
public async listChangeSets(
371371
stackName: string,
372372
nextToken?: string,

src/services/CfnServiceV2.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
Change,
1111
ResourceChangeDetail,
1212
} from '@aws-sdk/client-cloudformation';
13+
import { Measure } from '../telemetry/TelemetryDecorator';
1314
import { CFN_CLIENT_PATH } from '../utils/ClientUtil';
1415
import { DynamicModuleLoader } from '../utils/DynamicModuleLoader';
1516
import { CfnService } from './CfnService';
@@ -85,6 +86,7 @@ export class CfnServiceV2 extends CfnService {
8586
});
8687
}
8788

89+
@Measure({ name: 'describeChangeSetV2' })
8890
public override async describeChangeSet(params: {
8991
ChangeSetName: string;
9092
IncludePropertyValues: boolean;
@@ -128,6 +130,7 @@ export class CfnServiceV2 extends CfnService {
128130
});
129131
}
130132

133+
@Measure({ name: 'describeEvents' })
131134
public async describeEvents(params: { ChangeSetName: string; StackName: string }): Promise<DescribeEventsOutput> {
132135
type CfnClient = typeof import('@aws-sdk/client-cloudformation') & {
133136
DescribeEventsCommand: new (input: { ChangeSetName: string; StackName: string; NextToken?: string }) => any;

0 commit comments

Comments
 (0)