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",
|
||||
DeliveryMode: amqp.Persistent,
|
||||
Body: body,
|
||||
Timestamp: time.Now().UTC(),
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -74,6 +74,7 @@ services:
|
||||
RABBITMQ_DEFAULT_PASS: "${RABBITMQ_PASSWORD}"
|
||||
volumes:
|
||||
- rabbitmq_data:/var/lib/rabbitmq
|
||||
- ./infra/rabbitmq/enabled_plugins:/etc/rabbitmq/enabled_plugins:ro
|
||||
ports:
|
||||
- "15672:15672"
|
||||
- "5672:5672"
|
||||
|
||||
@@ -9,6 +9,7 @@ receivers:
|
||||
exporters:
|
||||
prometheus:
|
||||
endpoint: 0.0.0.0:9464
|
||||
add_metric_suffixes: false
|
||||
resource_to_telemetry_conversion:
|
||||
enabled: true
|
||||
opensearch:
|
||||
|
||||
@@ -5,3 +5,11 @@ scrape_configs:
|
||||
- job_name: otel-collector
|
||||
static_configs:
|
||||
- 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