Skip to content

Commit

Permalink
feat: initial implementation of datadog.go
Browse files Browse the repository at this point in the history
Signed-off-by: Sudipto Baral <[email protected]>
  • Loading branch information
sudiptob2 committed Feb 28, 2023
1 parent d77df88 commit 97e00a6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions operator/controllers/common/providers/datadog/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type KeptnDataDogProvider struct {
}

func (k KeptnDataDogProvider) EvaluateQuery(ctx context.Context, objective klcv1alpha2.Objective, provider klcv1alpha2.KeptnEvaluationProvider) (string, []byte, error) {
ctx, cancel := context.WithTimeout(ctx, 60*time.Second)
ctx, cancel := context.WithTimeout(ctx, 20*time.Second)
defer cancel()

// TODO: get DD_API_KEY and DD_APP_KEY from kubernetes secret
Expand All @@ -37,7 +37,6 @@ func (k KeptnDataDogProvider) EvaluateQuery(ctx context.Context, objective klcv1
},
},
)

fromTime := time.Now().AddDate(0, 0, -1)
queryTime := time.Now()

Expand All @@ -62,5 +61,4 @@ func (k KeptnDataDogProvider) EvaluateQuery(ctx context.Context, objective klcv1
points := (resp.Series)[0].Pointlist
value := strconv.FormatFloat(*points[len(points)-1][1], 'g', 5, 64)
return value, []byte(value), nil

}

0 comments on commit 97e00a6

Please sign in to comment.