diff --git a/backend/internal/broker/rabbitmq.go b/backend/internal/broker/rabbitmq.go index 9d4cc06..732efad 100644 --- a/backend/internal/broker/rabbitmq.go +++ b/backend/internal/broker/rabbitmq.go @@ -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 diff --git a/compose.yaml b/compose.yaml index 9e506a6..ea1c2a5 100644 --- a/compose.yaml +++ b/compose.yaml @@ -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" diff --git a/infra/otel-collector.yaml b/infra/otel-collector.yaml index 84deb05..4e207ee 100644 --- a/infra/otel-collector.yaml +++ b/infra/otel-collector.yaml @@ -9,6 +9,7 @@ receivers: exporters: prometheus: endpoint: 0.0.0.0:9464 + add_metric_suffixes: false resource_to_telemetry_conversion: enabled: true opensearch: diff --git a/infra/prometheus.yml b/infra/prometheus.yml index 46f6203..2cd1061 100644 --- a/infra/prometheus.yml +++ b/infra/prometheus.yml @@ -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"] diff --git a/infra/rabbitmq/enabled_plugins b/infra/rabbitmq/enabled_plugins new file mode 100644 index 0000000..cc972a4 --- /dev/null +++ b/infra/rabbitmq/enabled_plugins @@ -0,0 +1 @@ +[rabbitmq_management,rabbitmq_prometheus].