Skip to content

Commit 78f9526

Browse files
committed
monitoring
1 parent 1edbf7d commit 78f9526

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

pkg/monitoring/ClientMonitoringExtension.php

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function onPostSend(PostSend $context): void
3939
$stats = new SentMessageStats(
4040
$timestampMs,
4141
$destination,
42+
$context->getTransportDestination() instanceof Topic,
4243
$context->getTransportMessage()->getMessageId(),
4344
$context->getTransportMessage()->getCorrelationId(),
4445
$context->getTransportMessage()->getHeaders(),

pkg/monitoring/InfluxDbStorage.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function pushConsumedMessageStats(ConsumedMessageStats $stats): void
141141
public function pushSentMessageStats(SentMessageStats $stats): void
142142
{
143143
$tags = [
144-
'queue' => $stats->getQueue(),
144+
'destination' => $stats->getDestination(),
145145
];
146146

147147
$properties = $stats->getProperties();

pkg/monitoring/SentMessageStats.php

+17-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ class SentMessageStats implements Stats
2424
/**
2525
* @var string
2626
*/
27-
protected $queue;
27+
protected $destination;
28+
29+
/**
30+
* @var bool
31+
*/
32+
protected $isTopic;
2833

2934
/**
3035
* @var array
@@ -38,14 +43,16 @@ class SentMessageStats implements Stats
3843

3944
public function __construct(
4045
int $timestampMs,
41-
string $queue,
46+
string $destination,
47+
bool $isTopic,
4248
?string $messageId,
4349
?string $correlationId,
4450
array $headers,
4551
array $properties
4652
) {
4753
$this->timestampMs = $timestampMs;
48-
$this->queue = $queue;
54+
$this->destination = $destination;
55+
$this->isTopic = $isTopic;
4956
$this->messageId = $messageId;
5057
$this->correlationId = $correlationId;
5158
$this->headers = $headers;
@@ -57,9 +64,14 @@ public function getTimestampMs(): int
5764
return $this->timestampMs;
5865
}
5966

60-
public function getQueue(): string
67+
public function getDestination(): string
68+
{
69+
return $this->destination;
70+
}
71+
72+
public function isTopic(): bool
6173
{
62-
return $this->queue;
74+
return $this->isTopic;
6375
}
6476

6577
public function getMessageId(): ?string

0 commit comments

Comments
 (0)