Skip to content

Flagger Datadog Provider Multiplies Interval by 10x #1820

@GurayCetin

Description

@GurayCetin

Problem

When I set a metric interval to 1m, Flagger checks metrics from 10 minutes ago instead of 1 minute ago.
When I set a metric interval to 3m, Flagger checks metrics from 30 minutes ago instead of 3 minutes ago.

Why This Is a Problem

  • My canary analysis uses old data instead of recent data
  • I can't catch problems quickly because Flagger is looking at old metrics

The Bug in the Code

I found the problem in Flagger's source code. In the file pkg/metrics/providers/datadog.go, there's this line:

datadogFromDeltaMultiplierOnMetricInterval = 10  // ← This is the bug!

This number 10 gets multiplied with my interval setting. So when I set 1m, it becomes 10m.

Here's the code that does it:

// This takes my interval (like "1m") and multiplies it by 10
dd.fromDelta = int64(datadogFromDeltaMultiplierOnMetricInterval * md.Seconds())

The fix is simple: Change that 10 to 1 (or remove the multiplication completely).

Temporary Fix

Right now, I have to set my interval to 1/10th of what I want:

  • Want 1 minute? Set 6s
  • Want 3 minutes? Set 18s

But this is confusing and hard to remember.

My Setup

  • Flagger version: 1.41.0
  • Using Datadog provider
  • Running on GKE with Istio

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions