@datadog/datadog-ci-base 4.1.2 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/cli.d.ts +1 -0
  2. package/dist/cli.js +24 -22
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/aas/common.d.ts +0 -8
  5. package/dist/commands/aas/common.js +7 -13
  6. package/dist/commands/aas/common.js.map +1 -1
  7. package/dist/commands/cloud-run/constants.d.ts +0 -2
  8. package/dist/commands/cloud-run/constants.js +4 -5
  9. package/dist/commands/cloud-run/constants.js.map +1 -1
  10. package/dist/commands/cloud-run/instrument.js +5 -7
  11. package/dist/commands/cloud-run/instrument.js.map +1 -1
  12. package/dist/commands/cloud-run/uninstrument.js +1 -1
  13. package/dist/commands/cloud-run/uninstrument.js.map +1 -1
  14. package/dist/commands/container-app/cli.d.ts +3 -0
  15. package/dist/commands/container-app/cli.js +12 -0
  16. package/dist/commands/container-app/cli.js.map +1 -0
  17. package/dist/commands/container-app/common.d.ts +42 -0
  18. package/dist/commands/container-app/common.js +127 -0
  19. package/dist/commands/container-app/common.js.map +1 -0
  20. package/dist/commands/container-app/instrument.d.ts +17 -0
  21. package/dist/commands/container-app/instrument.js +77 -0
  22. package/dist/commands/container-app/instrument.js.map +1 -0
  23. package/dist/commands/container-app/uninstrument.d.ts +10 -0
  24. package/dist/commands/container-app/uninstrument.js +59 -0
  25. package/dist/commands/container-app/uninstrument.js.map +1 -0
  26. package/dist/constants.d.ts +0 -25
  27. package/dist/constants.js +1 -79
  28. package/dist/constants.js.map +1 -1
  29. package/dist/helpers/serverless/azure.d.ts +24 -0
  30. package/dist/helpers/serverless/azure.js +55 -0
  31. package/dist/helpers/serverless/azure.js.map +1 -0
  32. package/dist/helpers/serverless/common.d.ts +75 -0
  33. package/dist/helpers/serverless/common.js +207 -0
  34. package/dist/helpers/serverless/common.js.map +1 -0
  35. package/dist/helpers/serverless/constants.d.ts +40 -0
  36. package/dist/helpers/serverless/constants.js +96 -0
  37. package/dist/helpers/serverless/constants.js.map +1 -0
  38. package/dist/helpers/{flare.js → serverless/flare.js} +8 -7
  39. package/dist/helpers/serverless/flare.js.map +1 -0
  40. package/dist/helpers/serverless/source-code-integration.js.map +1 -0
  41. package/package.json +16 -11
  42. package/dist/helpers/flare.js.map +0 -1
  43. package/dist/helpers/git/source-code-integration.js.map +0 -1
  44. /package/dist/helpers/{flare.d.ts → serverless/flare.d.ts} +0 -0
  45. /package/dist/helpers/{git → serverless}/source-code-integration.d.ts +0 -0
  46. /package/dist/helpers/{git → serverless}/source-code-integration.js +0 -0
package/dist/cli.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export declare const commands: {
2
2
  aas: typeof import("./commands/aas/uninstrument").AasUninstrumentCommand[];
3
3
  'cloud-run': (typeof import("./commands/cloud-run/flare").CloudRunFlareCommand | typeof import("./commands/cloud-run/instrument").CloudRunInstrumentCommand | typeof import("./commands/cloud-run/uninstrument").CloudRunUninstrumentCommand)[];
4
+ 'container-app': (typeof import("./commands/container-app/instrument").ContainerAppInstrumentCommand | typeof import("./commands/container-app/uninstrument").ContainerAppUninstrumentCommand)[];
4
5
  deployment: (typeof import("./commands/deployment/correlate-image").DeploymentCorrelateImageCommand | typeof import("./commands/deployment/correlate").DeploymentCorrelateCommand | typeof import("./commands/deployment/gate").DeploymentGateCommand | typeof import("./commands/deployment/mark").DeploymentMarkCommand)[];
5
6
  dora: typeof import("./commands/dora/deployment").DoraDeploymentCommand[];
6
7
  gate: typeof import("./commands/gate/evaluate").GateEvaluateCommand[];
package/dist/cli.js CHANGED
@@ -3,32 +3,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.noPluginExceptions = exports.commands = void 0;
4
4
  const cli_1 = require("./commands/aas/cli");
5
5
  const cli_2 = require("./commands/cloud-run/cli");
6
- const cli_3 = require("./commands/deployment/cli");
7
- const cli_4 = require("./commands/dora/cli");
8
- const cli_5 = require("./commands/gate/cli");
9
- const cli_6 = require("./commands/git-metadata/cli");
10
- const cli_7 = require("./commands/lambda/cli");
11
- const cli_8 = require("./commands/plugin/cli");
12
- const cli_9 = require("./commands/sarif/cli");
13
- const cli_10 = require("./commands/sbom/cli");
14
- const cli_11 = require("./commands/stepfunctions/cli");
15
- const cli_12 = require("./commands/synthetics/cli");
16
- const cli_13 = require("./commands/tag/cli");
6
+ const cli_3 = require("./commands/container-app/cli");
7
+ const cli_4 = require("./commands/deployment/cli");
8
+ const cli_5 = require("./commands/dora/cli");
9
+ const cli_6 = require("./commands/gate/cli");
10
+ const cli_7 = require("./commands/git-metadata/cli");
11
+ const cli_8 = require("./commands/lambda/cli");
12
+ const cli_9 = require("./commands/plugin/cli");
13
+ const cli_10 = require("./commands/sarif/cli");
14
+ const cli_11 = require("./commands/sbom/cli");
15
+ const cli_12 = require("./commands/stepfunctions/cli");
16
+ const cli_13 = require("./commands/synthetics/cli");
17
+ const cli_14 = require("./commands/tag/cli");
17
18
  // prettier-ignore
18
19
  exports.commands = {
19
20
  'aas': cli_1.commands,
20
21
  'cloud-run': cli_2.commands,
21
- 'deployment': cli_3.commands,
22
- 'dora': cli_4.commands,
23
- 'gate': cli_5.commands,
24
- 'git-metadata': cli_6.commands,
25
- 'lambda': cli_7.commands,
26
- 'plugin': cli_8.commands,
27
- 'sarif': cli_9.commands,
28
- 'sbom': cli_10.commands,
29
- 'stepfunctions': cli_11.commands,
30
- 'synthetics': cli_12.commands,
31
- 'tag': cli_13.commands,
22
+ 'container-app': cli_3.commands,
23
+ 'deployment': cli_4.commands,
24
+ 'dora': cli_5.commands,
25
+ 'gate': cli_6.commands,
26
+ 'git-metadata': cli_7.commands,
27
+ 'lambda': cli_8.commands,
28
+ 'plugin': cli_9.commands,
29
+ 'sarif': cli_10.commands,
30
+ 'sbom': cli_11.commands,
31
+ 'stepfunctions': cli_12.commands,
32
+ 'synthetics': cli_13.commands,
33
+ 'tag': cli_14.commands,
32
34
  };
33
35
  /**
34
36
  * Some command scopes do not have a plugin package, and their logic is entirely included in `@datadog/datadog-ci-base`.
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAGA,4CAA0D;AAC1D,kDAAqE;AACrE,mDAAwE;AACxE,6CAA4D;AAC5D,6CAA4D;AAC5D,qDAA2E;AAC3E,+CAAgE;AAChE,+CAAgE;AAChE,8CAA8D;AAC9D,8CAA4D;AAC5D,uDAA8E;AAC9E,oDAAwE;AACxE,6CAA0D;AAE1D,kBAAkB;AACL,QAAA,QAAQ,GAAG;IACtB,KAAK,EAAE,cAAW;IAClB,WAAW,EAAE,cAAgB;IAC7B,YAAY,EAAE,cAAkB;IAChC,MAAM,EAAE,cAAY;IACpB,MAAM,EAAE,cAAY;IACpB,cAAc,EAAE,cAAmB;IACnC,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,cAAa;IACtB,MAAM,EAAE,eAAY;IACpB,eAAe,EAAE,eAAqB;IACtC,YAAY,EAAE,eAAkB;IAChC,KAAK,EAAE,eAAW;CACe,CAAA;AAEnC;;GAEG;AACU,QAAA,kBAAkB,GAAgB,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC,CAEvF,CAAA"}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AAGA,4CAA0D;AAC1D,kDAAqE;AACrE,sDAA6E;AAC7E,mDAAwE;AACxE,6CAA4D;AAC5D,6CAA4D;AAC5D,qDAA2E;AAC3E,+CAAgE;AAChE,+CAAgE;AAChE,+CAA8D;AAC9D,8CAA4D;AAC5D,uDAA8E;AAC9E,oDAAwE;AACxE,6CAA0D;AAE1D,kBAAkB;AACL,QAAA,QAAQ,GAAG;IACtB,KAAK,EAAE,cAAW;IAClB,WAAW,EAAE,cAAgB;IAC7B,eAAe,EAAE,cAAoB;IACrC,YAAY,EAAE,cAAkB;IAChC,MAAM,EAAE,cAAY;IACpB,MAAM,EAAE,cAAY;IACpB,cAAc,EAAE,cAAmB;IACnC,QAAQ,EAAE,cAAc;IACxB,QAAQ,EAAE,cAAc;IACxB,OAAO,EAAE,eAAa;IACtB,MAAM,EAAE,eAAY;IACpB,eAAe,EAAE,eAAqB;IACtC,YAAY,EAAE,eAAkB;IAChC,KAAK,EAAE,eAAW;CACe,CAAA;AAEnC;;GAEG;AACU,QAAA,kBAAkB,GAAgB,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC,CAEvF,CAAA"}
@@ -1,5 +1,4 @@
1
1
  import { BaseCommand } from '../..';
2
- export declare const ENV_VAR_REGEX: RegExp;
3
2
  /**
4
3
  * Maps Subscription ID to Resource Group to App Service names.
5
4
  */
@@ -26,12 +25,6 @@ export type AasConfigOptions = Partial<{
26
25
  uploadGitMetadata: boolean;
27
26
  extraTags: string;
28
27
  }>;
29
- interface Resource {
30
- subscriptionId: string;
31
- resourceGroup: string;
32
- name: string;
33
- }
34
- export declare const parseResourceId: (resourceId: string) => Resource | undefined;
35
28
  export declare abstract class AasCommand extends BaseCommand {
36
29
  dryRun: boolean;
37
30
  private subscriptionId;
@@ -48,4 +41,3 @@ export declare abstract class AasCommand extends BaseCommand {
48
41
  enableFips(): void;
49
42
  ensureConfig(): Promise<[AasBySubscriptionAndGroup, AasConfigOptions, string[]]>;
50
43
  }
51
- export {};
@@ -9,23 +9,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AasCommand = exports.parseResourceId = exports.ENV_VAR_REGEX = void 0;
12
+ exports.AasCommand = void 0;
13
13
  const clipanion_1 = require("clipanion");
14
14
  const constants_1 = require("../../constants");
15
15
  const env_1 = require("../../helpers/env");
16
16
  const fips_1 = require("../../helpers/fips");
17
17
  const renderer_1 = require("../../helpers/renderer");
18
+ const azure_1 = require("../../helpers/serverless/azure");
19
+ const constants_2 = require("../../helpers/serverless/constants");
20
+ const constants_3 = require("../../helpers/serverless/constants");
18
21
  const utils_1 = require("../../helpers/utils");
19
22
  const __1 = require("../..");
20
- exports.ENV_VAR_REGEX = /^([\w.]+)=(.*)$/;
21
- const parseResourceId = (resourceId) => {
22
- const match = resourceId.match(/^\/subscriptions\/([^/]+)\/resourceGroups\/([^/]+)\/providers\/Microsoft\.Web\/sites\/([^/]+)$/i);
23
- if (match) {
24
- const [, subscriptionId, resourceGroup, name] = match;
25
- return { subscriptionId, resourceGroup, name };
26
- }
27
- };
28
- exports.parseResourceId = parseResourceId;
29
23
  class AasCommand extends __1.BaseCommand {
30
24
  constructor() {
31
25
  var _a, _b;
@@ -82,11 +76,11 @@ class AasCommand extends __1.BaseCommand {
82
76
  errors.push('DD_API_KEY environment variable is required');
83
77
  }
84
78
  // Validate that envVars, if provided, are in the format 'key=value'
85
- if ((_a = config.envVars) === null || _a === void 0 ? void 0 : _a.some((e) => !exports.ENV_VAR_REGEX.test(e))) {
79
+ if ((_a = config.envVars) === null || _a === void 0 ? void 0 : _a.some((e) => !constants_2.ENV_VAR_REGEX.test(e))) {
86
80
  errors.push('All envVars must be in the format `KEY=VALUE`');
87
81
  }
88
82
  // Validate that extraTags, if provided, comply with the expected format
89
- if (config.extraTags && !config.extraTags.match(constants_1.EXTRA_TAGS_REG_EXP)) {
83
+ if (config.extraTags && !config.extraTags.match(constants_3.EXTRA_TAGS_REG_EXP)) {
90
84
  errors.push('Extra tags do not comply with the <key>:<value> array.');
91
85
  }
92
86
  // Validate musl setting
@@ -103,7 +97,7 @@ class AasCommand extends __1.BaseCommand {
103
97
  }
104
98
  if ((_b = this.resourceIds) === null || _b === void 0 ? void 0 : _b.length) {
105
99
  for (const resourceId of this.resourceIds) {
106
- const parsed = (0, exports.parseResourceId)(resourceId);
100
+ const parsed = (0, azure_1.parseResourceId)(resourceId);
107
101
  if (parsed) {
108
102
  const { subscriptionId, resourceGroup, name } = parsed;
109
103
  if (!appServices[subscriptionId]) {
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/commands/aas/common.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAgC;AAEhC,+CAA2F;AAC3F,2CAA2C;AAC3C,6CAA6C;AAC7C,qDAAgD;AAChD,+CAA+E;AAE/E,6BAAiC;AAEpB,QAAA,aAAa,GAAG,iBAAiB,CAAA;AA0CvC,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAwB,EAAE;IAC1E,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAC5B,iGAAiG,CAClG,CAAA;IACD,IAAI,KAAK,EAAE;QACT,MAAM,CAAC,EAAE,cAAc,EAAE,aAAa,EAAE,IAAI,CAAC,GAAG,KAAK,CAAA;QAErD,OAAO,EAAC,cAAc,EAAE,aAAa,EAAE,IAAI,EAAC,CAAA;KAC7C;AACH,CAAC,CAAA;AATY,QAAA,eAAe,mBAS3B;AAED,MAAsB,UAAW,SAAQ,eAAW;IAApD;;;QACS,WAAM,GAAG,kBAAM,CAAC,OAAO,CAAC,cAAc,EAAE,KAAK,EAAE;YACpD,WAAW,EAAE,6DAA6D;SAC3E,CAAC,CAAA;QACM,mBAAc,GAAG,kBAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE;YAC7D,WAAW,EAAE,kDAAkD;SAChE,CAAC,CAAA;QACM,kBAAa,GAAG,kBAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;YAC3D,WAAW,EAAE,6DAA6D;SAC3E,CAAC,CAAA;QACM,YAAO,GAAG,kBAAM,CAAC,MAAM,CAAC,WAAW,EAAE;YAC3C,WAAW,EAAE,6CAA6C;SAC3D,CAAC,CAAA;QACM,gBAAW,GAAG,kBAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE;YACrD,WAAW,EACT,oJAAoJ;SACvJ,CAAC,CAAA;QACM,YAAO,GAAG,kBAAM,C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CAAC,GAAG,EAAE,CAAA;yBACjC;wBACD,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,EAAE;4BAC/C,WAAW,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,CAAA;yBAChD;wBACD,WAAW,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;qBACtD;yBAAM;wBACL,MAAM,CAAC,IAAI,CAAC,4BAA4B,UAAU,EAAE,CAAC,CAAA;qBACtD;iBACF;aACF;YACD,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,MAAM,CAAA,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE;gBACvE,MAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAA;aACvD;YAED,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;;KACrC;CACF;AAhHD,gCAgHC"}
@@ -1,3 +1 @@
1
1
  export declare const SKIP_MASKING_CLOUDRUN_ENV_VARS: Set<string>;
2
- export declare const DEFAULT_SIDECAR_NAME = "datadog-sidecar";
3
- export declare const DEFAULT_VOLUME_NAME = "shared-volume";
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_VOLUME_NAME = exports.DEFAULT_SIDECAR_NAME = exports.SKIP_MASKING_CLOUDRUN_ENV_VARS = void 0;
4
- const constants_1 = require("../../constants");
3
+ exports.SKIP_MASKING_CLOUDRUN_ENV_VARS = void 0;
4
+ const constants_1 = require("../../helpers/serverless/constants");
5
+ const constants_2 = require("../../helpers/serverless/constants");
5
6
  exports.SKIP_MASKING_CLOUDRUN_ENV_VARS = new Set([
6
- constants_1.SITE_ENV_VAR,
7
+ constants_2.SITE_ENV_VAR,
7
8
  constants_1.SERVICE_ENV_VAR,
8
9
  constants_1.ENVIRONMENT_ENV_VAR,
9
10
  'NODE_OPTIONS',
@@ -19,6 +20,4 @@ exports.SKIP_MASKING_CLOUDRUN_ENV_VARS = new Set([
19
20
  'GCP_PUBSUB_PROJECT_ID',
20
21
  'GCP_PUBSUB_SUBSCRIBER_ID',
21
22
  ]);
22
- exports.DEFAULT_SIDECAR_NAME = 'datadog-sidecar';
23
- exports.DEFAULT_VOLUME_NAME = 'shared-volume';
24
23
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/commands/cloud-run/constants.ts"],"names":[],"mappings":";;;AAAA,+CAAkF;AAErE,QAAA,8BAA8B,GAAG,IAAI,GAAG,CAAC;IACpD,wBAAY;IACZ,2BAAe;IACf,+BAAmB;IACnB,cAAc;IACd,4BAA4B;IAC5B,WAAW;IACX,SAAS;IACT,iDAAiD;IACjD,iDAAiD;IACjD,gBAAgB;IAChB,YAAY;IACZ,eAAe;IACf,cAAc;IACd,uBAAuB;IACvB,0BAA0B;CAC3B,CAAC,CAAA;AAEW,QAAA,oBAAoB,GAAG,iBAAiB,CAAA;AACxC,QAAA,mBAAmB,GAAG,eAAe,CAAA"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/commands/cloud-run/constants.ts"],"names":[],"mappings":";;;AAAA,kEAAuF;AACvF,kEAA+D;AAElD,QAAA,8BAA8B,GAAG,IAAI,GAAG,CAAC;IACpD,wBAAY;IACZ,2BAAe;IACf,+BAAmB;IACnB,cAAc;IACd,4BAA4B;IAC5B,WAAW;IACX,SAAS;IACT,iDAAiD;IACjD,iDAAiD;IACjD,gBAAgB;IAChB,YAAY;IACZ,eAAe;IACf,cAAc;IACd,uBAAuB;IACvB,0BAA0B;CAC3B,CAAC,CAAA"}
@@ -12,10 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CloudRunInstrumentCommand = void 0;
13
13
  const clipanion_1 = require("clipanion");
14
14
  const plugin_1 = require("../../helpers/plugin");
15
+ const constants_1 = require("../../helpers/serverless/constants");
15
16
  const __1 = require("../..");
16
- const constants_1 = require("./constants");
17
- const DEFAULT_VOLUME_PATH = '/shared-volume';
18
- const DEFAULT_LOGS_PATH = '/shared-volume/logs/*.log';
19
17
  const DEFAULT_SIDECAR_IMAGE = 'gcr.io/datadoghq/serverless-init:latest';
20
18
  class CloudRunInstrumentCommand extends __1.BaseCommand {
21
19
  constructor() {
@@ -56,11 +54,11 @@ class CloudRunInstrumentCommand extends __1.BaseCommand {
56
54
  this.sharedVolumeName = clipanion_1.Option.String('--shared-volume-name', constants_1.DEFAULT_VOLUME_NAME, {
57
55
  description: `(Not recommended) The name to use for the shared volume. Defaults to '${constants_1.DEFAULT_VOLUME_NAME}'`,
58
56
  });
59
- this.sharedVolumePath = clipanion_1.Option.String('--shared-volume-path', DEFAULT_VOLUME_PATH, {
60
- description: `(Not recommended) The path to use for the shared volume. Defaults to '${DEFAULT_VOLUME_PATH}'`,
57
+ this.sharedVolumePath = clipanion_1.Option.String('--shared-volume-path', constants_1.DEFAULT_VOLUME_PATH, {
58
+ description: `(Not recommended) The path to use for the shared volume. Defaults to '${constants_1.DEFAULT_VOLUME_PATH}'`,
61
59
  });
62
- this.logsPath = clipanion_1.Option.String('--logs-path', DEFAULT_LOGS_PATH, {
63
- description: `(Not recommended) The path to use for the logs. Defaults to '${DEFAULT_LOGS_PATH}'. Must begin with the shared volume path.`,
60
+ this.logsPath = clipanion_1.Option.String('--logs-path', constants_1.DEFAULT_LOGS_PATH, {
61
+ description: `(Not recommended) The path to use for the logs. Defaults to '${constants_1.DEFAULT_LOGS_PATH}'. Must begin with the shared volume path.`,
64
62
  });
65
63
  this.sidecarCpus = clipanion_1.Option.String('--sidecar-cpus', '1', {
66
64
  description: `The number of CPUs to allocate to the sidecar container. Defaults to 1.`,
@@ -1 +1 @@
1
- {"version":3,"file":"instrument.js","sourceRoot":"","sources":["../../../src/commands/cloud-run/instrument.ts"],"names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AM,CAAC,MAAM,CAAC,aAAa,EAAE,6BAAiB,EAAE;YACnE,WAAW,EAAE,gEAAgE,6BAAiB,4CAA4C;SAC3I,CAAC,CAAA;QACQ,gBAAW,GAAG,kBAAM,CAAC,MAAM,CAAC,gBAAgB,EAAE,GAAG,EAAE;YAC3D,WAAW,EAAE,yEAAyE;SACvF,CAAC,CAAA;QACQ,kBAAa,GAAG,kBAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE,OAAO,EAAE;YACnE,WAAW,EAAE,iFAAiF;SAC/F,CAAC,CAAA;QACQ,aAAQ,GAAG,kBAAM,CAAC,MAAM,CAAC,YAAY,EAAE;YAC/C,WAAW,EAAE,0LAA0L;SACxM,CAAC,CAAA;QACQ,SAAI,GAAG,kBAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;QACtC,oBAAe,GAAG,kBAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAA;IAK1E,CAAC;IAHc,OAAO;;YAClB,OAAO,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAA;QACnC,CAAC;KAAA;;AAjEH,8DAkEC;AAjEe,+BAAK,GAAG,CAAC,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC,AAAhC,CAAgC;AAErC,+BAAK,GAAG,mBAAO,CAAC,KAAK,CAAC;IAClC,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,mDAAmD;CACjE,CAAC,AAHiB,CAGjB"}
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CloudRunUninstrumentCommand = void 0;
13
13
  const clipanion_1 = require("clipanion");
14
14
  const plugin_1 = require("../../helpers/plugin");
15
+ const constants_1 = require("../../helpers/serverless/constants");
15
16
  const __1 = require("../..");
16
- const constants_1 = require("./constants");
17
17
  class CloudRunUninstrumentCommand extends __1.BaseCommand {
18
18
  constructor() {
19
19
  super(...arguments);
@@ -1 +1 @@
1
- {"version":3,"file":"uninstrument.js","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AAK,CAAC,CAAA;QACtC,oBAAe,GAAG,kBAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAA;IAK1E,CAAC;IAHc,OAAO;;YAClB,OAAO,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAA;QACnC,CAAC;KAAA;;AAhCH,kEAiCC;AAhCe,iCAAK,GAAG,CAAC,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,AAAlC,CAAkC;AAEvC,iCAAK,GAAG,mBAAO,CAAC,KAAK,CAAC;IAClC,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,oDAAoD;CAClE,CAAC,AAHiB,CAGjB"}
@@ -0,0 +1,3 @@
1
+ import { ContainerAppInstrumentCommand } from './instrument';
2
+ import { ContainerAppUninstrumentCommand } from './uninstrument';
3
+ export declare const commands: (typeof ContainerAppInstrumentCommand | typeof ContainerAppUninstrumentCommand)[];
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.commands = void 0;
4
+ /* eslint-disable import-x/order */
5
+ const instrument_1 = require("./instrument");
6
+ const uninstrument_1 = require("./uninstrument");
7
+ // prettier-ignore
8
+ exports.commands = [
9
+ instrument_1.ContainerAppInstrumentCommand,
10
+ uninstrument_1.ContainerAppUninstrumentCommand,
11
+ ];
12
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/commands/container-app/cli.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,6CAA0D;AAC1D,iDAA8D;AAE9D,kBAAkB;AACL,QAAA,QAAQ,GAAG;IACtB,0CAA6B;IAC7B,8CAA+B;CAChC,CAAA"}
@@ -0,0 +1,42 @@
1
+ import { BaseCommand } from '../..';
2
+ /**
3
+ * Maps Subscription ID to Resource Group to Container App names.
4
+ */
5
+ export type ContainerAppBySubscriptionAndGroup = Record<string, Record<string, string[]>>;
6
+ /**
7
+ * Configuration options provided by the user through
8
+ * the CLI in order to instrument properly.
9
+ */
10
+ export type ContainerAppConfigOptions = Partial<{
11
+ subscriptionId: string;
12
+ resourceGroup: string;
13
+ containerAppName: string;
14
+ resourceIds: string[];
15
+ service: string;
16
+ environment: string;
17
+ version: string;
18
+ sidecarName: string;
19
+ sharedVolumeName: string;
20
+ sharedVolumePath: string;
21
+ logsPath: string;
22
+ envVars: string[];
23
+ sourceCodeIntegration: boolean;
24
+ uploadGitMetadata: boolean;
25
+ extraTags: string;
26
+ }>;
27
+ export declare abstract class ContainerAppCommand extends BaseCommand {
28
+ private subscriptionId;
29
+ private resourceGroup;
30
+ private containerAppName;
31
+ private resourceIds;
32
+ private envVars;
33
+ private configPath;
34
+ dryRun: boolean;
35
+ private fips;
36
+ private fipsIgnoreError;
37
+ private fipsConfig;
38
+ get dryRunPrefix(): string;
39
+ get additionalConfig(): Partial<ContainerAppConfigOptions>;
40
+ enableFips(): void;
41
+ ensureConfig(): Promise<[ContainerAppBySubscriptionAndGroup, ContainerAppConfigOptions, string[]]>;
42
+ }
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContainerAppCommand = void 0;
13
+ const clipanion_1 = require("clipanion");
14
+ const constants_1 = require("../../constants");
15
+ const env_1 = require("../../helpers/env");
16
+ const fips_1 = require("../../helpers/fips");
17
+ const renderer_1 = require("../../helpers/renderer");
18
+ const azure_1 = require("../../helpers/serverless/azure");
19
+ const constants_2 = require("../../helpers/serverless/constants");
20
+ const utils_1 = require("../../helpers/utils");
21
+ const __1 = require("../..");
22
+ class ContainerAppCommand extends __1.BaseCommand {
23
+ constructor() {
24
+ var _a, _b;
25
+ super(...arguments);
26
+ this.subscriptionId = clipanion_1.Option.String('-s,--subscription-id', {
27
+ description: 'Subscription ID of the Azure subscription containing the Container App. Must be used with `--resource-group` and `--name`.',
28
+ });
29
+ this.resourceGroup = clipanion_1.Option.String('-g,--resource-group', {
30
+ description: 'Name of the Azure Resource Group containing the Container App. Must be used with `--subscription-id` and `--name`.',
31
+ });
32
+ this.containerAppName = clipanion_1.Option.String('-n,--name', {
33
+ description: 'Name of the Azure Container App to instrument. Must be used with `--subscription-id` and `--resource-group`.',
34
+ });
35
+ this.resourceIds = clipanion_1.Option.Array('-r,--resource-id', {
36
+ description: 'Full Azure resource ID to instrument. Can be specified multiple times. Format: `/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.App/containerApps/<container-app-name>`.',
37
+ });
38
+ this.envVars = clipanion_1.Option.Array('-e,--env-vars', {
39
+ description: 'Additional environment variables to set for the Container App. Can specify multiple variables in the format `--env-vars VAR1=VALUE1 --env-vars VAR2=VALUE2`.',
40
+ });
41
+ this.configPath = clipanion_1.Option.String('--config', {
42
+ description: 'Path to the configuration file.',
43
+ });
44
+ // eslint-disable-next-line @typescript-eslint/member-ordering -- needed for ordering of arguments in readme
45
+ this.dryRun = clipanion_1.Option.Boolean('-d,--dry-run', false, {
46
+ description: 'Run the command in dry-run mode, without making any changes. Preview the changes that running the command would apply.',
47
+ });
48
+ this.fips = clipanion_1.Option.Boolean('--fips', false);
49
+ this.fipsIgnoreError = clipanion_1.Option.Boolean('--fips-ignore-error', false);
50
+ this.fipsConfig = {
51
+ fips: (_a = (0, env_1.toBoolean)(process.env[constants_1.FIPS_ENV_VAR])) !== null && _a !== void 0 ? _a : false,
52
+ fipsIgnoreError: (_b = (0, env_1.toBoolean)(process.env[constants_1.FIPS_IGNORE_ERROR_ENV_VAR])) !== null && _b !== void 0 ? _b : false,
53
+ };
54
+ }
55
+ get dryRunPrefix() {
56
+ return this.dryRun ? renderer_1.dryRunTag + ' ' : '';
57
+ }
58
+ get additionalConfig() {
59
+ return {};
60
+ }
61
+ enableFips() {
62
+ (0, fips_1.enableFips)(this.fips || this.fipsConfig.fips, this.fipsIgnoreError || this.fipsConfig.fipsIgnoreError);
63
+ }
64
+ ensureConfig() {
65
+ var _a, _b, _c;
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ const config = (yield (0, utils_1.resolveConfigFromFile)({
68
+ containerApp: Object.assign({ subscriptionId: this.subscriptionId, resourceGroup: this.resourceGroup, containerAppName: this.containerAppName, envVars: this.envVars }, this.additionalConfig),
69
+ }, {
70
+ configPath: this.configPath,
71
+ defaultConfigPaths: utils_1.DEFAULT_CONFIG_PATHS,
72
+ })).containerApp;
73
+ const containerApps = {};
74
+ const errors = [];
75
+ if (process.env.DD_API_KEY === undefined) {
76
+ errors.push('DD_API_KEY environment variable is required');
77
+ }
78
+ // Validate that envVars, if provided, are in the format 'key=value'
79
+ if ((_a = config.envVars) === null || _a === void 0 ? void 0 : _a.some((e) => !constants_2.ENV_VAR_REGEX.test(e))) {
80
+ errors.push('All envVars must be in the format `KEY=VALUE`');
81
+ }
82
+ // Validate that extraTags, if provided, comply with the expected format
83
+ if (config.extraTags && !config.extraTags.match(constants_2.EXTRA_TAGS_REG_EXP)) {
84
+ errors.push('Extra tags do not comply with the <key>:<value> array.');
85
+ }
86
+ // Validate that logsPath starts with sharedVolumePath
87
+ if (!config.logsPath || !config.sharedVolumePath) {
88
+ errors.push('logsPath and sharedVolumePath must be non-empty when instance logging is enabled');
89
+ }
90
+ else if (!config.logsPath.startsWith(config.sharedVolumePath)) {
91
+ errors.push('logsPath must start with sharedVolumePath when instance logging is enabled');
92
+ }
93
+ const specifiedAppArgs = [config.subscriptionId, config.resourceGroup, config.containerAppName];
94
+ // all or none of the app args should be specified
95
+ if (!(specifiedAppArgs.every((arg) => arg) || specifiedAppArgs.every((arg) => !arg))) {
96
+ errors.push('--subscription-id, --resource-group, and --name must be specified together or not at all');
97
+ }
98
+ else if (specifiedAppArgs.every((arg) => arg)) {
99
+ containerApps[config.subscriptionId] = { [config.resourceGroup]: [config.containerAppName] };
100
+ }
101
+ if ((_b = this.resourceIds) === null || _b === void 0 ? void 0 : _b.length) {
102
+ for (const resourceId of this.resourceIds) {
103
+ const parsed = (0, azure_1.parseResourceId)(resourceId);
104
+ if (parsed) {
105
+ const { subscriptionId, resourceGroup, name } = parsed;
106
+ if (!containerApps[subscriptionId]) {
107
+ containerApps[subscriptionId] = {};
108
+ }
109
+ if (!containerApps[subscriptionId][resourceGroup]) {
110
+ containerApps[subscriptionId][resourceGroup] = [];
111
+ }
112
+ containerApps[subscriptionId][resourceGroup].push(name);
113
+ }
114
+ else {
115
+ errors.push(`Invalid Container App resource ID: ${resourceId}`);
116
+ }
117
+ }
118
+ }
119
+ if (!((_c = this.resourceIds) === null || _c === void 0 ? void 0 : _c.length) && specifiedAppArgs.every((arg) => !arg)) {
120
+ errors.push('No Container Apps specified to instrument');
121
+ }
122
+ return [containerApps, config, errors];
123
+ });
124
+ }
125
+ }
126
+ exports.ContainerAppCommand = ContainerAppCommand;
127
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/commands/container-app/common.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAgC;AAEhC,+CAAuE;AACvE,2CAA2C;AAC3C,6CAA6C;AAC7C,qDAAgD;AAChD,0DAA8D;AAC9D,kEAAoF;AACpF,+CAA+E;AAE/E,6BAAiC;AAkCjC,MAAsB,mBAAoB,SAAQ,eAAW;IAA7D;;;QACU,mBAAc,GAAG,kBAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE;YAC7D,WAAW,EACT,4HAA4H;SAC/H,CAAC,CAAA;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,cAAc,CAAC,CAAC,aAAa,CAAC,GAAG,EAAE,CAAA;yBAClD;wBACD,aAAa,CAAC,cAAc,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;qBACxD;yBAAM;wBACL,MAAM,CAAC,IAAI,CAAC,sCAAsC,UAAU,EAAE,CAAC,CAAA;qBAChE;iBACF;aACF;YACD,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,MAAM,CAAA,IAAI,gBAAgB,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE;gBACtE,MAAM,CAAC,IAAI,CAAC,2CAA2C,CAAC,CAAA;aACzD;YAED,OAAO,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;;KACvC;CACF;AAtHD,kDAsHC"}
@@ -0,0 +1,17 @@
1
+ import { ContainerAppCommand, ContainerAppConfigOptions } from './common';
2
+ export declare class ContainerAppInstrumentCommand extends ContainerAppCommand {
3
+ static paths: string[][];
4
+ static usage: import("clipanion").Usage;
5
+ private service;
6
+ private environment;
7
+ private version;
8
+ private sidecarName;
9
+ private sharedVolumeName;
10
+ private sharedVolumePath;
11
+ private logsPath;
12
+ private sourceCodeIntegration;
13
+ private uploadGitMetadata;
14
+ private extraTags;
15
+ get additionalConfig(): Partial<ContainerAppConfigOptions>;
16
+ execute(): Promise<number | void>;
17
+ }
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContainerAppInstrumentCommand = void 0;
13
+ const clipanion_1 = require("clipanion");
14
+ const plugin_1 = require("../../helpers/plugin");
15
+ const constants_1 = require("../../helpers/serverless/constants");
16
+ const common_1 = require("./common");
17
+ class ContainerAppInstrumentCommand extends common_1.ContainerAppCommand {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.service = clipanion_1.Option.String('--service', {
21
+ description: 'The value for the service tag. Use this to group related Container Apps belonging to similar workloads. For example, `my-service`. If not provided, the Container App name is used.',
22
+ });
23
+ this.environment = clipanion_1.Option.String('--env,--environment', {
24
+ description: 'The value for the env tag. Use this to separate your staging, development, and production environments. For example, `prod`.',
25
+ });
26
+ this.version = clipanion_1.Option.String('--version', {
27
+ description: 'The value for the version tag. Use this to correlate spikes in latency, load, or errors to new versions. For example, `1.0.0`.',
28
+ });
29
+ this.sidecarName = clipanion_1.Option.String('--sidecar-name', constants_1.DEFAULT_SIDECAR_NAME, {
30
+ description: `(Not recommended) The name to use for the sidecar container. Defaults to '${constants_1.DEFAULT_SIDECAR_NAME}'`,
31
+ });
32
+ this.sharedVolumeName = clipanion_1.Option.String('--shared-volume-name', constants_1.DEFAULT_VOLUME_NAME, {
33
+ description: `(Not recommended) Specify a custom shared volume name. Defaults to '${constants_1.DEFAULT_VOLUME_NAME}'`,
34
+ });
35
+ this.sharedVolumePath = clipanion_1.Option.String('--shared-volume-path', constants_1.DEFAULT_VOLUME_PATH, {
36
+ description: `(Not recommended) Specify a custom shared volume path. Defaults to '${constants_1.DEFAULT_VOLUME_PATH}'`,
37
+ });
38
+ this.logsPath = clipanion_1.Option.String('--logs-path', constants_1.DEFAULT_LOGS_PATH, {
39
+ description: `(Not recommended) Specify a custom log file path. Must begin with the shared volume path. Defaults to '${constants_1.DEFAULT_LOGS_PATH}'`,
40
+ });
41
+ this.sourceCodeIntegration = clipanion_1.Option.Boolean('--source-code-integration,--sourceCodeIntegration', true, {
42
+ description: 'Whether to enable the Datadog Source Code integration. This tags your service(s) with the Git repository and the latest commit hash of the local directory. Specify `--no-source-code-integration` to disable.',
43
+ });
44
+ this.uploadGitMetadata = clipanion_1.Option.Boolean('--upload-git-metadata,--uploadGitMetadata', true, {
45
+ description: "Whether to enable Git metadata uploading, as a part of the source code integration. Git metadata uploading is only required if you don't have the Datadog GitHub integration installed. Specify `--no-upload-git-metadata` to disable.",
46
+ });
47
+ this.extraTags = clipanion_1.Option.String('--extra-tags,--extraTags', {
48
+ description: 'Additional tags to add to the service in the format "key1:value1,key2:value2".',
49
+ });
50
+ }
51
+ get additionalConfig() {
52
+ return {
53
+ service: this.service,
54
+ environment: this.environment,
55
+ version: this.version,
56
+ sidecarName: this.sidecarName,
57
+ sharedVolumeName: this.sharedVolumeName,
58
+ sharedVolumePath: this.sharedVolumePath,
59
+ logsPath: this.logsPath,
60
+ sourceCodeIntegration: this.sourceCodeIntegration,
61
+ uploadGitMetadata: this.uploadGitMetadata,
62
+ extraTags: this.extraTags,
63
+ };
64
+ }
65
+ execute() {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ return (0, plugin_1.executePluginCommand)(this);
68
+ });
69
+ }
70
+ }
71
+ exports.ContainerAppInstrumentCommand = ContainerAppInstrumentCommand;
72
+ ContainerAppInstrumentCommand.paths = [['container-app', 'instrument']];
73
+ ContainerAppInstrumentCommand.usage = clipanion_1.Command.Usage({
74
+ category: 'Serverless',
75
+ description: 'Apply Datadog instrumentation to an Azure Container App.',
76
+ });
77
+ //# sourceMappingURL=instrument.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instrument.js","sourceRoot":"","sources":["../../../src/commands/container-app/instrument.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAyC;AAEzC,iDAAyD;AACzD,kEAK2C;AAE3C,qCAAuE;AAEvE,MAAa,6BAA8B,SAAQ,4BAAmB;IAAtE;;QAOU,YAAO,GAAG,kBAAM,CAAC,MAA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,IAAI,CAAC,WAAW;YAC7B,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;YACvC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;YACjD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;YACzC,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAA;IACH,CAAC;IAEY,OAAO;;YAClB,OAAO,IAAA,6BAAoB,EAAC,IAAI,CAAC,CAAA;QACnC,CAAC;KAAA;;AA/DH,sEAgEC;AA/De,mCAAK,GAAG,CAAC,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,AAApC,CAAoC;AACzC,mCAAK,GAAG,mBAAO,CAAC,KAAK,CAAC;IAClC,QAAQ,EAAE,YAAY;IACtB,WAAW,EAAE,0DAA0D;CACxE,CAAC,AAHiB,CAGjB"}
@@ -0,0 +1,10 @@
1
+ import { ContainerAppCommand, ContainerAppConfigOptions, ContainerAppBySubscriptionAndGroup } from './common';
2
+ export declare class ContainerAppUninstrumentCommand extends ContainerAppCommand {
3
+ static paths: string[][];
4
+ static usage: import("clipanion").Usage;
5
+ private sidecarName;
6
+ private sharedVolumeName;
7
+ get additionalConfig(): Partial<ContainerAppConfigOptions>;
8
+ ensureConfig(): Promise<[ContainerAppBySubscriptionAndGroup, ContainerAppConfigOptions, string[]]>;
9
+ execute(): Promise<number | void>;
10
+ }