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

Commit 6b475fc

Browse files
mads-hartmannPaulo Janotti
authored andcommitted
Add support for specifying service name in config (#602)
* 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
1 parent 7b8085d commit 6b475fc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

exporter/datadogexporter/datadog.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ import (
2323
)
2424

2525
type datadogConfig struct {
26+
// ServiceName specifies the service name used for tracing.
27+
ServiceName string `mapstructure:"service_name,omitempty"`
28+
2629
// Namespace specifies the namespaces to which metric keys are appended.
2730
Namespace string `mapstructure:"namespace,omitempty"`
2831

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

6265
// TODO(jbd): Create new exporter for each service name.
6366
de := datadog.NewExporter(datadog.Options{
67+
Service: dc.ServiceName,
6468
Namespace: dc.Namespace,
6569
TraceAddr: dc.TraceAddr,
6670
StatsAddr: dc.MetricsAddr,

0 commit comments

Comments
 (0)