From 8a026f0055944e017624fa5f98535efbd6b7f92b Mon Sep 17 00:00:00 2001
From: royalcat <k.adamovich20@gmail.com>
Date: Mon, 6 May 2024 10:46:38 +0300
Subject: [PATCH] otel collector self monitoring

---
 otel-collector/config.yaml | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/otel-collector/config.yaml b/otel-collector/config.yaml
index f50fda8..eb976aa 100644
--- a/otel-collector/config.yaml
+++ b/otel-collector/config.yaml
@@ -10,6 +10,13 @@ receivers:
         endpoint: 0.0.0.0:4317
       http:
         endpoint: 0.0.0.0:4318
+  prometheus/self:
+    config:
+      scrape_configs:
+        - job_name: otel-collector-metrics
+          scrape_interval: 10s
+          static_configs:
+            - targets: ["localhost:8888"]
 
 processors:
   batch:
@@ -36,7 +43,7 @@ service:
       exporters:
         - otlp/tempo
     metrics:
-      receivers: [otlp]
+      receivers: [otlp, prometheus/self]
       processors: [batch]
       exporters:
         - prometheusremotewrite