From e4f9928bef89e01436368482ba24d9c38ac2e9b1 Mon Sep 17 00:00:00 2001 From: Savannah Manning Date: Wed, 11 Dec 2024 13:48:40 +0100 Subject: [PATCH] inital addition of behaviour --- lib/sentry/check_in.ex | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/lib/sentry/check_in.ex b/lib/sentry/check_in.ex index f17db67f..f3f31b0b 100644 --- a/lib/sentry/check_in.ex +++ b/lib/sentry/check_in.ex @@ -19,6 +19,13 @@ defmodule Sentry.CheckIn do alias Sentry.{Config, Interfaces, UUID} + @doc """ + The `sentry_check_in_configuration/1` function is called to set a specific config per check-in job. + See the `monitor_config` type to see the available configuration options + + """ + @callback sentry_check_in_configuration(options_to_merge :: term()) :: monitor_config() + @typedoc """ The possible status of the check-in. """ @@ -50,18 +57,23 @@ defmodule Sentry.CheckIn do duration: float() | nil, release: String.t() | nil, environment: String.t() | nil, - monitor_config: - nil - | %{ - required(:schedule) => monitor_config_schedule(), - optional(:checkin_margin) => number(), - optional(:max_runtime) => number(), - optional(:failure_issue_threshold) => number(), - optional(:recovery_threshold) => number(), - optional(:timezone) => String.t() - }, + monitor_config: monitor_config(), contexts: Interfaces.context() } + @typedoc """ + The type for the monitor_config. + """ + + @type monitor_config() :: + nil + | %{ + required(:schedule) => monitor_config_schedule(), + optional(:checkin_margin) => number(), + optional(:max_runtime) => number(), + optional(:failure_issue_threshold) => number(), + optional(:recovery_threshold) => number(), + optional(:timezone) => String.t() + } @enforce_keys [ :check_in_id,