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

[WIP] Support Public API for Monitor Config #833

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions lib/sentry/check_in.ex
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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,
Expand Down
Loading