Skip to content

Commit 6947357

Browse files
songy23mx-psi
andauthored
[exporter/datadog] Add trace configs compute_stats_by_span_kind and peer_service_aggregation (open-telemetry#23240)
* [exporter/datadog] Add trace configs compute_stats_by_span_kind and peer_service_aggregation * Add to changelog * Update exporter/datadogexporter/config.go Co-authored-by: Pablo Baeyens <[email protected]> * Update .chloggen/datadogexporter-new-trace-configs.yaml Co-authored-by: Pablo Baeyens <[email protected]> * Add subtext to changelog --------- Co-authored-by: Pablo Baeyens <[email protected]>
1 parent b247914 commit 6947357

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Use this changelog template to create an entry for release notes.
2+
# If your change doesn't affect end users, such as a test fix or a tooling change,
3+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
4+
5+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
6+
change_type: enhancement
7+
8+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
9+
component: datadogexporter
10+
11+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
12+
note: "Add `traces::compute_stats_by_span_kind` and `traces::peer_service_aggregation` configuration flags"
13+
14+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
15+
issues: [23240]
16+
17+
# (Optional) One or more lines of additional information to render under the primary note.
18+
# These lines will be padded with 2 spaces and then inserted directly into the document.
19+
# Use pipe (|) for multiline entries.
20+
subtext: Config `traces::compute_stats_by_span_kind` enables an additional stats computation check on span kind. |
21+
Config `traces::peer_service_aggregation` enables `peer.service` aggregation in the exporter.

exporter/datadogexporter/config.go

+11
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,17 @@ type TracesConfig struct {
234234
// The default value is `false`.
235235
SpanNameAsResourceName bool `mapstructure:"span_name_as_resource_name"`
236236

237+
// If set to true, enables an additional stats computation check on spans to see they have an eligible `span.kind` (server, consumer, client, producer).
238+
// If enabled, a span with an eligible `span.kind` will have stats computed. If disabled, only top-level and measured spans will have stats computed.
239+
// NOTE: For stats computed from OTel traces, only top-level spans are considered when this option is off.
240+
ComputeStatsBySpanKind bool `mapstructure:"compute_stats_by_span_kind"`
241+
242+
// If set to true, enables `peer.service` aggregation in the exporter. If disabled, aggregated trace stats will not include `peer.service` as a dimension.
243+
// For the best experience with `peer.service`, it is recommended to also enable `compute_stats_by_span_kind`.
244+
// If enabling both causes the datadog exporter to consume too many resources, try disabling `compute_stats_by_span_kind` first.
245+
// If the overhead remains high, it will be due to a high cardinality of `peer.service` values from the traces. You may need to check your instrumentation.
246+
PeerServiceAggregation bool `mapstructure:"peer_service_aggregation"`
247+
237248
// flushInterval defines the interval in seconds at which the writer flushes traces
238249
// to the intake; used in tests.
239250
flushInterval float64

exporter/datadogexporter/traces_exporter.go

+2
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ func newTraceAgent(ctx context.Context, params exporter.CreateSettings, cfg *Con
171171
acfg.ReceiverPort = 0 // disable HTTP receiver
172172
acfg.AgentVersion = fmt.Sprintf("datadogexporter-%s-%s", params.BuildInfo.Command, params.BuildInfo.Version)
173173
acfg.SkipSSLValidation = cfg.LimitedHTTPClientSettings.TLSSetting.InsecureSkipVerify
174+
acfg.ComputeStatsBySpanKind = cfg.Traces.ComputeStatsBySpanKind
175+
acfg.PeerServiceAggregation = cfg.Traces.PeerServiceAggregation
174176
if v := cfg.Traces.flushInterval; v > 0 {
175177
acfg.TraceWriter.FlushPeriodSeconds = v
176178
}

0 commit comments

Comments
 (0)