Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add datadog metrics provider #460

Merged
merged 1 commit into from
Feb 27, 2020
Merged

feature: add datadog metrics provider #460

merged 1 commit into from
Feb 27, 2020

Conversation

mathetake
Copy link
Collaborator

@mathetake mathetake commented Feb 27, 2020

resolves #284


this PR adds an implmentation of metrics provider interface for datadog

references

related issues

TODOs

  • test functions against an actual dd account
  • e2e test against an actual dd account

example yamls

MetricTemplate

apiVersion: flagger.app/v1alpha1
kind: MetricTemplate
metadata:
  name: status-404-rate-on-datadog
spec:
  provider:
    type: datadog
    secretRef:
      name: datadog
    address: https://api.datadoghq.com
  query: |
    100 - (
      sum:istio.mesh.request.count{reporter:destination,destination_workload_namespace:{{ namespace }},destination_workload:{{ target }},!response_code:404}.as_count()
      / sum:istio.mesh.request.count{reporter:destination,destination_workload_namespace:{{ namespace }},destination_workload:{{ target }}}.as_count()
    ) * 100

Secret

apiVersion: v1
data:
  datadog_api_key: your-datadog-api-key
  datadog_application_key: your-datadog-application-key
kind: Secret
metadata:
  name: datadog

Canary

apiVersion: flagger.app/v1alpha3
kind: Canary
metadata:
  name: hello
  namespace: default
spec:
  canaryAnalysis:
    interval: 5s
    maxWeight: 50
    metrics:
      - interval: 30s
        name: datadog
        threshold: 99
        templateRef:
          name: status-404-rate-on-datadog
    stepWeight: 10
    threshold: 3
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: hello
....

pkg/metrics/providers/datadog.go Outdated Show resolved Hide resolved
pkg/controller/scheduler.go Outdated Show resolved Hide resolved
pkg/metrics/providers/datadog.go Outdated Show resolved Hide resolved
pkg/metrics/providers/datadog.go Outdated Show resolved Hide resolved
implement metrics provider interface for datadog, tested against
the actual datadog account

resolves #284
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @mathetake

stefanprodan added a commit that referenced this pull request Feb 27, 2020
stefanprodan added a commit that referenced this pull request Feb 27, 2020
@stefanprodan stefanprodan merged commit c17c69e into fluxcd:master Feb 27, 2020
@mathetake mathetake deleted the datadog-metrics-provider branch February 27, 2020 09:47
stefanprodan added a commit that referenced this pull request Feb 27, 2020
stefanprodan added a commit that referenced this pull request Feb 28, 2020
stefanprodan added a commit that referenced this pull request Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Datadog as a metric server
2 participants