Skip to content

Commit 1259b63

Browse files
authored
[connector/servicegraph] Update virtual node defaults and change feature gate to beta (#31735)
**Description:** - Change default values to peer.service, db.name and db.system (in this order). These are compliant with conventions, and the same as the tempo service graph uses. - Switch the feature from "alpha" to "beta". Virtual nodes are working well on the tempo side, and feature could be disabled anyway by using an empty list if needed. - Reword documentation for improved clarity - Fix "processor" that should be "connector" instead since recent commit **Link to tracking Issue:** #31734 **Testing:** No functional change requiring additional tests **Documentation:** Updated documentation
1 parent f107dd4 commit 1259b63

File tree

4 files changed

+29
-9
lines changed

4 files changed

+29
-9
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: breaking
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
5+
component: connector/servicegraphconnector
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Change `connector.servicegraph.virtualNode` feature gate from Alpha to Beta (now enabled by default) and change `virtual_node_peer_attributes` default values.
9+
10+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
11+
issues: [31734]
12+
13+
# If your change doesn't affect end users or the exported elements of any package,
14+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
15+
# Optional: The change log or logs in which this entry should be included.
16+
# e.g. '[user]' or '[user, api]'
17+
# Include 'user' if the change is relevant to end users.
18+
# Include 'api' if there is a change to a library API.
19+
# Default: '[user]'
20+
change_logs: [user]

connector/servicegraphconnector/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ datasources:
118118
119119
The following settings are required:
120120
121-
- `metrics_exporter`: the name of the exporter that this processor will write metrics to. This exporter **must** be present in a pipeline.
121+
- `metrics_exporter`: the name of the exporter that this connector will write metrics to. This exporter **must** be present in a pipeline.
122122
- `latency_histogram_buckets`: the list of durations defining the latency histogram buckets.
123123
- Default: `[2ms, 4ms, 6ms, 8ms, 10ms, 50ms, 100ms, 200ms, 400ms, 800ms, 1s, 1400ms, 2s, 5s, 10s, 15s]`
124124
- `dimensions`: the list of dimensions to add together with the default dimensions defined above.
@@ -134,8 +134,8 @@ The following settings can be optionally configured:
134134
- Default: `1m`
135135
- `store_expiration_loop`: the time to expire old entries from the store periodically.
136136
- Default: `2s`
137-
- `virtual_node_peer_attributes`: the list of attributes need to match for building virtual server node, the higher the front, the higher the priority.
138-
- Default: `[db.name, net.sock.peer.addr, net.peer.name, rpc.service, net.sock.peer.name, net.peer.name, http.url, http.target]`
137+
- `virtual_node_peer_attributes`: the list of attributes, ordered by priority, whose presence in a client span will result in the creation of a virtual server node. An empty list disables virtual node creation.
138+
- Default: `[peer.service, db.name, db.system]`
139139
- `metrics_flush_interval`: the interval at which metrics are flushed to the exporter.
140140
- Default: Metrics are flushed on every received batch of traces.
141141
- `database_name_attribute`: the attribute name used to identify the database name from span attributes.

connector/servicegraphconnector/connector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var (
4242
}
4343

4444
defaultPeerAttributes = []string{
45-
semconv.AttributeDBName, semconv.AttributeNetSockPeerAddr, semconv.AttributeNetPeerName, semconv.AttributeRPCService, semconv.AttributeNetSockPeerName, semconv.AttributeNetPeerName, semconv.AttributeHTTPURL, semconv.AttributeHTTPTarget,
45+
semconv.AttributePeerService, semconv.AttributeDBName, semconv.AttributeDBSystem,
4646
}
4747

4848
defaultDatabaseNameAttribute = semconv.AttributeDBName
@@ -380,7 +380,7 @@ func (p *serviceGraphConnector) onExpire(e *store.Edge) {
380380

381381
p.statExpiredEdges.Add(context.Background(), 1)
382382

383-
if virtualNodeFeatureGate.IsEnabled() {
383+
if virtualNodeFeatureGate.IsEnabled() && len(p.config.VirtualNodePeerAttributes) > 0 {
384384
e.ConnectionType = store.VirtualNode
385385
if len(e.ClientService) == 0 && e.Key.SpanIDIsEmpty() {
386386
e.ClientService = "user"

connector/servicegraphconnector/factory.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ var virtualNodeFeatureGate, legacyMetricNamesFeatureGate, legacyLatencyUnitMsFea
3030
func init() {
3131
virtualNodeFeatureGate = featuregate.GlobalRegistry().MustRegister(
3232
virtualNodeFeatureGateID,
33-
featuregate.StageAlpha,
34-
featuregate.WithRegisterDescription("When enabled, when the edge expires, processor checks if it has peer attributes(`db.name, net.sock.peer.addr, net.peer.name, rpc.service, http.url, http.target`), and then aggregate the metrics with virtual node."),
33+
featuregate.StageBeta,
34+
featuregate.WithRegisterDescription("When enabled and setting `virtual_node_peer_attributes` is not empty, the connector looks for the presence of these attributes in span to create virtual server nodes."),
3535
featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/17196"),
3636
)
3737
// TODO: Remove this feature gate when the legacy metric names are removed.
3838
legacyMetricNamesFeatureGate = featuregate.GlobalRegistry().MustRegister(
3939
legacyLatencyMetricNamesFeatureGateID,
4040
featuregate.StageAlpha, // Alpha because we want it disabled by default.
41-
featuregate.WithRegisterDescription("When enabled, processor uses legacy latency metric names."),
41+
featuregate.WithRegisterDescription("When enabled, connector uses legacy latency metric names."),
4242
featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/18743,https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16578"),
4343
)
4444
legacyLatencyUnitMsFeatureGate = featuregate.GlobalRegistry().MustRegister(
4545
legacyLatencyUnitMs,
4646
featuregate.StageAlpha, // Alpha because we want it disabled by default.
47-
featuregate.WithRegisterDescription("When enabled, processor reports latency in milliseconds, instead of seconds."),
47+
featuregate.WithRegisterDescription("When enabled, connector reports latency in milliseconds, instead of seconds."),
4848
featuregate.WithRegisterReferenceURL("https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/27488"),
4949
)
5050
}

0 commit comments

Comments
 (0)