Skip to content

Commit

Permalink
chore: add some logging
Browse files Browse the repository at this point in the history
  • Loading branch information
iamKunalGupta committed Dec 3, 2024
1 parent 1f07e7b commit ed229f0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flow/activities/flowable.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ func (a *FlowableActivity) RecordSlotSizes(ctx context.Context) error {

slotMetricGauges := otel_metrics.SlotMetricGauges{}
if a.OtelManager != nil {
// TODO remove this post testing
logger.Info("Setting up slot metric gauges for otel")
slotLagGauge, err := a.OtelManager.GetOrInitFloat64Gauge(
otel_metrics.BuildMetricName(otel_metrics.SlotLagGaugeName),
metric.WithUnit("MiBy"),
Expand Down
1 change: 1 addition & 0 deletions flow/cmd/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ func WorkerSetup(opts *WorkerSetupOptions) (*workerSetupResponse, error) {

var otelManager *otel_metrics.OtelManager
if opts.EnableOtelMetrics {
slog.Info("Setting up OpenTelemetry metrics provider")
otelManager, err = otel_metrics.NewOtelManager()
if err != nil {
return nil, fmt.Errorf("unable to create otel manager: %w", err)
Expand Down
1 change: 1 addition & 0 deletions flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,7 @@ func (c *PostgresConnector) HandleSlotInfo(
alerter.AlertIfSlotLag(ctx, alertKeys, slotInfo[0])

if slotMetricGauges.SlotLagGauge != nil {
logger.Info("Recording slot lag for otel", slog.Float64("LagInMB", float64(slotInfo[0].LagInMb)))
slotMetricGauges.SlotLagGauge.Record(ctx, float64(slotInfo[0].LagInMb), metric.WithAttributeSet(attribute.NewSet(
attribute.String(otel_metrics.FlowNameKey, alertKeys.FlowName),
attribute.String(otel_metrics.PeerNameKey, alertKeys.PeerName),
Expand Down

0 comments on commit ed229f0

Please sign in to comment.