Tag DD sink POST operations with sink name
@@ -249,7 +249,7 @@ func (dd *DatadogMetricSink) FlushOtherSamples(ctx context.Context, samples []ss
"events": {
"api": events,
},
- }, "flush_events", true, nil, dd.log)
+ }, "flush_events", true, map[string]string{"sink": "datadog"}, dd.log)
if err == nil {
dd.log.WithField("events", len(events)).Info("Completed flushing events to Datadog")
@@ -264,7 +264,7 @@ func (dd *DatadogMetricSink) FlushOtherSamples(ctx context.Context, samples []ss
// this endpoint is not documented to take an array... but it does
// another curious constraint of this endpoint is that it does not
// support "Content-Encoding: deflate"
- err := vhttp.PostHelper(context.TODO(), dd.HTTPClient, dd.traceClient, http.MethodPost, fmt.Sprintf("%s/api/v1/check_run?api_key=%s", dd.DDHostname, dd.APIKey), checks, "flush_checks", false, nil, dd.log)
+ err := vhttp.PostHelper(context.TODO(), dd.HTTPClient, dd.traceClient, http.MethodPost, fmt.Sprintf("%s/api/v1/check_run?api_key=%s", dd.DDHostname, dd.APIKey), checks, "flush_checks", false, map[string]string{"sink": "datadog"}, dd.log)
if err == nil {
dd.log.WithField("checks", len(checks)).Info("Completed flushing service checks to Datadog")
} else {
@@ -340,7 +340,7 @@ func (dd *DatadogMetricSink) flushPart(ctx context.Context, metricSlice []DDMetr
defer wg.Done()
vhttp.PostHelper(ctx, dd.HTTPClient, dd.traceClient, http.MethodPost, fmt.Sprintf("%s/api/v1/series?api_key=%s", dd.DDHostname, dd.APIKey), map[string][]DDMetric{
"series": metricSlice,
- }, "flush", true, nil, dd.log)
+ }, "flush", true, map[string]string{"sink": "datadog"}, dd.log)
}
// DatadogTraceSpan represents a trace span as JSON for the
@@ -538,7 +538,7 @@ func (dd *DatadogSpanSink) Flush() {
// another curious constraint of this endpoint is that it does not
// support "Content-Encoding: deflate"
- err := vhttp.PostHelper(context.TODO(), dd.HTTPClient, dd.traceClient, http.MethodPut, fmt.Sprintf("%s/v0.3/traces", dd.traceAddress), finalTraces, "flush_traces", false, nil, dd.log)
+ err := vhttp.PostHelper(context.TODO(), dd.HTTPClient, dd.traceClient, http.MethodPut, fmt.Sprintf("%s/v0.3/traces", dd.traceAddress), finalTraces, "flush_traces", false, map[string]string{"sink": "datadog"}, dd.log)
if err == nil {
dd.log.WithField("traces", len(finalTraces)).Info("Completed flushing traces to Datadog")
} else {
