Skip to content

Commit

Permalink
Add datadog metrics (Netflix#2332)
Browse files Browse the repository at this point in the history
* add postgres missing dependency

* support datadog

* update datadog conditional property
  • Loading branch information
noamlevy81 authored Jul 26, 2021
1 parent 7e308ad commit f9cb2d7
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,6 @@ Component configuration:
| | | |
| - | conductor.metrics-logger.enabled | false |
| - | conductor.metrics-prometheus.enabled | false |
| - | conductor.metrics-datadog.enable | false |
| - | conductor.metrics-datadog.api-key | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.netflix.conductor.contribs.metrics;

import com.netflix.spectator.api.Spectator;
import com.netflix.spectator.micrometer.MicrometerRegistry;
import io.micrometer.core.instrument.MeterRegistry;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;

/**
* Metrics Datadog module, sending all metrics to a Datadog server.
* <p>
* Enable in config: conductor.metrics-datadog.enabled=true
* <p>
* Make sure your dependencies include both micrometer-registry-datadog & spring-boot-starter-actuator
*/
@ConditionalOnProperty(value = "conductor.metrics-datadog.enabled", havingValue = "true")
@Configuration
public class DatadogMetricsConfiguration {

public DatadogMetricsConfiguration(MeterRegistry meterRegistry) {
final MicrometerRegistry metricsRegistry = new MicrometerRegistry(meterRegistry);
Spectator.globalRegistry().add(metricsRegistry);
}
}
2 changes: 2 additions & 0 deletions server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ dependencies {

implementation "org.springdoc:springdoc-openapi-ui:${revOpenapi}"

runtimeOnly 'io.micrometer:micrometer-registry-datadog'

runtimeOnly 'com.netflix.spectator:spectator-reg-micrometer'

testImplementation project(':conductor-rest')
Expand Down
4 changes: 4 additions & 0 deletions server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ conductor.workflow-execution-lock.type=noop_lock
# Additional modules for metrics collection exposed to Prometheus (optional)
# conductor.metrics-prometheus.enabled=true
# management.endpoints.web.exposure.include=prometheus

# Additional modules for metrics collection exposed to Datadog (optional)
management.metrics.export.datadog.enabled=${conductor.metrics-datadog.enabled:false}
management.metrics.export.datadog.api-key=${conductor.metrics-datadog.api-key:}

0 comments on commit f9cb2d7

Please sign in to comment.