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

[7.x] aggregation/txmetrics: don't group on user-agent (#3848) #3854

Merged
merged 1 commit into from
Jun 8, 2020
Merged
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions x-pack/apm-server/aggregation/txmetrics/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func makeMetricset(key transactionAggregationKey, ts time.Time, counts []int64,
Container: model.Container{ID: key.containerID},
Kubernetes: model.Kubernetes{PodName: key.kubernetesPodName},
},
User: model.User{UserAgent: key.userAgent},
// TODO(axw) include browser name, by parsing the user agent
// TODO(axw) include client.geo.country_iso_code somewhere
},
Transaction: model.MetricsetTransaction{
Expand Down Expand Up @@ -304,6 +304,8 @@ type metricsMapEntry struct {
type transactionAggregationKey struct {
traceRoot bool
agentName string
// TODO(axw) requires User-Agent parsing in apm-server.
//browserName string
// TODO(axw) requires geoIP lookup in apm-server.
//clientCountryISOCode string
containerID string
Expand All @@ -315,7 +317,6 @@ type transactionAggregationKey struct {
transactionName string
transactionResult string
transactionType string
userAgent string
}

func makeTransactionAggregationKey(tx *model.Transaction) transactionAggregationKey {
Expand All @@ -339,8 +340,8 @@ func makeTransactionAggregationKey(tx *model.Transaction) transactionAggregation
hostname: tx.Metadata.System.Hostname(),
containerID: tx.Metadata.System.Container.ID,
kubernetesPodName: tx.Metadata.System.Kubernetes.PodName,
userAgent: tx.Metadata.User.UserAgent,

// TODO(axw) browser name, requires parsing User-Agent in apm-server.
// TODO(axw) clientCountryISOCode, requires geoIP lookup in apm-server.
}
}
Expand All @@ -352,6 +353,7 @@ func (k *transactionAggregationKey) hash() uint64 {
h.WriteString("1")
}
h.WriteString(k.agentName)
// TODO(axw) browserName
// TODO(axw) clientCountryISOCode
h.WriteString(k.containerID)
h.WriteString(k.hostname)
Expand All @@ -362,7 +364,6 @@ func (k *transactionAggregationKey) hash() uint64 {
h.WriteString(k.transactionName)
h.WriteString(k.transactionResult)
h.WriteString(k.transactionType)
h.WriteString(k.userAgent)
return h.Sum64()
}

Expand Down