-
-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tags not being serialized correctly for metrics payload (#1672)
- Loading branch information
1 parent
b3dd043
commit 493d811
Showing
2 changed files
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -412,28 +412,31 @@ public static function serializeAsEnvelopeDataProvider(): iterable | |
false, | ||
]; | ||
|
||
$counter = new CounterType('counter', 1.0, MetricsUnit::second(), ['foo' => 'bar'], 1597790835); | ||
$counter = new CounterType('counter', 1.0, MetricsUnit::second(), ['foo' => 'bar', 'baz' => 'qux'], 1597790835); | ||
$distribution = new DistributionType('distribution', 1.0, MetricsUnit::second(), ['$foo$' => '%bar%'], 1597790835); | ||
$gauge = new GaugeType('gauge', 1.0, MetricsUnit::second(), ['föö' => 'bär'], 1597790835); | ||
$set = new SetType('set', 1.0, MetricsUnit::second(), ['%{key}' => '$value$'], 1597790835); | ||
$noTags = new CounterType('no_tags', 1.0, MetricsUnit::second(), [], 1597790835); | ||
|
||
$event = Event::createMetrics(new EventId('fc9442f5aef34234bb22b9a615e30ccd')); | ||
$event->setMetrics([ | ||
$counter, | ||
$distribution, | ||
$gauge, | ||
$set, | ||
$noTags, | ||
]); | ||
|
||
yield [ | ||
$event, | ||
<<<TEXT | ||
{"event_id":"fc9442f5aef34234bb22b9a615e30ccd","sent_at":"2020-08-18T22:47:15Z","dsn":"http:\/\/[email protected]\/sentry\/1","sdk":{"name":"sentry.php","version":"$sdkVersion"}} | ||
{"type":"statsd","length":172} | ||
counter@second:1|c|#foo:bar|T1597790835 | ||
{"type":"statsd","length":211} | ||
counter@second:1|c|#foo:bar,baz:qux|T1597790835 | ||
distribution@second:1|d|#_foo_:bar|T1597790835 | ||
gauge@second:1:1:1:1:1|g|#f_:br|T1597790835 | ||
set@second:1|s|#_key_:\$value\$|T1597790835 | ||
no_tags@second:1|c|T1597790835 | ||
TEXT | ||
, | ||
false, | ||
|