Skip to content

Export command for smart alerts - #87

Merged
disha-148 merged 2 commits into
instana:mainfrom
disha-148:INSTA_71671_Smart_Alerts
Feb 13, 2026
Merged

Export command for smart alerts#87
disha-148 merged 2 commits into
instana:mainfrom
disha-148:INSTA_71671_Smart_Alerts

Conversation

@disha-148

Copy link
Copy Markdown
Collaborator

Export command for smart alerts

if (jsonFiles.length > 0) {
logger.error(`Cannot export: folder contains existing JSON files.`);
logger.info(`The export directory must not contain any JSON files in dashboards/, events/, or entities/ folders.`);
logger.info(`The export directory must not contain any JSON files in dashboards/, events/, or entities/ or smart-alerts/ folders.`);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe it's better to reuse and expand the foldersToCheck here, so that you don't have to add these literally.

// Dashboard export
if (parsedIncludes.some(inc => inc.type === "dashboard" || inc.type === "all")) {
const allDashboards = await getDashboardList(server, token, axiosInstance);
const allDashboards = await fetchDashboard(server, token, axiosInstance);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would it be better to name it as fetchDashboards? Same applies to fetchEvent, fetchEntity, and fetchSmartAlert.

@morningspace morningspace left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@disha-148
disha-148 merged commit 3b32943 into instana:main Feb 13, 2026
1 check passed
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