Skip to content

Commit c8d4b7b

Browse files
authored
Merge pull request #88268 from max-cx/OBSDOCS-1570
OBSDOCS-1570: Update the docs to document using the OTLP HTTP for pushing logs to LokiStack
2 parents e05f41c + 2d63cff commit c8d4b7b

File tree

1 file changed

+13
-47
lines changed

1 file changed

+13
-47
lines changed

modules/otel-forwarding-logs-to-tempostack.adoc

Lines changed: 13 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
[id="otel-forwarding-logs-to-tempostack_{context}"]
77
= Forwarding logs to a LokiStack instance
88

9-
You can deploy the OpenTelemetry Collector with Collector components to forward logs to a LokiStack instance.
10-
11-
This use of the Loki Exporter is a temporary Technology Preview feature that is planned to be replaced with the publication of an improved solution in which the Loki Exporter is replaced with the OTLP HTTP Exporter.
12-
13-
:FeatureName: The Loki Exporter
14-
include::snippets/technology-preview.adoc[leveloffset=+1]
9+
You can deploy the OpenTelemetry Collector to forward logs to a LokiStack instance.
1510

1611
.Prerequisites
1712

@@ -99,80 +94,51 @@ spec:
9994
grpc: {}
10095
http: {}
10196
processors:
102-
k8sattributes:
103-
auth_type: "serviceAccount"
104-
passthrough: false
105-
extract:
106-
metadata:
107-
- k8s.pod.name
108-
- k8s.container.name
109-
- k8s.namespace.name
110-
labels:
111-
- tag_name: app.label.component
112-
key: app.kubernetes.io/component
113-
from: pod
114-
pod_association:
115-
- sources:
116-
- from: resource_attribute
117-
name: k8s.pod.name
118-
- from: resource_attribute
119-
name: k8s.container.name
120-
- from: resource_attribute
121-
name: k8s.namespace.name
122-
- sources:
123-
- from: connection
97+
k8sattributes: {}
12498
resource:
12599
attributes: # <1>
126-
- key: loki.format # <2>
127-
action: insert
128-
value: json
129-
- key: kubernetes_namespace_name
100+
- key: kubernetes.namespace_name
130101
from_attribute: k8s.namespace.name
131102
action: upsert
132-
- key: kubernetes_pod_name
103+
- key: kubernetes.pod_name
133104
from_attribute: k8s.pod.name
134105
action: upsert
135-
- key: kubernetes_container_name
106+
- key: kubernetes.container_name
136107
from_attribute: k8s.container.name
137108
action: upsert
138109
- key: log_type
139110
value: application
140111
action: upsert
141-
- key: loki.resource.labels # <3>
142-
value: log_type, kubernetes_namespace_name, kubernetes_pod_name, kubernetes_container_name
143-
action: insert
144112
transform:
145113
log_statements:
146114
- context: log
147115
statements:
148116
- set(attributes["level"], ConvertCase(severity_text, "lower"))
149117
exporters:
150-
loki:
151-
endpoint: https://logging-loki-gateway-http.openshift-logging.svc.cluster.local:8080/api/logs/v1/application/loki/api/v1/push # <4>
118+
otlphttp:
119+
endpoint: https://logging-loki-gateway-http.openshift-logging.svc.cluster.local:8080/api/logs/v1/application/otlp
120+
encoding: json
152121
tls:
153122
ca_file: "/var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt"
154123
auth:
155124
authenticator: bearertokenauth
156125
debug:
157126
verbosity: detailed
158127
service:
159-
extensions: [bearertokenauth] # <5>
128+
extensions: [bearertokenauth] # <2>
160129
pipelines:
161130
logs:
162131
receivers: [otlp]
163132
processors: [k8sattributes, transform, resource]
164-
exporters: [loki] # <6>
133+
exporters: [otlphttp] # <3>
165134
logs/test:
166135
receivers: [otlp]
167136
processors: []
168137
exporters: [debug]
169138
----
170-
<1> Provides the following resource attributes to be used by the web console: `kubernetes_namespace_name`, `kubernetes_pod_name`, `kubernetes_container_name`, and `log_type`. If you specify them as values for this `loki.resource.labels` attribute, then the Loki Exporter processes them as labels.
171-
<2> Configures the format of Loki logs. Supported values are `json`, `logfmt` and `raw`.
172-
<3> Configures which resource attributes are processed as Loki labels.
173-
<4> Points the Loki Exporter to the gateway of the LokiStack `logging-loki` instance and uses the `application` tenant.
174-
<5> Enables the BearerTokenAuth Extension that is required by the Loki Exporter.
175-
<6> Enables the Loki Exporter to export logs from the Collector.
139+
<1> Provides the following resource attributes to be used by the web console: `kubernetes.namespace_name`, `kubernetes.pod_name`, `kubernetes.container_name`, and `log_type`.
140+
<2> Enables the BearerTokenAuth Extension that is required by the OTLP HTTP Exporter.
141+
<3> Enables the OTLP HTTP Exporter to export logs from the Collector.
176142

177143
[TIP]
178144
====

0 commit comments

Comments
 (0)