Skip to content

Feature/config manager push telemetry - #122

Open
dallinjsevy wants to merge 6 commits into
mainfrom
feature/config-manager-push-telemetry
Open

Feature/config manager push telemetry#122
dallinjsevy wants to merge 6 commits into
mainfrom
feature/config-manager-push-telemetry

Conversation

@dallinjsevy

Copy link
Copy Markdown

No description provided.

@dallinjsevy
dallinjsevy requested a review from phalestrivir July 22, 2026 14:33

@phalestrivir phalestrivir left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You may want to wait until the ESV variables PR is in that adds the global flags you need to make the changes for this PR (since you will need them)

Comment thread src/cli/config-manager/config-manager-push/config-manager-push-telemetry.ts Outdated
Comment thread src/cli/config-manager/config-manager-push/config-manager-push-telemetry.ts Outdated
Comment thread src/cli/config-manager/config-manager-push/config-manager-push-telemetry.ts Outdated
Comment thread src/configManagerOps/FrConfigTelemetry.ts
Comment thread test/e2e/config-manager-push-telemetry.test.js Outdated
Comment thread test/e2e/config-manager-push-telemetry.test.js Outdated
Comment thread test/e2e/config-manager-push-telemetry.test.js Outdated
/*
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo config-manager push telemetry -c otlp -N datadog -e test-value -D test/e2e/exports/fr-config-manager/cloud
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo config-manager push telemetry -D test/e2e/exports/fr-config-manager/cloud
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Add another test for importing using only the -c flag (no -n flag), and have it import the splunk configuration that you add in so we can also test importing splunk.

@dallinjsevy
dallinjsevy force-pushed the feature/config-manager-push-telemetry branch from 927a373 to 2c24ca1 Compare August 19, 2026 21:50
Comment on lines +8 to +14
const { CLOUD_DEPLOYMENT_TYPE_KEY, FORGEOPS_DEPLOYMENT_TYPE_KEY } =
frodo.utils.constants;

const deploymentTypes = [
CLOUD_DEPLOYMENT_TYPE_KEY,
FORGEOPS_DEPLOYMENT_TYPE_KEY,
];

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remove Forgeops deployment type

return false;
}

export async function configManagerImportTelemetry(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing function comment

command
);

const getTokensIsSuccessful = await getTokens(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing check before this. Need to ensure category is provided if name is also provided:

if (options.name && !options.category) {
  printMessage(
    'Named telemetry config requires category (e.g. --category otlp)',
    'error'
  );
  process.exitCode = 1;
  program.help();
}

Comment on lines +83 to +87
const importData: TelemetryExportInterface = {
telemetry: Object.fromEntries(
categories.map((cat) => [cat, []])
) as TelemetryExportInterface['telemetry'],
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would change this to:

const importData = {
  telemetry: Object.fromEntries(
    categories.map((cat) => [cat, []])
  ),
} as TelemetryExportInterface;

I think that will fix the type issues while being a big more readable.

.filter((f) => !name || f === `${name}.json`);
for (const file of files) {
const filePath = `${catDir}/${file}`;
const provider = readJsonFile(filePath) as any;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would change any to LogExporterSkeleton

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would delete this one. I think we should only have one otlp test file

*/

/*
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo config-manager push telemetry -n test-otlp -E TELEMETRY_HEADER_OTLP_TEST_OTLP_API_KEY=test-value -E TELEMETRY_HEADER_OTLP_TEST_OTLP_API_SECRET=test-value -D test/e2e/exports/fr-config-manager/cloud

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This one needs -n to become -c, since -n by itself shouldn't work


/*
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo config-manager push telemetry -n test-otlp -E TELEMETRY_HEADER_OTLP_TEST_OTLP_API_KEY=test-value -E TELEMETRY_HEADER_OTLP_TEST_OTLP_API_SECRET=test-value -D test/e2e/exports/fr-config-manager/cloud
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo config-manager push telemetry -c otlp -n datadog -E TELEMETRY_HEADER_OTLP_DATADOG_DD_API_KEY=test-value -D test/e2e/exports/fr-config-manager/cloud

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Change -n datadog to -n test-otlp since we are going to get rid of the datadog one

FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo config-manager push telemetry -c otlp -n datadog -E TELEMETRY_HEADER_OTLP_DATADOG_DD_API_KEY=test-value -D test/e2e/exports/fr-config-manager/cloud
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo config-manager push telemetry -c splunk -n test -D test/e2e/exports/fr-config-manager/cloud
FRODO_MOCK=record FRODO_NO_CACHE=1 FRODO_HOST=https://openam-frodo-dev.forgeblocks.com/am frodo config-manager push telemetry -c splunk -D test/e2e/exports/fr-config-manager/cloud
*/

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We should add one more test where you import everything with just -D. This is the only test we should expect to have fail (because it will be importing multiple exporters which isn't allowed), all other tests should succeed

Comment on lines +67 to +86
describe('frodo config-manager push telemetry', () => {
test(`"frodo config-manager push telemetry -n test-otlp -E TELEMETRY_HEADER_OTLP_TEST_OTLP_API_KEY=test-value -E TELEMETRY_HEADER_OTLP_TEST_OTLP_API_SECRET=test-value -D ${telemetryDir}": should push telemetry to cloud`, async () => {
const CMD = `frodo config-manager push telemetry -n test-otlp -E TELEMETRY_HEADER_OTLP_TEST_OTLP_API_KEY=test-value -E TELEMETRY_HEADER_OTLP_TEST_OTLP_API_SECRET=test-value -D ${telemetryDir}`;
await testSuccess(CMD, env);
});

test(`"frodo config-manager push telemetry -c otlp -n datadog -E TELEMETRY_HEADER_OTLP_DATADOG_DD_API_KEY=test-value -D ${telemetryDir}": should fail to import otlp telemetry`, async () => {
const CMD = `frodo config-manager push telemetry -c otlp -n datadog -E TELEMETRY_HEADER_OTLP_DATADOG_DD_API_KEY=test-value -D ${telemetryDir}`;
await testFail(CMD, env);
});

test(`"frodo config-manager push telemetry -c splunk -n test -D ${telemetryDir}": should fail to import splunk telemetry`, async () => {
const CMD = `frodo config-manager push telemetry -c splunk -n test -D ${telemetryDir}`;
await testFail(CMD, env);
});

test(`"frodo config-manager push telemetry -c splunk -D ${telemetryDir}": should fail to import splunk telemetry`, async () => {
const CMD = `frodo config-manager push telemetry -c splunk -D ${telemetryDir}`;
await testSuccess(CMD, env);
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Make sure to update the test descriptions accordingly after you make the changes I suggested.

@phalestrivir

phalestrivir commented Aug 20, 2026

Copy link
Copy Markdown

Also, ensure that the config import and config export tests are passing, since I updated the library to include telemetry in the full export/import. You don't need to re-record those tests, you can just add the network calls to the mock recordings that are missing (the ones for telemetry) and then they should pass again (although you may need to still run update to update the snapshots). You can find those mock requests from the mock recordings for your config-manager push/pull test mocks. Let me know if you have questions on how to do this, but we don't want to re-record those because we don't want to break anything in the tenant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants