Skip to content

Commit

Permalink
datadog: logs support (#45)
Browse files Browse the repository at this point in the history
This PR adds logs support in the Datadog destination.
In addition, the OpenTelemetry collector is upgraded to version 0.68.0.
  • Loading branch information
edeNFed authored Jan 1, 2023
1 parent 9c221b9 commit e253c65
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESTINATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| | Traces | Metrics | Logs |
| ------------- | ------ | ------- | ---- |
| New Relic ||||
| Datadog ||| |
| Datadog ||| |
| Grafana Cloud ||||
| Honeycomb ||||
| Logz.io ||||
Expand Down
11 changes: 10 additions & 1 deletion autoscaler/controllers/gateway/config/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ func (d *Datadog) DestType() common.DestinationType {
}

func (d *Datadog) ModifyConfig(dest *odigosv1.Destination, currentConfig *commonconf.Config) {
if isTracingEnabled(dest) || isMetricsEnabled(dest) {
if isTracingEnabled(dest) || isMetricsEnabled(dest) || isLoggingEnabled(dest) {
site, exists := dest.Spec.Data[datadogSiteKey]
if !exists {
log.Log.V(0).Info("Datadog site not specified, gateway will not be configured for Datadog")
return
}

currentConfig.Exporters["datadog"] = commonconf.GenericMap{
"hostname": "odigos-gateway",
"api": commonconf.GenericMap{
"key": "${DATADOG_API_KEY}",
"site": site,
Expand All @@ -48,4 +49,12 @@ func (d *Datadog) ModifyConfig(dest *odigosv1.Destination, currentConfig *common
Exporters: []string{"datadog"},
}
}

if isLoggingEnabled(dest) {
currentConfig.Service.Pipelines["logs/datadog"] = commonconf.Pipeline{
Receivers: []string{"otlp"},
Processors: []string{"batch"},
Exporters: []string{"datadog"},
}
}
}
2 changes: 1 addition & 1 deletion autoscaler/controllers/gateway/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

const (
containerName = "gateway"
containerImage = "otel/opentelemetry-collector-contrib:0.55.0"
containerImage = "otel/opentelemetry-collector-contrib:0.68.0"
containerCommand = "/otelcol-contrib"
confDir = "/conf"
configHashAnnotation = "odigos.io/config-hash"
Expand Down
1 change: 1 addition & 0 deletions cli/cmd/observability/backend/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ func (d *Datadog) SupportedSignals() []common.ObservabilitySignal {
return []common.ObservabilitySignal{
common.TracesObservabilitySignal,
common.MetricsObservabilitySignal,
common.LogsObservabilitySignal,
}
}
2 changes: 1 addition & 1 deletion instrumentor/patch/golang.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
golangExporterEndpoint = "OTEL_EXPORTER_OTLP_ENDPOINT"
golangServiceNameEnv = "OTEL_SERVICE_NAME"
golangTargetExeEnv = "OTEL_TARGET_EXE"
initImage = "ghcr.io/keyval-dev/odigos/init"
initImage = "ghcr.io/keyval-dev/odigos/init:v0.1.37"
initVolumeName = "odigos"
initMountPath = "/odigos"
initExePath = "/odigos/init"
Expand Down
2 changes: 1 addition & 1 deletion odiglet/pkg/containers/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func newContainerID(str string) (*ContainerID, error) {

func FindIDs(ctx context.Context, podName string, podNamespace string, kubeClient kubernetes.Interface) ([]*ContainerID, error) {
// Wait for all the containers to be running
err := wait.PollImmediate(time.Second, 30*time.Second, isPodRunning(ctx, kubeClient, podName, podNamespace))
err := wait.PollImmediate(time.Second, 3*time.Minute, isPodRunning(ctx, kubeClient, podName, podNamespace))
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions ui/vendors/datadog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class Datadog implements ObservabilityVendor {
supportedSignals = [
ObservabilitySignals.Traces,
ObservabilitySignals.Metrics,
ObservabilitySignals.Logs,
];

getLogo = (props: any) => {
Expand Down

0 comments on commit e253c65

Please sign in to comment.