Skip to content

Commit

Permalink
chore(faro): prefix measurement values
Browse files Browse the repository at this point in the history
  • Loading branch information
codecapitano committed Apr 5, 2024
1 parent 2e95228 commit cbe1966
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/component/faro/receiver/internal/payload/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ type Measurement struct {
Context MeasurementContext `json:"context,omitempty"`
}

// KeyVal representation of the exception object
// KeyVal representation of the measurement object
func (m Measurement) KeyVal() *KeyVal {
kv := NewKeyVal()

Expand All @@ -238,6 +238,14 @@ func (m Measurement) KeyVal() *KeyVal {
}
MergeKeyVal(kv, m.Trace.KeyVal())
MergeKeyValWithPrefix(kv, KeyValFromMap(m.Context), "context_")

valuesAsString := make(map[string]string, len(m.Values))
for key, value := range m.Values {
valuesAsString[key] = fmt.Sprintf("%v", value)
}

MergeKeyValWithPrefix(kv, KeyValFromMap(valuesAsString), "value_")

return kv
}

Expand Down

0 comments on commit cbe1966

Please sign in to comment.