Skip to content
Open
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
9 changes: 8 additions & 1 deletion src/environment/ECSEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ const formatImageName = (imageName: string): string => {
return imageName;
};

// logGroupName must satisfy regular expression pattern: [\\.\\-_/#A-Za-z0-9]+
const formatLogGroupName = (logGroupName: string): string => {
Copy link
Member

@gordonpn gordonpn Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this method name accurately describe what the method is doing.

return logGroupName.replace(":", "/");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have unit tests for this.

}

export class ECSEnvironment implements IEnvironment {
private sink: ISink | undefined;
private metadata: IECSMetadataResponse | undefined;
Expand Down Expand Up @@ -114,7 +119,9 @@ export class ECSEnvironment implements IEnvironment {
return '';
}

return config.logGroupName || this.getName();
const logGroupName = config.logGroupName || this.getName()

return formatLogGroupName(logGroupName);
}

public configureContext(context: MetricsContext): void {
Expand Down