Skip to content

Commit

Permalink
refactor: Added warning about dev mode (#11975)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danwakeem authored and medikoo committed May 17, 2023
1 parent 419ca04 commit e5cb8ac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/cli/interactive-setup/console-dev-mode-feed.js
Expand Up @@ -160,7 +160,8 @@ const connectToWebSocket = async ({ functionName, region, accountId, org, state
const uiLink = `${frontend}/${org.orgName}/dev-mode?devModeCloudAccountId=${accountId}&${functionNameQueryParams}`;
writeText(
style.aside(
'\n• Use the `--verbose` flag to see inputs and outputs of all requests (e.g. DynamoDB inputs/outputs).',
'\n• WARNING: Dev mode will not sample traces. This can lean to console usage being higher than expected.',
'• Use the `--verbose` flag to see inputs and outputs of all requests (e.g. DynamoDB inputs/outputs).',
`• Use the Console Dev Mode UI for deeper inspection: ${uiLink}\n`,
'Waiting for activity... Invoke your functions now.'
)
Expand Down
12 changes: 10 additions & 2 deletions lib/cli/interactive-setup/console-enable-dev-mode.js
Expand Up @@ -71,12 +71,18 @@ const checkInstrumentationStatus = async (context) => {
};
};

const headerMessage = 'Instrumenting functions';
const warningMessage =
'WARNING: Dev mode will not sample traces. This can lean to console usage being higher than expected.';

const waitForInstrumentation = async (context) => {
const instrumentationProgress = progress.get(progressKey);
let isInstrumenting = true;
while (isInstrumenting) {
const { isInstrumented: done, total, instrumented } = await checkInstrumentationStatus(context);
instrumentationProgress.update(`Instrumenting ${instrumented}/${total} functions`);
instrumentationProgress.update(
`${headerMessage}\n${warningMessage}\nInstrumenting ${instrumented}/${total} functions`
);
if (done) {
isInstrumenting = false;
} else {
Expand Down Expand Up @@ -162,7 +168,9 @@ module.exports = {

async run(context) {
const instrumentationProgress = progress.get(progressKey);
instrumentationProgress.notice('Instrumenting functions', 'This may take a few minutes...');
instrumentationProgress.notice(
`${headerMessage}\n${warningMessage}\nThis may take a few minutes...`
);
// Chunk targetInstrumentations into 50 resources per request
const distributeArrayBy50 = (array) => {
const result = [];
Expand Down

0 comments on commit e5cb8ac

Please sign in to comment.