From f92056e60597def3bc4e15110964b2c72927f2ca Mon Sep 17 00:00:00 2001
From: royalcat <k.adamovich20@gmail.com>
Date: Fri, 12 Apr 2024 13:55:00 +0300
Subject: [PATCH] fix

---
 loki/config.yaml           |  9 +++++++++
 otel-collector/config.yaml | 12 +-----------
 2 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/loki/config.yaml b/loki/config.yaml
index 4ce0b19..196aaaf 100644
--- a/loki/config.yaml
+++ b/loki/config.yaml
@@ -52,3 +52,12 @@ schema_config:
 
 ruler:
   alertmanager_url: http://localhost:9093
+
+otlp_config:
+  resource_attributes:
+    log_attributes:
+      - action: index_label
+        attributes:
+          - component
+          - function
+          - endpoint
diff --git a/otel-collector/config.yaml b/otel-collector/config.yaml
index e97063f..82753df 100644
--- a/otel-collector/config.yaml
+++ b/otel-collector/config.yaml
@@ -26,16 +26,6 @@ receivers:
 
 processors:
   batch: # https://github.com/open-telemetry/opentelemetry-collector/tree/main/processor/batchprocessor
-  attributes:
-    actions:
-      - action: insert
-        key: loki.attribute.labels
-        value: [component, function, endpoint]
-  resource:
-    attributes:
-      - action: insert
-        key: loki.resource.labels
-        value: [host.name, service.name, service.namespace]
 
 exporters:
   otlp/tempo:
@@ -84,5 +74,5 @@ service:
         - prometheusremotewrite/grafana_cloud_metrics
     logs:
       receivers: [otlp]
-      processors: [attributes, resource, batch]
+      processors: [batch]
       exporters: [otlphttp/loki, loki/grafana_cloud_logs]