Skip to content

Commit 5bc8daf

Browse files
committed
lint/syntax fixes
1 parent 3974e11 commit 5bc8daf

File tree

6 files changed

+49
-49
lines changed

6 files changed

+49
-49
lines changed
-1.38 MB
Binary file not shown.

src/ecs/fargate/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
*/
88

99
import { Duration } from "aws-cdk-lib";
10+
import { FirelensConfigFileType } from "aws-cdk-lib/aws-ecs";
1011
import { DatadogECSFargateProps, DatadogECSLogDriverProps, LoggingType } from "./interfaces";
1112
import { DatadogEcsBaseDefaultProps } from "../constants";
12-
import { FirelensConfigFileType } from "aws-cdk-lib/aws-ecs";
1313

1414
/**
1515
* Default environment variables for the Agent in Fargate Tasks

src/ecs/fargate/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99
import log from "loglevel";
10-
import { DatadogECSFargateInternalProps, DatadogECSFargateProps, LoggingType } from "./interfaces";
1110
import { ParseJsonFirelensConfigFileType, ParseJsonFirelensConfigFileValue } from "./constants";
11+
import { DatadogECSFargateInternalProps, DatadogECSFargateProps, LoggingType } from "./interfaces";
1212

1313
export function mergeFargateProps(
1414
lowerPrecedence: DatadogECSFargateProps,

src/sample/ecs_fargate/index.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,23 @@ export class ExampleStack extends Stack {
8282
memoryLimitMiB: 1024,
8383
});
8484

85-
fargateTaskDefinition.addContainer("DatadogDogstatsd", {
86-
containerName: "datadog-dogstatsd-app",
85+
// Dummy app emitting custom metrics
86+
fargateTaskDefinition.addContainer("DummyDogstatsd", {
87+
containerName: "dummy-dogstatsd-app",
8788
image: ecs.ContainerImage.fromRegistry("ghcr.io/datadog/apps-dogstatsd:main"),
8889
essential: false,
8990
});
9091

91-
fargateTaskDefinition.addContainer("DatadogAPM", {
92-
containerName: "datadog-apm-app",
92+
// Dummy app emitting APM traces + logs
93+
fargateTaskDefinition.addContainer("DummyAPM", {
94+
containerName: "dummy-apm-app",
9395
image: ecs.ContainerImage.fromRegistry("ghcr.io/datadog/apps-tracegen:main"),
9496
essential: true,
9597
});
9698

97-
fargateTaskDefinition.addContainer("DatadogCWS", {
98-
containerName: "datadog-cws-app",
99+
// Dummy app emitting CWS events + logs
100+
fargateTaskDefinition.addContainer("DummyCWS", {
101+
containerName: "dummy-cws-app",
99102
image: ecs.ContainerImage.fromRegistry("public.ecr.aws/ubuntu/ubuntu:22.04_stable"),
100103
essential: false,
101104
entryPoint: [
@@ -106,8 +109,8 @@ export class ExampleStack extends Stack {
106109
});
107110

108111
// no-dd-sa:typescript-code-style/no-new
109-
new ecs.FargateService(this, "NginxService", {
110-
serviceName: "NginxService",
112+
new ecs.FargateService(this, "DatadogMonitoredService", {
113+
serviceName: "DatadogMonitoredService",
111114
cluster,
112115
taskDefinition: fargateTaskDefinition,
113116
desiredCount: 1,
@@ -131,8 +134,8 @@ export class ExampleStack extends Stack {
131134
globalTags: "team:cont-p, owner:container-monitoring",
132135
},
133136
);
134-
task.addContainer("DatadogDogstatsd", {
135-
containerName: "datadog-dogstatsd-app",
137+
task.addContainer("DummyDogstatsd", {
138+
containerName: "dummy-dogstatsd-app",
136139
image: ecs.ContainerImage.fromRegistry("ghcr.io/datadog/apps-dogstatsd:main"),
137140
essential: true,
138141
});

test/ecs/fargate/apm-dsd.spec.ts

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -287,41 +287,38 @@ describe("DatadogECSFargateTaskDefinition", () => {
287287
},
288288
];
289289

290-
test.each(cases)(
291-
"should %s",
292-
({ isEnabled, traceInferredProxyServices, shouldSet, expectedValue }) => {
293-
const template = createTaskWithApmProps({ isEnabled, traceInferredProxyServices });
294-
if (shouldSet) {
295-
template.hasResourceProperties("AWS::ECS::TaskDefinition", {
296-
ContainerDefinitions: Match.arrayWith([
297-
Match.objectLike({
298-
Name: "app-container",
299-
Environment: Match.arrayWith([
290+
test.each(cases)("should %s", ({ isEnabled, traceInferredProxyServices, shouldSet, expectedValue }) => {
291+
const template = createTaskWithApmProps({ isEnabled, traceInferredProxyServices });
292+
if (shouldSet) {
293+
template.hasResourceProperties("AWS::ECS::TaskDefinition", {
294+
ContainerDefinitions: Match.arrayWith([
295+
Match.objectLike({
296+
Name: "app-container",
297+
Environment: Match.arrayWith([
298+
Match.objectLike({
299+
Name: "DD_TRACE_INFERRED_PROXY_SERVICES_ENABLED",
300+
Value: expectedValue,
301+
}),
302+
]),
303+
}),
304+
]),
305+
});
306+
} else {
307+
template.hasResourceProperties("AWS::ECS::TaskDefinition", {
308+
ContainerDefinitions: Match.arrayWith([
309+
Match.objectLike({
310+
Name: "app-container",
311+
Environment: Match.not(
312+
Match.arrayWith([
300313
Match.objectLike({
301314
Name: "DD_TRACE_INFERRED_PROXY_SERVICES_ENABLED",
302-
Value: expectedValue,
303315
}),
304316
]),
305-
}),
306-
]),
307-
});
308-
} else {
309-
template.hasResourceProperties("AWS::ECS::TaskDefinition", {
310-
ContainerDefinitions: Match.arrayWith([
311-
Match.objectLike({
312-
Name: "app-container",
313-
Environment: Match.not(
314-
Match.arrayWith([
315-
Match.objectLike({
316-
Name: "DD_TRACE_INFERRED_PROXY_SERVICES_ENABLED",
317-
}),
318-
])
319-
),
320-
}),
321-
]),
322-
});
323-
}
317+
),
318+
}),
319+
]),
320+
});
324321
}
325-
);
322+
});
326323
});
327324
});

test/ecs/fargate/logging.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ describe("DatadogECSFargateLogging", () => {
223223
firelensOptions: {
224224
isParseJson: true,
225225
configFileValue: "this/value/should/be/overridden.conf",
226-
}
226+
},
227227
},
228228
},
229229
};
@@ -242,8 +242,8 @@ describe("DatadogECSFargateLogging", () => {
242242
"enable-ecs-log-metadata": "true",
243243
"config-file-type": "file",
244244
"config-file-value": "/fluent-bit/configs/parse-json.conf",
245-
}
246-
}
245+
},
246+
},
247247
}),
248248
]),
249249
});
@@ -259,7 +259,7 @@ describe("DatadogECSFargateLogging", () => {
259259
isParseJson: false,
260260
configFileType: ecsDatadog.ParseJsonFirelensConfigFileType,
261261
configFileValue: "some/other/value.conf",
262-
}
262+
},
263263
},
264264
},
265265
};
@@ -278,8 +278,8 @@ describe("DatadogECSFargateLogging", () => {
278278
"enable-ecs-log-metadata": "true",
279279
"config-file-type": "file",
280280
"config-file-value": "some/other/value.conf",
281-
}
282-
}
281+
},
282+
},
283283
}),
284284
]),
285285
});

0 commit comments

Comments
 (0)