Skip to content

The failure_issue_threshold does not take effect #12217

Closed

Description

@WesCossick

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/node

SDK Version

8.4.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

const sentryConfig: Sentry.NodeOptions = {
	debug: false,
	normalizeDepth: 0,
	maxValueLength: 1000,
	tracePropagationTargets: ['NONE'],
	dsn: process.env.SENTRY_DSN,
	environment: process.env.ENVIRONMENT,
	beforeSend: (sentryEvent) => {
		console.error(`Reporting to Sentry: ${sentryEvent.event_id ?? 'undefined'}`);
		return sentryEvent;
	},
};

if (process.env.RELEASE && process.env.RELEASE !== 'N/A') {
	sentryConfig.release = process.env.RELEASE;
}

Sentry.init(sentryConfig);

Steps to Reproduce

Call Sentry.captureCheckIn() with a failure_issue_threshold value:

Sentry.captureCheckIn(
	{
		monitorSlug: 'example-cron',
		status: 'in_progress',
	},
	{
		schedule: {
			type: 'crontab',
			value: '* * * * *',
		},
		timezone: 'UTC',
		checkinMargin: 3,
		maxRuntime: 10,
		failure_issue_threshold: 2,
	}
);

The failure_issue_threshold is documented as an acceptable key in the TypeScript types:

failure_issue_threshold?: number;
.

Expected Result

I would expect the failure issue threshold to be 2.

On a side note, I would expect the failure_issue_threshold key to be named failureIssueThreshold instead, to be consistent with the other keys, like checkinMargin and maxRuntime.

Actual Result

The "failure tolerance" setting in the UI remains 1 (the default):

Screenshot 2024-05-24 at 9 45 20 AM

I suspect this issue might also affect the recovery_threshold value, but I haven't tested it.

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 24, 2024
  2. AbhiPrasad commented on May 24, 2024

    @AbhiPrasad
    Contributor

    @WesCossick - we aren't passing this in properly 🤦

    I'll make a PR to fix this! Sorry for the trouble - thank you for reporting!

  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on May 24, 2024
  4. self-assigned this
    on May 24, 2024
  5. AbhiPrasad commented on May 27, 2024

    @AbhiPrasad
    Contributor

    Opened #12248 to fix, and getsentry/sentry-docs#10168 to document this.

  6. AbhiPrasad commented on May 29, 2024

    @AbhiPrasad
    Contributor

    Fix released with https://github.com/getsentry/sentry-javascript/releases/tag/8.7.0!

    New options:

    failureIssueThreshold:

    requires SDK version 8.7.0 or higher

    The number of consecutive failed check-ins required before an issue can be created. Optional.

    recoveryThreshold:

    requires SDK version 8.7.0 or higher

    The number of consecutive successful check-ins required for an issue to be considered resolved. Optional.

  7. WesCossick commented on May 29, 2024

    @WesCossick
    Author

    Thanks for the quick fix!

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions