Skip to content

empty cron check-in should send empy UUID (0000...0000) #1024

Closed
@evanpurkhiser

Description

@evanpurkhiser

How do you use Sentry?

Sentry SaaS (sentry.io)

SDK version

0.330

Go version

No response

Are you using Go Modules?

yes

Steps to reproduce

sentry-go/client.go

Lines 572 to 577 in 5af1e59

var checkInID EventID
if checkIn.ID == "" {
checkInID = EventID(uuid())
} else {
checkInID = checkIn.ID
}

This is generating a new UUID when the ID is not specified. This means you cannot use the Go SDK to do check-ins without a check-in ID, which is a supported case.

// 🟡 Notify Sentry your job is running:
sentry.CaptureCheckIn(
  &sentry.CheckIn{
    MonitorSlug: "<monitor-slug>",
    Status:      sentry.CheckInStatusInProgress,
  },
  monitorConfig,
)

// Execute your scheduled task here...

// 🟢 Notify Sentry your job has completed successfully:
sentry.CaptureCheckIn(
  &sentry.CheckIn{
    MonitorSlug: "<monitor-slug>",
    Status:      sentry.CheckInStatusOK,
  },
  monitorConfig,
)

This code should work and it should send 00000000-0000-0000-0000-000000000000 as the check_in_id as documented here https://develop.sentry.dev/sdk/telemetry/check-ins/#cron-monitor-check-in-payload

This may be provided as a empty UUID (128 bit zero value) to indicate to Sentry that the checkin should update the most recent "in_progress" check-in. If the most recent check-in is not in progress a new one will be created instead.

Expected result

00000000-0000-0000-0000-000000000000 is sent as the check_in_id when not specified

Actual result

A new GUID is generated when when no check_in_id is specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIssue typeGoSDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions