forked from mtusi2026/mtusi2026lab6
feat(metrics): lab6 expose per-queue RabbitMQ metrics
This commit is contained in:
@@ -99,6 +99,7 @@ func (p *RabbitPublisher) Publish(ctx context.Context, routingKey string, body [
|
|||||||
ContentType: "application/json",
|
ContentType: "application/json",
|
||||||
DeliveryMode: amqp.Persistent,
|
DeliveryMode: amqp.Persistent,
|
||||||
Body: body,
|
Body: body,
|
||||||
|
Timestamp: time.Now().UTC(),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ services:
|
|||||||
RABBITMQ_DEFAULT_PASS: "${RABBITMQ_PASSWORD}"
|
RABBITMQ_DEFAULT_PASS: "${RABBITMQ_PASSWORD}"
|
||||||
volumes:
|
volumes:
|
||||||
- rabbitmq_data:/var/lib/rabbitmq
|
- rabbitmq_data:/var/lib/rabbitmq
|
||||||
|
- ./infra/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
|
||||||
ports:
|
ports:
|
||||||
- "15672:15672"
|
- "15672:15672"
|
||||||
- "5672:5672"
|
- "5672:5672"
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ receivers:
|
|||||||
exporters:
|
exporters:
|
||||||
prometheus:
|
prometheus:
|
||||||
endpoint: 0.0.0.0:9464
|
endpoint: 0.0.0.0:9464
|
||||||
|
add_metric_suffixes: false
|
||||||
resource_to_telemetry_conversion:
|
resource_to_telemetry_conversion:
|
||||||
enabled: true
|
enabled: true
|
||||||
opensearch:
|
opensearch:
|
||||||
|
|||||||
@@ -5,3 +5,11 @@ scrape_configs:
|
|||||||
- job_name: otel-collector
|
- job_name: otel-collector
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ["otel-collector:9464"]
|
- targets: ["otel-collector:9464"]
|
||||||
|
|
||||||
|
- job_name: rabbitmq
|
||||||
|
metrics_path: /metrics/detailed
|
||||||
|
params:
|
||||||
|
vhost: ["/"]
|
||||||
|
family: [queue_coarse_metrics, queue_metrics]
|
||||||
|
static_configs:
|
||||||
|
- targets: ["rabbitmq:15692"]
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
[rabbitmq_management,rabbitmq_prometheus].
|
||||||
Reference in New Issue
Block a user