diff --git a/src/sentry/monitors/validators.py b/src/sentry/monitors/validators.py index a5dc3a9d5ea7a8..35d92505b07861 100644 --- a/src/sentry/monitors/validators.py +++ b/src/sentry/monitors/validators.py @@ -230,10 +230,13 @@ def validate(self, attrs): return attrs -@extend_schema_serializer(exclude_fields=["project", "name", "slug", "config", "alert_rule"]) +@extend_schema_serializer(exclude_fields=["project", "config", "alert_rule"]) class MonitorValidator(CamelSnakeSerializer, PreventNumericSlugMixin): project = ProjectField(scope="project:read") - name = serializers.CharField(max_length=128) + name = serializers.CharField( + max_length=128, + help_text="Name of the monitor. Used for notifications.", + ) slug = serializers.RegexField( DEFAULT_SLUG_PATTERN, max_length=MAX_SLUG_LENGTH, @@ -241,10 +244,12 @@ class MonitorValidator(CamelSnakeSerializer, PreventNumericSlugMixin): error_messages={ "invalid": DEFAULT_SLUG_ERROR_MESSAGE, }, + help_text="Uniquely identifies your monitor within your organization. Changing this slug will require updates to any instrumented check-in calls.", ) status = serializers.ChoiceField( choices=list(zip(MONITOR_STATUSES.keys(), MONITOR_STATUSES.keys())), default="active", + help_text="Status of the monitor. Disabled monitors do not generate events or notifications.", ) type = serializers.ChoiceField(choices=list(zip(MONITOR_TYPES.keys(), MONITOR_TYPES.keys()))) config = ConfigValidator() @@ -288,22 +293,28 @@ class ContextsValidator(serializers.Serializer): trace = TraceContextValidator(required=False) -@extend_schema_serializer(exclude_fields=["duration", "environment", "monitor_config", "contexts"]) +@extend_schema_serializer(exclude_fields=["monitor_config", "contexts"]) class MonitorCheckInValidator(serializers.Serializer): status = serializers.ChoiceField( choices=( ("ok", CheckInStatus.OK), ("error", CheckInStatus.ERROR), ("in_progress", CheckInStatus.IN_PROGRESS), - ) + ), + help_text="The status of the job run.", ) duration = EmptyIntegerField( required=False, allow_null=True, max_value=BoundedPositiveIntegerField.MAX_VALUE, min_value=0, + help_text="Duration of the job run, in milliseconds.", + ) + environment = serializers.CharField( + required=False, + allow_null=True, + help_text="Name of the environment.", ) - environment = serializers.CharField(required=False, allow_null=True) monitor_config = ConfigValidator(required=False) contexts = ContextsValidator(required=False, allow_null=True)