Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

Commit

Permalink
Add support for specifying service name in config (#602)
Browse files Browse the repository at this point in the history
* Add support for specifying service name in config

The datadog exporter will currently drop the service name which is
specified in the spans. See #198
for more information.

This aligns the datadog exporter with jaeger, wavefront, and zipkin.
They already have this option.

A better solution would be to add support for multiple services, as many
of the other exporters have, but that is a bit over the level of
contribution I can do at the moment.

* Fix typo in comment
  • Loading branch information
mads-hartmann authored and Paulo Janotti committed Jul 20, 2019
1 parent 7b8085d commit 6b475fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions exporter/datadogexporter/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ import (
)

type datadogConfig struct {
// ServiceName specifies the service name used for tracing.
ServiceName string `mapstructure:"service_name,omitempty"`

// Namespace specifies the namespaces to which metric keys are appended.
Namespace string `mapstructure:"namespace,omitempty"`

Expand Down Expand Up @@ -61,6 +64,7 @@ func DatadogTraceExportersFromViper(v *viper.Viper) (tps []consumer.TraceConsume

// TODO(jbd): Create new exporter for each service name.
de := datadog.NewExporter(datadog.Options{
Service: dc.ServiceName,
Namespace: dc.Namespace,
TraceAddr: dc.TraceAddr,
StatsAddr: dc.MetricsAddr,
Expand Down

0 comments on commit 6b475fc

Please sign in to comment.