Skip to content

Commit 650777e

Browse files
authored
meta(crons): Update API help text (#58048)
Updates API help text for Crons validators
1 parent 6028542 commit 650777e

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/sentry/monitors/validators.py

+16-5
Original file line numberDiff line numberDiff line change
@@ -230,21 +230,26 @@ def validate(self, attrs):
230230
return attrs
231231

232232

233-
@extend_schema_serializer(exclude_fields=["project", "name", "slug", "config", "alert_rule"])
233+
@extend_schema_serializer(exclude_fields=["project", "config", "alert_rule"])
234234
class MonitorValidator(CamelSnakeSerializer, PreventNumericSlugMixin):
235235
project = ProjectField(scope="project:read")
236-
name = serializers.CharField(max_length=128)
236+
name = serializers.CharField(
237+
max_length=128,
238+
help_text="Name of the monitor. Used for notifications.",
239+
)
237240
slug = serializers.RegexField(
238241
DEFAULT_SLUG_PATTERN,
239242
max_length=MAX_SLUG_LENGTH,
240243
required=False,
241244
error_messages={
242245
"invalid": DEFAULT_SLUG_ERROR_MESSAGE,
243246
},
247+
help_text="Uniquely identifies your monitor within your organization. Changing this slug will require updates to any instrumented check-in calls.",
244248
)
245249
status = serializers.ChoiceField(
246250
choices=list(zip(MONITOR_STATUSES.keys(), MONITOR_STATUSES.keys())),
247251
default="active",
252+
help_text="Status of the monitor. Disabled monitors do not generate events or notifications.",
248253
)
249254
type = serializers.ChoiceField(choices=list(zip(MONITOR_TYPES.keys(), MONITOR_TYPES.keys())))
250255
config = ConfigValidator()
@@ -288,22 +293,28 @@ class ContextsValidator(serializers.Serializer):
288293
trace = TraceContextValidator(required=False)
289294

290295

291-
@extend_schema_serializer(exclude_fields=["duration", "environment", "monitor_config", "contexts"])
296+
@extend_schema_serializer(exclude_fields=["monitor_config", "contexts"])
292297
class MonitorCheckInValidator(serializers.Serializer):
293298
status = serializers.ChoiceField(
294299
choices=(
295300
("ok", CheckInStatus.OK),
296301
("error", CheckInStatus.ERROR),
297302
("in_progress", CheckInStatus.IN_PROGRESS),
298-
)
303+
),
304+
help_text="The status of the job run.",
299305
)
300306
duration = EmptyIntegerField(
301307
required=False,
302308
allow_null=True,
303309
max_value=BoundedPositiveIntegerField.MAX_VALUE,
304310
min_value=0,
311+
help_text="Duration of the job run, in milliseconds.",
312+
)
313+
environment = serializers.CharField(
314+
required=False,
315+
allow_null=True,
316+
help_text="Name of the environment.",
305317
)
306-
environment = serializers.CharField(required=False, allow_null=True)
307318
monitor_config = ConfigValidator(required=False)
308319
contexts = ContextsValidator(required=False, allow_null=True)
309320

0 commit comments

Comments
 (0)