Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add warnings for silent failures during lightweight synthetics pushes #976

Closed
Spoonsk opened this issue Oct 31, 2024 · 0 comments · Fixed by #977
Closed

Add warnings for silent failures during lightweight synthetics pushes #976

Spoonsk opened this issue Oct 31, 2024 · 0 comments · Fixed by #977
Labels
enhancement New feature or request

Comments

@Spoonsk
Copy link
Contributor

Spoonsk commented Oct 31, 2024

When the push process encounters a lightweight synthetic .yml file with an unexpected encoding it will fail to parse the heartbeat.monitors sequence and fail silently. There should be a warning for when a lightweight synthetic monitor file is encoded wrong and will be ignored. See code below with continue statement.

 const content = await (0, promises_1.readFile)(file, 'utf-8');
        const lineCounter = new yaml_1.LineCounter();
        const parsedDoc = (0, yaml_1.parseDocument)(content, {
            lineCounter,
            merge: true,
            keepSourceTokens: true,
        });
        // Skip other yml files that are not relevant
        const monitorSeq = parsedDoc.get('heartbeat.monitors');
        if (!monitorSeq) {
            continue;
        }

Ideally there would be a warning letting the user know that their project contains files that may not be processed due to encoding issues.

Another useful warning would be one for users (like myself) who converted from using heartbeat to using synthetics. Heartbeat supported browser type monitors, and synthetics does not (makes sense because people should be using journeys. The issue is that browser type monitors are simply ignored (see code below). There should be a warning if a browser type monitor is detected in a file. Especially since the current behavior is to simply ignore them and not produce an error.

            const monitor = mergedConfig[i];
            // Skip browser monitors from the YML files
            if (monitor['type'] === 'browser') {
                continue;
            }

As a user of elastic, my team encountered these silent ignores and it took us a significant amount of time engaged with elastic support to identify and fix the problem (support case 01774618). If these warnings were in place, then we would have been able to identify the problem much sooner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants