<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ingesting logs to Loki using OpenTelemetry Collector on Grafana Labs</title><link>https://grafana.com/docs/loki/v3.7.x/send-data/otel/</link><description>Recent content in Ingesting logs to Loki using OpenTelemetry Collector on Grafana Labs</description><generator>Hugo -- gohugo.io</generator><language>en</language><atom:link href="/docs/loki/v3.7.x/send-data/otel/index.xml" rel="self" type="application/rss+xml"/><item><title>How is native OTLP endpoint different from Loki Exporter</title><link>https://grafana.com/docs/loki/v3.7.x/send-data/otel/native_otlp_vs_loki_exporter/</link><pubDate>Thu, 09 Apr 2026 02:28:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v3.7.x/send-data/otel/native_otlp_vs_loki_exporter/</guid><content><![CDATA[&lt;h1 id=&#34;how-is-native-otlp-endpoint-different-from-loki-exporter&#34;&gt;How is native OTLP endpoint different from Loki Exporter&lt;/h1&gt;
&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;p&gt;OpenTelemetry (OTel) is quickly becoming an industry standard with increasing adoption. Prior to the Loki 3.0 release, there was no native support for ingesting OTel logs to Loki, which led to creation of the &lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/lokiexporter/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;LokiExporter&lt;/a&gt;. While the LokiExporter got the job done of ingesting OTel logs to Loki, it did not provide a native user experience, and the querying experience was not optimal. As part of our effort to improve user experience with OTel, we added native OTel log ingestion support to Loki with 3.0 release.&lt;/p&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The native OTLP endpoint is the recommended way to send logs to Loki. Grafana Labs is working to migrate existing customers from Loki Exporter to the native OTLP endpoint.
For Cloud users, Adaptive Logs may not produce meaningful patterns if OTel logs are sent to the Cloud Logs endpoint. They must be sent to the OTLP endpoint.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;h2 id=&#34;what-has-changed&#34;&gt;What has changed?&lt;/h2&gt;
&lt;h3 id=&#34;formatting-of-logs&#34;&gt;Formatting of logs&lt;/h3&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/lokiexporter/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;LokiExporter&amp;rsquo;s README&lt;/a&gt; explains in detail the formatting of OTel logs ingested via LokiExporter, while Loki’s native OTel log ingestion endpoint is described in detail in its 
    &lt;a href=&#34;/docs/loki/v3.7.x/send-data/otel/&#34;&gt;documentation&lt;/a&gt;. Here is a summary of how the logs are formatted between the two:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;LokiExporter&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Index Labels:
&lt;ul&gt;
&lt;li&gt;It supports label control via hints set by the OTel client/collector.&lt;/li&gt;
&lt;li&gt;Default labels:
&lt;ul&gt;
&lt;li&gt;job=service.namespace/service.name&lt;/li&gt;
&lt;li&gt;instance=service.instance.id&lt;/li&gt;
&lt;li&gt;exporter=OTLP&lt;/li&gt;
&lt;li&gt;level=severity&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Log Body: Encodes log records and attributes in json(default) or logfmt format.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Loki’s native OTel log ingestion endpoint&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Index Labels:
&lt;ul&gt;
&lt;li&gt;It supports label control via per-tenant OTLP configuration in Loki.&lt;/li&gt;
&lt;li&gt;By default, it picks some pre-configured resource attributes as index labels as explained 
    &lt;a href=&#34;/docs/loki/v3.7.x/send-data/otel/#format-considerations&#34;&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;LogLine: Stringified LogRecord.Body.&lt;/li&gt;
&lt;li&gt;Structured Metadata: Anything not stored in Index labels and LogLine gets stored as 
    &lt;a href=&#34;/docs/loki/v3.7.x/get-started/labels/structured-metadata/&#34;&gt;Structured Metadata&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;sample-log&#34;&gt;Sample Log&lt;/h3&gt;
&lt;p&gt;Let us take the following sample OTel log and see how it would look after ingestion in both formats with the default configuration:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Resource Attributes:
&lt;ul&gt;
&lt;li&gt;service.name: &amp;ldquo;auth&amp;rdquo;&lt;/li&gt;
&lt;li&gt;service.namespace: &amp;ldquo;dev&amp;rdquo;&lt;/li&gt;
&lt;li&gt;service.kind: &amp;ldquo;app&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Log Record:
&lt;ul&gt;
&lt;li&gt;Timestamp: 1715247552000000000&lt;/li&gt;
&lt;li&gt;Body: &amp;ldquo;user logged in&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Severity Text: &amp;ldquo;INFO&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Attributes:
&lt;ul&gt;
&lt;li&gt;email: &amp;ldquo;&lt;a href=&#34;mailto:foo@bar.com&#34;&gt;foo@bar.com&lt;/a&gt;&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Ingested with LokiExporter:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Index Labels:
&lt;ul&gt;
&lt;li&gt;job=&amp;ldquo;dev/auth&amp;rdquo;&lt;/li&gt;
&lt;li&gt;exporter=&amp;ldquo;OTLP&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Log Body: &lt;code&gt;{&amp;quot;body&amp;quot;:&amp;quot;user logged in&amp;quot;,&amp;quot;severity&amp;quot;:&amp;quot;INFO&amp;quot;,&amp;quot;attributes&amp;quot;:{&amp;quot;email&amp;quot;:&amp;quot;foo@bar.com&amp;quot;}, &amp;quot;resources&amp;quot;:{&amp;quot;service.kind&amp;quot;:&amp;quot;app&amp;quot;,&amp;quot;service.name&amp;quot;:&amp;quot;auth&amp;quot;,&amp;quot;service.namespace&amp;quot;:&amp;quot;dev&amp;quot;}}&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Ingested with Loki’s native OTel endpoint:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Index Labels:
&lt;ul&gt;
&lt;li&gt;service_name=&amp;ldquo;auth&amp;rdquo;&lt;/li&gt;
&lt;li&gt;service_namespace=&amp;ldquo;dev&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Log Body: &amp;ldquo;user logged in&amp;rdquo;&lt;/li&gt;
&lt;li&gt;Structured Metadata:
&lt;ul&gt;
&lt;li&gt;service_kind: &amp;ldquo;app&amp;rdquo;&lt;/li&gt;
&lt;li&gt;severity_text: &amp;ldquo;INFO&amp;rdquo;&lt;/li&gt;
&lt;li&gt;email: &amp;ldquo;&lt;a href=&#34;mailto:foo@bar.com&#34;&gt;foo@bar.com&lt;/a&gt;&amp;rdquo;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;querying-experience&#34;&gt;Querying experience&lt;/h3&gt;
&lt;p&gt;As seen earlier, LokiExporter encodes data to json or logfmt blob, which requires decoding it at query time to interact with OTel attributes.
However, the native OTel endpoint doesn&amp;rsquo;t do any encoding of data before storing it. It leverages 
    &lt;a href=&#34;/docs/loki/v3.7.x/get-started/labels/structured-metadata/&#34;&gt;Structured Metadata&lt;/a&gt;, which makes it easier to interact with OTel attributes without having to use any parsers in the queries.
Taking the above-ingested log line, let us look at how the querying experience would look between the two considering various scenarios:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Query all logs without any filters&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ingested with LokiExporter: &lt;code&gt;{job=&amp;quot;dev/auth&amp;quot;}&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Ingested with Loki’s native OTel endpoint: &lt;code&gt;{service_name=&amp;quot;auth&amp;quot;, service_namespace=&amp;quot;dev&amp;quot;}&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Query logs with severity INFO&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ingested with LokiExporter: &lt;code&gt;{job=&amp;quot;dev/auth&amp;quot;} | json | severity=&amp;quot;INFO&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Ingested with Loki’s native OTel endpoint: &lt;code&gt;{service_name=&amp;quot;auth&amp;quot;, service_namespace=&amp;quot;dev&amp;quot;} | severity_text=&amp;quot;INFO&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Display log message as log line in logs query results&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ingested with LokiExporter: &lt;code&gt;{job=&amp;quot;dev/auth&amp;quot;} | json | line_format &amp;quot;{{.body}}&amp;quot;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Ingested with Loki’s native OTel endpoint: &lt;code&gt;{service_name=&amp;quot;auth&amp;quot;, service_namespace=&amp;quot;dev&amp;quot;}&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Count login events in the last hour by email&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ingested with LokiExporter: &lt;code&gt;sum(count_over_time({job=&amp;quot;dev/auth&amp;quot;} |= &amp;quot;user logged in&amp;quot; | json[1h])) by (email)&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Ingested with Loki’s native OTel endpoint: &lt;code&gt;sum(count_over_time({service_name=&amp;quot;auth&amp;quot;, service_namespace=&amp;quot;dev&amp;quot;} |= &amp;quot;user logged in&amp;quot;[1h])) by (email)&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;benefits-of-switching-from-lokiexporter-to-native-otel-endpoint&#34;&gt;Benefits of switching from LokiExporter to native OTel endpoint&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Future improvements:&lt;/strong&gt; There is an ongoing discussion on deprecating LokiExporter, which would stop receiving future enhancements. Loki’s native OTel endpoint represents the future of our product, and all future development and enhancements will be focused there. Upgrading to the native endpoint will ensure you benefit from the latest enhancements and the best possible user experience.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simplified client config:&lt;/strong&gt; LokiExporter requires setting hints for managing stream labels, which defeats the purpose of choosing OTel in the first place since you can’t switch from one OTel-compatible storage to another without having to reconfigure your clients. With Loki’s native OTel endpoint, there is no added complexity in setting hints for your client to manage the labels.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simplified querying:&lt;/strong&gt; Loki’s native OTel endpoint leverages Structured Metadata, which makes it easier to reference the attributes and other fields from the OTel LogRecord without having to use json or logfmt parsers for decoding the data at query time.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;More modern high context data model:&lt;/strong&gt; Better aligned with modern observability practices than the older json based model.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;what-do-you-need-to-do-to-switch-from-lokiexporter-to-native-otel-ingestion-format&#34;&gt;What do you need to do to switch from LokiExporter to native OTel ingestion format?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Point your OpenTelemetry Collector to the Loki native OTel ingestion endpoint as explained 
    &lt;a href=&#34;/docs/loki/v3.7.x/send-data/otel/#loki-configuration&#34;&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Rewrite your LogQL queries in various places, including dashboards, alerts, starred queries in Grafana Explore, etc. to query OTel logs as per the new format.&lt;/li&gt;
&lt;/ul&gt;
]]></content><description>&lt;h1 id="how-is-native-otlp-endpoint-different-from-loki-exporter">How is native OTLP endpoint different from Loki Exporter&lt;/h1>
&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>OpenTelemetry (OTel) is quickly becoming an industry standard with increasing adoption. Prior to the Loki 3.0 release, there was no native support for ingesting OTel logs to Loki, which led to creation of the &lt;a href="https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/lokiexporter/README.md" target="_blank" rel="noopener noreferrer">LokiExporter&lt;/a>. While the LokiExporter got the job done of ingesting OTel logs to Loki, it did not provide a native user experience, and the querying experience was not optimal. As part of our effort to improve user experience with OTel, we added native OTel log ingestion support to Loki with 3.0 release.&lt;/p></description></item><item><title>Getting started with the OpenTelemetry Collector and Loki tutorial</title><link>https://grafana.com/docs/loki/v3.7.x/send-data/otel/otel-collector-getting-started/</link><pubDate>Thu, 09 Apr 2026 02:28:18 +0000</pubDate><guid>https://grafana.com/docs/loki/v3.7.x/send-data/otel/otel-collector-getting-started/</guid><content><![CDATA[&lt;!-- vale Grafana.We = NO --&gt;
&lt;!-- INTERACTIVE page intro.md START --&gt;
&lt;h1 id=&#34;getting-started-with-the-opentelemetry-collector-and-loki-tutorial&#34;&gt;Getting started with the OpenTelemetry Collector and Loki tutorial&lt;/h1&gt;
&lt;p&gt;The OpenTelemetry Collector offers a vendor-agnostic implementation of how to receive, process, and export telemetry data. With the introduction of the OTLP endpoint in Loki, you can now send logs from applications instrumented with OpenTelemetry to Loki using the OpenTelemetry Collector in native OTLP format.
In this example, we will teach you how to configure the OpenTelemetry Collector to receive logs in the OpenTelemetry format and send them to Loki using the OTLP HTTP protocol. This will involve configuring the following components in the OpenTelemetry Collector:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;OpenTelemetry Receiver:&lt;/strong&gt; This component will receive logs in the OpenTelemetry format via HTTP and gRPC.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OpenTelemetry Processor:&lt;/strong&gt; This component will accept telemetry data from other &lt;code&gt;otelcol.*&lt;/code&gt; components and place them into batches. Batching improves the compression of data and reduces the number of outgoing network requests required to transmit data.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OpenTelemetry Exporter:&lt;/strong&gt; This component will accept telemetry data from other &lt;code&gt;otelcol.*&lt;/code&gt; components and write them over the network using the OTLP HTTP protocol. We will use this exporter to send the logs to the Loki native OTLP endpoint.&lt;/li&gt;
&lt;/ul&gt;
&lt;!-- INTERACTIVE ignore START --&gt;
&lt;h2 id=&#34;dependencies&#34;&gt;Dependencies&lt;/h2&gt;
&lt;p&gt;Before you begin, ensure you have the following to run the demo:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Docker&lt;/li&gt;
&lt;li&gt;Docker Compose&lt;/li&gt;
&lt;/ul&gt;


&lt;div class=&#34;admonition admonition-tip&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Tip&lt;/p&gt;&lt;p&gt;Alternatively, you can try out this example in our interactive learning environment: &lt;a href=&#34;https://killercoda.com/grafana-labs/course/loki/otel-collector-getting-started&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Getting started with the OpenTelemetry Collector and Loki tutorial&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s a fully configured environment with all the dependencies already installed.&lt;/p&gt;
&lt;p&gt;&lt;img
  class=&#34;lazyload d-inline-block&#34;
  data-src=&#34;/media/docs/loki/loki-ile.svg&#34;
  alt=&#34;Interactive&#34;/&gt;&lt;/p&gt;
&lt;p&gt;Provide feedback, report bugs, and raise issues for the tutorial in the &lt;a href=&#34;https://github.com/grafana/killercoda&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Grafana Killercoda repository&lt;/a&gt;.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;!-- INTERACTIVE ignore END --&gt;
&lt;h2 id=&#34;scenario&#34;&gt;Scenario&lt;/h2&gt;
&lt;p&gt;In this scenario, we have a microservices application called the Carnivorous Greenhouse. This application consists of the following services:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;User Service:&lt;/strong&gt; Manages user data and authentication for the application. Such as creating users and logging in.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Plant Service:&lt;/strong&gt; Manages the creation of new plants and updates other services when a new plant is created.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Simulation Service:&lt;/strong&gt; Generates sensor data for each plant.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Websocket Service:&lt;/strong&gt; Manages the websocket connections for the application.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bug Service:&lt;/strong&gt; A service that when enabled, randomly causes services to fail and generate additional logs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Main App:&lt;/strong&gt; The main application that ties all the services together.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Database:&lt;/strong&gt; A database that stores user and plant data.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Each service generates logs using the OpenTelemetry SDK and exports to the OpenTelemetry Collector in the OpenTelemetry format (OTLP). The Collector then ingests the logs and sends them to Loki.&lt;/p&gt;
&lt;!-- INTERACTIVE page intro.md END --&gt;
&lt;!-- INTERACTIVE page step1.md START --&gt;
&lt;h2 id=&#34;step-1-environment-setup&#34;&gt;Step 1: Environment setup&lt;/h2&gt;
&lt;p&gt;In this step, we will set up our environment by cloning the repository that contains our demo application and spinning up our observability stack using Docker Compose.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;To get started, clone the repository that contains our demo application:&lt;/p&gt;
 &lt;!-- INTERACTIVE exec START --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;git clone -b microservice-otel-collector  https://github.com/grafana/loki-fundamentals.git&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;!-- INTERACTIVE exec END --&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next we will spin up our observability stack using Docker Compose:&lt;/p&gt;
 &lt;!-- INTERACTIVE ignore START --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;docker compose -f loki-fundamentals/docker-compose.yml up -d&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;!-- INTERACTIVE ignore END --&gt;

&lt;p&gt;To check the status of services we can run the following command:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;docker ps -a&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
 &lt;!-- INTERACTIVE ignore START --&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;The OpenTelemetry Collector container will show as &lt;code&gt;Stopped&lt;/code&gt; or &lt;code&gt;Exited (1) About a minute ago&lt;/code&gt;. This is expected as we have provided an empty configuration file. We will update this file in the next step.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

 &lt;!-- INTERACTIVE ignore END --&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;After we&amp;rsquo;ve finished configuring the OpenTelemetry Collector and sending logs to Loki, we will be able to view the logs in Grafana. To check if Grafana is up and running, navigate to the following URL: &lt;a href=&#34;http://localhost:3000&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://localhost:3000&lt;/a&gt;&lt;/p&gt;
&lt;!-- INTERACTIVE page step1.md END --&gt;
&lt;!-- INTERACTIVE page step2.md START --&gt;
&lt;h2 id=&#34;step-2-configuring-the-opentelemetry-collector&#34;&gt;Step 2: Configuring the OpenTelemetry Collector&lt;/h2&gt;
&lt;p&gt;To configure the Collector to ingest OpenTelemetry logs from our application, we need to provide a configuration file. This configuration file will define the components and their relationships. We will build the entire observability pipeline within this configuration file.&lt;/p&gt;
&lt;h3 id=&#34;open-your-code-editor-and-locate-the-otel-configyaml-file&#34;&gt;Open your code editor and locate the &lt;code&gt;otel-config.yaml&lt;/code&gt; file&lt;/h3&gt;
&lt;p&gt;The configuration file is written using &lt;strong&gt;YAML&lt;/strong&gt; configuration syntax. To start, we will open the &lt;code&gt;otel-config.yaml&lt;/code&gt; file in the code editor:&lt;/p&gt;

&lt;!-- INTERACTIVE ignore START --&gt;
&lt;ol&gt;
&lt;li&gt;Open the &lt;code&gt;loki-fundamentals&lt;/code&gt; directory in a code editor of your choice.&lt;/li&gt;
&lt;li&gt;Locate the &lt;code&gt;otel-config.yaml&lt;/code&gt; file in the &lt;code&gt;loki-fundamentals&lt;/code&gt; directory (Top level directory).&lt;/li&gt;
&lt;li&gt;Click on the &lt;code&gt;otel-config.yaml&lt;/code&gt; file to open it in the code editor.&lt;/li&gt;
&lt;/ol&gt;
&lt;!-- INTERACTIVE ignore END --&gt;
&lt;p&gt;You will copy all three of the following configuration snippets into the &lt;code&gt;otel-config.yaml&lt;/code&gt; file.&lt;/p&gt;
&lt;h3 id=&#34;receive-opentelemetry-logs-via-grpc-and-http&#34;&gt;Receive OpenTelemetry logs via gRPC and HTTP&lt;/h3&gt;
&lt;p&gt;First, we will configure the OpenTelemetry receiver. &lt;code&gt;otlp:&lt;/code&gt; accepts logs in the OpenTelemetry format via HTTP and gRPC. We will use this receiver to receive logs from the Carnivorous Greenhouse application.&lt;/p&gt;
&lt;p&gt;Now add the following configuration to the &lt;code&gt;otel-config.yaml&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Receivers
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this configuration:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;receivers&lt;/code&gt;: The list of receivers to receive telemetry data. In this case, we are using the &lt;code&gt;otlp&lt;/code&gt; receiver.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;otlp&lt;/code&gt;: The OpenTelemetry receiver that accepts logs in the OpenTelemetry format.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;protocols&lt;/code&gt;: The list of protocols that the receiver supports. In this case, we are using &lt;code&gt;grpc&lt;/code&gt; and &lt;code&gt;http&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;grpc&lt;/code&gt;: The gRPC protocol configuration. The receiver will accept logs via gRPC on &lt;code&gt;4317&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;http&lt;/code&gt;: The HTTP protocol configuration. The receiver will accept logs via HTTP on &lt;code&gt;4318&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;endpoint&lt;/code&gt;: The IP address and port number to listen on. In this case, we are listening on all IP addresses on port &lt;code&gt;4317&lt;/code&gt; for gRPC and port &lt;code&gt;4318&lt;/code&gt; for HTTP.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information on the &lt;code&gt;otlp&lt;/code&gt; receiver configuration, see the &lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector/blob/main/receiver/otlpreceiver/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Receiver OTLP documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;create-batches-of-logs-using-a-opentelemetry-processor&#34;&gt;Create batches of logs using a OpenTelemetry processor&lt;/h3&gt;
&lt;p&gt;Next add the following configuration to the &lt;code&gt;otel-config.yaml&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Processors
processors:
  batch:&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this configuration:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;processors&lt;/code&gt;: The list of processors to process telemetry data. In this case, we are using the &lt;code&gt;batch&lt;/code&gt; processor.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;batch&lt;/code&gt;: The OpenTelemetry processor that accepts telemetry data from other &lt;code&gt;otelcol&lt;/code&gt; components and places them into batches.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information on the &lt;code&gt;batch&lt;/code&gt; processor configuration, see the &lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector/blob/main/processor/batchprocessor/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Processor Batch documentation&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;export-logs-to-loki-using-a-opentelemetry-exporter&#34;&gt;Export logs to Loki using a OpenTelemetry exporter&lt;/h3&gt;
&lt;p&gt;We will use the &lt;code&gt;otlphttp/logs&lt;/code&gt; exporter to send the logs to the Loki native OTLP endpoint. Add the following configuration to the &lt;code&gt;otel-config.yaml&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Exporters
exporters:
  otlphttp/logs:
    endpoint: &amp;#34;http://loki:3100/otlp&amp;#34;
    tls:
      insecure: true&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this configuration:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;exporters&lt;/code&gt;: The list of exporters to export telemetry data. In this case, we are using the &lt;code&gt;otlphttp/logs&lt;/code&gt; exporter.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;otlphttp/logs&lt;/code&gt;: The OpenTelemetry exporter that accepts telemetry data from other &lt;code&gt;otelcol&lt;/code&gt; components and writes them over the network using the OTLP HTTP protocol.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;endpoint&lt;/code&gt;: The URL to send the telemetry data to. In this case, we are sending the logs to the Loki native OTLP endpoint at &lt;code&gt;http://loki:3100/otlp&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tls&lt;/code&gt;: The TLS configuration for the exporter. In this case, we are setting &lt;code&gt;insecure&lt;/code&gt; to &lt;code&gt;true&lt;/code&gt; to disable TLS verification.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;insecure&lt;/code&gt;: Disables TLS verification. This is set to &lt;code&gt;true&lt;/code&gt; as we are using an insecure connection.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For more information on the &lt;code&gt;otlphttp/logs&lt;/code&gt; exporter configuration, see the &lt;a href=&#34;https://github.com/open-telemetry/opentelemetry-collector/blob/main/exporter/otlphttpexporter/README.md&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Exporter OTLP HTTP documentation&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;creating-the-pipeline&#34;&gt;Creating the pipeline&lt;/h3&gt;
&lt;p&gt;Now that we have configured the receiver, processor, and exporter, we need to create a pipeline to connect these components. Add the following configuration to the &lt;code&gt;otel-config.yaml&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Pipelines
service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/logs]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;In this configuration:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pipelines&lt;/code&gt;: The list of pipelines to connect the receiver, processor, and exporter. In this case, we are using the &lt;code&gt;logs&lt;/code&gt; pipeline but there is also pipelines for metrics, traces, and continuous profiling.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;receivers&lt;/code&gt;: The list of receivers to receive telemetry data. In this case, we are using the &lt;code&gt;otlp&lt;/code&gt; receiver component we created earlier.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;processors&lt;/code&gt;: The list of processors to process telemetry data. In this case, we are using the &lt;code&gt;batch&lt;/code&gt; processor component we created earlier.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;exporters&lt;/code&gt;: The list of exporters to export telemetry data. In this case, we are using the &lt;code&gt;otlphttp/logs&lt;/code&gt; component exporter we created earlier.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;load-the-configuration&#34;&gt;Load the configuration&lt;/h3&gt;
&lt;p&gt;Before you load the configuration into the OpenTelemetry Collector, compare your configuration with the completed configuration below:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;YAML&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-yaml&#34;&gt;# Receivers
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318
        
# Processors
processors:
  batch:

# Exporters
exporters:
  otlphttp/logs:
    endpoint: &amp;#34;http://loki:3100/otlp&amp;#34;
    tls:
      insecure: true
      
# Pipelines
service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp/logs]&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Next, we need apply the configuration to the OpenTelemetry Collector. To do this, we will restart the OpenTelemetry Collector container:&lt;/p&gt;
&lt;!-- INTERACTIVE exec START --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;docker restart loki-fundamentals-otel-collector-1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;!-- INTERACTIVE exec END --&gt;
&lt;p&gt;This will restart the OpenTelemetry Collector container with the new configuration. You can check the logs of the OpenTelemetry Collector container to see if the configuration was loaded successfully:&lt;/p&gt;
&lt;!-- INTERACTIVE exec START --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;docker logs loki-fundamentals-otel-collector-1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Within the logs, you should see the following message:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;console&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-console&#34;&gt;2024-08-02T13:10:25.136Z        info    service@v0.106.1/service.go:225 Everything is ready. Begin running and processing data.&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;h2 id=&#34;stuck-need-help&#34;&gt;Stuck? Need help?&lt;/h2&gt;
&lt;p&gt;If you get stuck or need help creating the configuration, you can copy and replace the entire &lt;code&gt;otel-config.yaml&lt;/code&gt; using the completed configuration file:&lt;/p&gt;
&lt;!-- INTERACTIVE exec START --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;cp loki-fundamentals/completed/otel-config.yaml loki-fundamentals/otel-config.yaml
docker restart loki-fundamentals-otel-collector-1&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;!-- INTERACTIVE exec END --&gt;
&lt;!-- INTERACTIVE page step2.md END --&gt;
&lt;!-- INTERACTIVE page step3.md START --&gt;
&lt;h2 id=&#34;step-3-start-the-carnivorous-greenhouse&#34;&gt;Step 3: Start the Carnivorous Greenhouse&lt;/h2&gt;
&lt;p&gt;In this step, we will start the Carnivorous Greenhouse application. To start the application, run the following command:&lt;/p&gt;
&lt;!-- INTERACTIVE ignore START --&gt;


&lt;div class=&#34;admonition admonition-note&#34;&gt;&lt;blockquote&gt;&lt;p class=&#34;title text-uppercase&#34;&gt;Note&lt;/p&gt;&lt;p&gt;This docker-compose file relies on the &lt;code&gt;loki-fundamentals_loki&lt;/code&gt; docker network. If you have not started the observability stack, you will need to start it first.&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;

&lt;!-- INTERACTIVE ignore END --&gt;

&lt;!-- INTERACTIVE ignore START --&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;Bash&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-bash&#34;&gt;docker compose -f loki-fundamentals/greenhouse/docker-compose-micro.yml up -d --build &lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;!-- INTERACTIVE ignore END --&gt;

&lt;p&gt;This will start the following services:&lt;/p&gt;

&lt;div class=&#34;code-snippet &#34;&gt;&lt;div class=&#34;lang-toolbar&#34;&gt;
    &lt;span class=&#34;lang-toolbar__item lang-toolbar__item-active&#34;&gt;console&lt;/span&gt;
    &lt;span class=&#34;code-clipboard&#34;&gt;
      &lt;button x-data=&#34;app_code_snippet()&#34; x-init=&#34;init()&#34; @click=&#34;copy()&#34;&gt;
        &lt;img class=&#34;code-clipboard__icon&#34; src=&#34;/media/images/icons/icon-copy-small-2.svg&#34; alt=&#34;Copy code to clipboard&#34; width=&#34;14&#34; height=&#34;13&#34;&gt;
        &lt;span&gt;Copy&lt;/span&gt;
      &lt;/button&gt;
    &lt;/span&gt;
    &lt;div class=&#34;lang-toolbar__border&#34;&gt;&lt;/div&gt;
  &lt;/div&gt;&lt;div class=&#34;code-snippet &#34;&gt;
    &lt;pre data-expanded=&#34;false&#34;&gt;&lt;code class=&#34;language-console&#34;&gt; ✔ Container greenhouse-db-1                 Started                                                         
 ✔ Container greenhouse-websocket_service-1  Started 
 ✔ Container greenhouse-bug_service-1        Started
 ✔ Container greenhouse-user_service-1       Started
 ✔ Container greenhouse-plant_service-1      Started
 ✔ Container greenhouse-simulation_service-1 Started
 ✔ Container greenhouse-main_app-1           Started&lt;/code&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Once started, you can access the Carnivorous Greenhouse application at &lt;a href=&#34;http://localhost:5005&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://localhost:5005&lt;/a&gt;. Generate some logs by interacting with the application in the following ways:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a user.&lt;/li&gt;
&lt;li&gt;Log in.&lt;/li&gt;
&lt;li&gt;Create a few plants to monitor.&lt;/li&gt;
&lt;li&gt;Enable bug mode to activate the bug service. This will cause services to fail and generate additional logs.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Finally to view the logs in Loki, navigate to the Loki Logs Explore view in Grafana at &lt;a href=&#34;http://localhost:3000/a/grafana-lokiexplore-app/explore&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;http://localhost:3000/a/grafana-lokiexplore-app/explore&lt;/a&gt;.&lt;/p&gt;
&lt;!-- INTERACTIVE page step3.md END --&gt;
&lt;!-- INTERACTIVE page finish.md START --&gt;
&lt;h2 id=&#34;summary&#34;&gt;Summary&lt;/h2&gt;
&lt;p&gt;In this example, we configured the OpenTelemetry Collector to receive logs from an example application and send them to Loki using the native OTLP endpoint. Make sure to also consult the Loki configuration file &lt;code&gt;loki-config.yaml&lt;/code&gt; to understand how we have configured Loki to receive logs from the OpenTelemetry Collector.&lt;/p&gt;

&lt;h2 id=&#34;further-reading&#34;&gt;Further reading&lt;/h2&gt;
&lt;p&gt;For more information on the OpenTelemetry Collector and the native OTLP endpoint of Loki, refer to the following resources:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/loki/v3.7.x/send-data/otel/&#34;&gt;Loki OTLP endpoint&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
    &lt;a href=&#34;/docs/loki/v3.7.x/send-data/otel/native_otlp_vs_loki_exporter/&#34;&gt;How is native OTLP endpoint different from Loki Exporter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://opentelemetry.io/docs/collector/configuration/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenTelemetry Collector Configuration&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;complete-metrics-logs-traces-and-profiling-example&#34;&gt;Complete metrics, logs, traces, and profiling example&lt;/h2&gt;
&lt;p&gt;If you would like to use a demo that includes Mimir, Loki, Tempo, and Grafana, you can use &lt;a href=&#34;https://github.com/grafana/intro-to-mlt&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;Introduction to Metrics, Logs, Traces, and Profiling in Grafana&lt;/a&gt;. &lt;code&gt;Intro-to-mltp&lt;/code&gt; provides a self-contained environment for learning about Mimir, Loki, Tempo, and Grafana.&lt;/p&gt;
&lt;p&gt;The project includes detailed explanations of each component and annotated configurations for a single-instance deployment. Data from &lt;code&gt;intro-to-mltp&lt;/code&gt; can also be pushed to Grafana Cloud.&lt;/p&gt;
&lt;!-- INTERACTIVE page finish.md END --&gt;
&lt;!-- vale Grafana.We = YES --&gt;]]></content><description>&lt;!-- vale Grafana.We = NO -->
&lt;!-- INTERACTIVE page intro.md START -->
&lt;h1 id="getting-started-with-the-opentelemetry-collector-and-loki-tutorial">Getting started with the OpenTelemetry Collector and Loki tutorial&lt;/h1>
&lt;p>The OpenTelemetry Collector offers a vendor-agnostic implementation of how to receive, process, and export telemetry data. With the introduction of the OTLP endpoint in Loki, you can now send logs from applications instrumented with OpenTelemetry to Loki using the OpenTelemetry Collector in native OTLP format.
In this example, we will teach you how to configure the OpenTelemetry Collector to receive logs in the OpenTelemetry format and send them to Loki using the OTLP HTTP protocol. This will involve configuring the following components in the OpenTelemetry Collector:&lt;/p></description></item></channel></rss>