Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implements file reading for peer tags to synchronize cross repo usage #25600

Merged
merged 27 commits into from
May 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
343d6aa
Changes defaultPeerTagList to be read from a file
zarirhamza May 14, 2024
5f77762
linter fixes
zarirhamza May 14, 2024
2aab22e
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 14, 2024
5e2ad06
linter build fixes
zarirhamza May 14, 2024
e745420
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 14, 2024
7747288
Adds parsing for ini file
zarirhamza May 15, 2024
9af7dca
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 15, 2024
57f8372
Adds conditions to ensure tag list matches current behavior
zarirhamza May 17, 2024
4dc0699
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 17, 2024
c588f5b
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 21, 2024
c9addb2
Updates generated file to prevent mismatch between aggregation and ba…
zarirhamza May 22, 2024
38885a4
Update go.mod
zarirhamza May 22, 2024
cd20504
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 22, 2024
1f834b1
Updates list to include new otel peer source tags
zarirhamza May 23, 2024
8664f23
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 23, 2024
4512bd6
removes unnecessary length check
zarirhamza May 28, 2024
80d8757
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 28, 2024
6803c88
Added error handling for parsing INI file
zarirhamza May 28, 2024
ca4d0f5
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 28, 2024
57bc839
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 29, 2024
65275d8
fix go.mod files
zarirhamza May 29, 2024
dfd18ef
add serverless dependencies
zarirhamza May 29, 2024
b6313c8
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 29, 2024
48fcf34
fix serverless dep typo
zarirhamza May 29, 2024
6907b70
fix deps test
zarirhamza May 30, 2024
b357fe7
Merge branch 'main' into zarir/semantic-core-peer-tag-aggregation
zarirhamza May 30, 2024
1f5cc9f
remove newline at end of dep file
zarirhamza May 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Changes defaultPeerTagList to be read from a file
Part of larger changes to come where common tag names are sourced from a single source of truth across DD repos
The planned source of truth will generate static files which can be read by the agent code and synchronized across all DD repos involving peer tags
zarirhamza committed May 14, 2024

Verified

This commit was signed with the committer’s verified signature.
zarirhamza Zarir Hamza
commit 343d6aa463bae30e6e370058257ec3985926fc5f
43 changes: 12 additions & 31 deletions pkg/trace/stats/concentrator.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
package stats

import (
_ "embed"
"sort"
"strings"
"sync"
@@ -55,37 +56,17 @@
statsd statsd.ClientInterface
}

var defaultPeerTags = []string{
"_dd.base_service",
"amqp.destination",
"amqp.exchange",
"amqp.queue",
"aws.queue.name",
"bucketname",
"cassandra.cluster",
"db.cassandra.contact.points",
"db.couchbase.seed.nodes",
"db.hostname",
"db.instance",
"db.name",
"db.system",
"hazelcast.instance",
"messaging.kafka.bootstrap.servers",
"mongodb.db",
"msmq.queue.path",
"net.peer.name",
"network.destination.name",
"peer.hostname",
"peer.service",
"queuename",
"rpc.service",
"rulename",
"server.address",
"statemachinename",
"streamname",
"tablename",
"topicname",
}
//go:embed peer_tags.csv
var peer_tag_file string

Check failure on line 60 in pkg/trace/stats/concentrator.go

GitHub Actions / windows-lint

var-naming: don't use underscores in Go names; var peer_tag_file should be peerTagFile (revive)

Check failure on line 60 in pkg/trace/stats/concentrator.go

GitHub Actions / windows-lint

var-naming: don't use underscores in Go names; var peer_tag_file should be peerTagFile (revive)

var defaultPeerTags = func() []string {
zarirhamza marked this conversation as resolved.
Show resolved Hide resolved
lines := strings.Split(strings.TrimSpace(peer_tag_file), "\n")
tags := make([]string, len(lines))
for i, line := range lines {
tags[i] = strings.TrimSpace(line)
}
return tags
}()

func preparePeerTags(tags ...string) []string {
if len(tags) == 0 {
1 change: 1 addition & 0 deletions pkg/trace/stats/peer_tags.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"_dd.base_service","amqp.destination","amqp.exchange","amqp.queue","aws.queue.name","bucketname","cassandra.cluster","db.cassandra.contact.points","db.couchbase.seed.nodes","db.hostname","db.instance","db.name","db.system","hazelcast.instance","messaging.kafka.bootstrap.servers","mongodb.db","msmq.queue.path","net.peer.name","network.destination.name","peer.hostname","peer.service","queuename","rpc.service","rulename","server.address","statemachinename","streamname","tablename","topicname"