Skip to content

Commit

Permalink
Logging heartbeat creation/update
Browse files Browse the repository at this point in the history
  • Loading branch information
icaliskanoglu committed Dec 21, 2023
1 parent 82f7f6b commit d014f90
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/heartbeat/heartbeat.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func (h *HeartbeatConfig) CreateOrUpdate() {
exist := h.IsExist()
createUpdate := "create"
if !exist {
log.WithField("HeartbeatName", h.Name).Info("Creating heartbeat!")
b, err := json.Marshal(h.Heartbeat)
if err != nil {
log.WithField("Heartbeat", h.Heartbeat).Panicf("Could not marshall heartbeat!")
Expand All @@ -57,6 +58,7 @@ func (h *HeartbeatConfig) CreateOrUpdate() {
url := fmt.Sprintf("%s/v2/heartbeats", h.BaseUrl)
request = mustCreateRequest("POST", url, requestBody)
} else {
log.WithField("HeartbeatName", h.Name).Info("Updating heartbeat!")
b, err := json.Marshal(h.Heartbeat.HeartbeatCore)
if err != nil {
log.WithField("Heartbeat", h.Heartbeat).Panicf("Could not marshall heartbeat!")
Expand Down

0 comments on commit d014f90

Please sign in to comment.