Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/artifactexporter/ArtifactExporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { DocumentType } from '../document/Document';
import { parseDocumentContent } from '../document/DocumentUtils';
import { S3Service } from '../services/S3Service';
import { Artifact } from '../stacks/actions/StackActionRequestType';
import { Measure } from '../telemetry/TelemetryDecorator';
import { isS3Url, RESOURCE_EXPORTER_MAP } from './ResourceExporters';

export type ArtifactWithProperty = {
Expand Down Expand Up @@ -81,6 +82,7 @@ export class ArtifactExporter {
return artifactMap;
}

@Measure({ name: 'getTemplateArtifacts' })
getTemplateArtifacts(): Artifact[] {
const artifactMap = this.getResourceMapWithArtifact();
const result: Artifact[] = [];
Expand Down Expand Up @@ -117,6 +119,7 @@ export class ArtifactExporter {
return result;
}

@Measure({ name: 'exportArtifact' })
async export(bucketName: string, s3KeyPrefix: string = ''): Promise<unknown> {
if (
this.templateDict === undefined ||
Expand Down
9 changes: 8 additions & 1 deletion src/services/CfnService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import {
import { WaiterConfiguration, WaiterResult } from '@smithy/util-waiter';
import { AwsClientSettings, DefaultSettings } from '../settings/Settings';
import { DeploymentMode } from '../stacks/actions/StackActionRequestType';
import { Count } from '../telemetry/TelemetryDecorator';
import { Count, Measure } from '../telemetry/TelemetryDecorator';
import { AwsClient } from './AwsClient';

export class CfnService {
Expand Down Expand Up @@ -174,6 +174,7 @@ export class CfnService {
});
}

@Count({ name: 'detectStackDrift' })
public async detectStackDrift(params: {
StackName: string;
LogicalResourceIds?: string[];
Expand Down Expand Up @@ -256,6 +257,7 @@ export class CfnService {
return await this.withClient((client) => client.send(new ListStackResourcesCommand(params)));
}

@Count({ name: 'describeStackResourceDrifts' })
public async describeStackResourceDrifts(params: {
StackName: string;
StackResourceDriftStatusFilters?: StackResourceDriftStatus[];
Expand Down Expand Up @@ -337,6 +339,7 @@ export class CfnService {
return await this.withClient((client) => client.send(new DeleteStackCommand(params)));
}

@Measure({ name: 'waitUntilChangeSetCreateComplete' })
public async waitUntilChangeSetCreateComplete(params: DescribeChangeSetCommandInput): Promise<WaiterResult> {
return await this.withClient(async (client) => {
const settings = this.awsClientSettings;
Expand All @@ -350,6 +353,7 @@ export class CfnService {
});
}

@Measure({ name: 'waitUntilStackCreateComplete' })
public async waitUntilStackCreateComplete(params: DescribeStacksCommandInput): Promise<WaiterResult> {
return await this.withClient(async (client) => {
const settings = this.awsClientSettings;
Expand All @@ -363,6 +367,7 @@ export class CfnService {
});
}

@Measure({ name: 'waitUntilStackUpdateComplete' })
public async waitUntilStackUpdateComplete(params: DescribeStacksCommandInput): Promise<WaiterResult> {
return await this.withClient(async (client) => {
const settings = this.awsClientSettings;
Expand All @@ -376,6 +381,7 @@ export class CfnService {
});
}

@Measure({ name: 'waitUntilStackImportComplete' })
public async waitUntilStackImportComplete(params: DescribeStacksCommandInput): Promise<WaiterResult> {
return await this.withClient(async (client) => {
const settings = this.awsClientSettings;
Expand All @@ -389,6 +395,7 @@ export class CfnService {
});
}

@Measure({ name: 'waitUntilStackDeleteComplete' })
public async waitUntilStackDeleteComplete(params: DescribeStacksCommandInput): Promise<WaiterResult> {
return await this.withClient(async (client) => {
const settings = this.awsClientSettings;
Expand Down
2 changes: 2 additions & 0 deletions src/stacks/actions/ChangeSetDeletionWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { CfnExternal } from '../../server/CfnExternal';
import { CfnInfraCore } from '../../server/CfnInfraCore';
import { CfnService } from '../../services/CfnService';
import { LoggerFactory } from '../../telemetry/LoggerFactory';
import { Measure } from '../../telemetry/TelemetryDecorator';
import { extractErrorMessage } from '../../utils/Errors';
import { processWorkflowUpdates, mapChangesToStackChanges, isStackInReview } from './StackActionOperations';
import {
Expand All @@ -29,6 +30,7 @@ export class ChangeSetDeletionWorkflow
protected readonly documentManager: DocumentManager,
) {}

@Measure({ name: 'changeSetDeletionWorkflow' })
async start(params: CreateDeploymentParams): Promise<CreateStackActionResult> {
const describeChangeSetResult = await this.cfnService.describeChangeSet({
StackName: params.stackName,
Expand Down
2 changes: 2 additions & 0 deletions src/stacks/actions/DeploymentWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { CfnExternal } from '../../server/CfnExternal';
import { CfnInfraCore } from '../../server/CfnInfraCore';
import { CfnService } from '../../services/CfnService';
import { LoggerFactory } from '../../telemetry/LoggerFactory';
import { Measure } from '../../telemetry/TelemetryDecorator';
import { extractErrorMessage } from '../../utils/Errors';
import {
waitForDeployment,
Expand Down Expand Up @@ -33,6 +34,7 @@ export class DeploymentWorkflow implements StackActionWorkflow<CreateDeploymentP
protected readonly documentManager: DocumentManager,
) {}

@Measure({ name: 'deploymentWorkflow' })
async start(params: CreateDeploymentParams): Promise<CreateStackActionResult> {
const workflow = {
id: params.id,
Expand Down
2 changes: 2 additions & 0 deletions src/stacks/actions/ValidationWorkflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CfnService } from '../../services/CfnService';
import { DiagnosticCoordinator } from '../../services/DiagnosticCoordinator';
import { S3Service } from '../../services/S3Service';
import { LoggerFactory } from '../../telemetry/LoggerFactory';
import { Measure } from '../../telemetry/TelemetryDecorator';
import { extractErrorMessage } from '../../utils/Errors';
import {
cleanupReviewStack,
Expand Down Expand Up @@ -52,6 +53,7 @@ export class ValidationWorkflow implements StackActionWorkflow<CreateValidationP
protected awsCredentials: AwsCredentials,
) {}

@Measure({ name: 'validationWorkflow' })
async start(params: CreateValidationParams): Promise<CreateStackActionResult> {
// Determine ChangeSet type based on resourcesToImport and stack existence
let changeSetType: ChangeSetType;
Expand Down
Loading