You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Minor Issues with OTel Blogs & Document Yarn Setup Step (#2191)
* docs: add yarn setup step to readme
* fix: address minor issues in otel logs blog
* fix: fix typo and logical error in comment
* chore: move collector video at the end of collector section
* fix: remove formatting changes
* fix: remove auto-commit formatting changes
* fix: python indentation in example
Copy file name to clipboardExpand all lines: data/blog/opentelemetry-collector-complete-guide.mdx
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,10 +25,6 @@ This guide will provide a comprehensive overview of the OpenTelemetry Collector,
25
25
26
26
<ahref="https://opentelemetry.io/"rel="noopener noreferrer">OpenTelemetry</a> is an open-source observability framework, incubated by the Cloud Native Computing Foundation (<ahref="https://www.cncf.io/"rel="noopener noreferrer">CNCF</a>), that standardizes how telemetry data (logs, metrics, traces) is generated and collected. After instrumenting your applications with OpenTelemetry SDKs, the Collector is the next critical piece for managing that data.
27
27
28
-
Check out the video for a quick walkthrough of OpenTelemetry Collector.
29
-
30
-
<YouTubeid="KFesgjzK3gk"mute={false}/>
31
-
32
28
## What is the OpenTelemetry Collector?
33
29
34
30
In very simple words, the collector is an agent that sits between your instrumented services, collects the telemetry data that is emitted by the services, processes it and sends it to an observability backend.
@@ -39,6 +35,10 @@ The below animation shows the flow of data through the collector. You can try th
39
35
40
36
Apart from acting as a buffer, the collector also acts as a *translation layer;* it supports the native OpenTelemetry Protocol [OTLP] for ingesting data, but can also accept other formats [like Jaeger trace data or [Prometheus metrics](https://signoz.io/guides/what-are-the-4-types-of-metrics-in-prometheus/)] and translate them on the fly.
41
37
38
+
Check out the video for a quick walkthrough of OpenTelemetry Collector.
39
+
40
+
<YouTubeid="KFesgjzK3gk"mute={false}/>
41
+
42
42
## Why Use an OpenTelemetry Collector?
43
43
44
44
Using a Collector is a best practice for several key reasons:
@@ -263,4 +263,4 @@ With SigNoz, you can visualize all your logs, metrics, and traces in a single pa
263
263
264
264
**[OpenTelemetry Logs - A Complete Introduction & Implementation](https://signoz.io/blog/opentelemetry-logs/)**<br />
265
265
266
-
**[Monitor Nodejs Application with OpenTelemetry and SigNoz](https://signoz.io/opentelemetry/nodejs/)**<br />
266
+
**[Monitor Nodejs Application with OpenTelemetry and SigNoz](https://signoz.io/opentelemetry/nodejs/)**<br />
OpenTelemetry is a Cloud Native Computing Foundation(<ahref="https://www.cncf.io/"rel="noopener noreferrer nofollow"target="_blank" >CNCF</a>) incubating project aimed at standardizing the way we instrument applications for generating telemetry data(logs, metrics, and traces). OpenTelemetry aims to provide a vendor-agnostic observability framework that provides a set of tools, APIs, and SDKs to instrument applications.
Modern-day software systems are built with many pre-built components taken from the open source ecosystem like web frameworks, databases, HTTP clients, etc. Instrumenting such a software system in-house can pose a huge challenge. And using vendor-specific instrumentation agents can create a dependency. OpenTelemetry provides an open source instrumentation layer that can instrument various technologies like open source libraries, programming languages, databases, etc.
@@ -39,10 +37,9 @@ OpenTelemetry provides instrumentation libraries for your application. The devel
<figcaption><i>How OpenTelemetry fits in an application architecture. OTel collector refers to OpenTelemetry Collector</i></figcaption>
40
+
<figcaption><i>How OpenTelemetry fits in an application architecture. OTel is the convenient short form for OpenTelemetry</i></figcaption>
43
41
</figure>
44
42
45
-
46
43
OpenTelemetry libraries can be used to generate logs, metrics, and traces. You can then collect these signals with OpenTelemetry Collector or send them to an observability backend of your choice. In this article, we will focus on [OpenTelemetry logs](https://signoz.io/comparisons/opentelemetry-events-vs-logs/). OpenTelemetry can be used to collect log data and process it. Let's explore OpenTelemetry logs further.
47
44
48
45
[](https://signoz.io/teams/)
@@ -220,7 +217,7 @@ In OpenTelemetry, there are two important context IDs for context propagation.
220
217
A trace is a complete breakdown of a transaction as it travels through different components of a distributed system. Each trace gets a [trace ID](https://signoz.io/comparisons/opentelemetry-trace-id-vs-span-id/) that helps to correlate all events connected with a single trace.
221
218
222
219
-**Span IDs**<br></br>
223
-
A trace consists of multiple spans. Each span represents a single unit of logical work in the trace data. Spans have span ids that are used to represent the parent-child relationship.
220
+
A trace consists of multiple spans. Each span represents a single unit of logical work in the trace data. Spans have span IDs that are used to represent the parent-child relationship.
224
221
<figuredata-zoomablealign='center'>
225
222
<imgsrc="/img/blog/2025/09/otel-spans.webp"alt="Traces in SigNoz"/>
226
223
<figcaption><i>A trace graph broken down into individual spans visualized as Flamegraphs and Gantt charts in SigNoz dashboard</i></figcaption>
@@ -269,17 +266,16 @@ from its SDK.
269
266
Here's an example of using OpenTelemetry's [LoggingInstrumentor](https://opentelemetry-python-contrib.readthedocs.io/en/latest/instrumentation/logging/logging.html) to instrument the logging library to automatically add trace context in a Python application.
270
267
271
268
```python
272
-
273
-
import logging
274
-
from opentelemetry.instrumentation.logging import LoggingInstrumentor
275
-
276
-
# Instrument the logging library to automatically add trace context
# Now, any log created within an active trace will automatically
276
+
# include trace_id and span_id in its record.
277
+
logging.basicConfig(level=logging.INFO)
278
+
logging.info("User login successful.")
283
279
```
284
280
285
281
**Example 2. Instrumenting in Java with a Log Appender**
@@ -311,16 +307,12 @@ application's source code as shown in the below example.
311
307
</Root>
312
308
</Loggers>
313
309
</Configuration>
314
-
315
310
```
316
311
317
312
As you can see, while the mechanism differs by language ecosystem (Handlers in Python, Appenders in Java), the
318
313
underlying idea is the same, i.e, integrate the OpenTelemetry SDK with your existing logging framework to automatically enrich
319
314
all your logs with invaluable trace context.
320
315
321
-
322
-
323
-
324
316
### Collecting third-party application log data
325
317
326
318
Logs emitted by third-party applications running on the system are known as third-party application logs. The logs are typically written to stdout, files, or other specialized mediums.
@@ -430,7 +422,7 @@ how you can perform log analytics. The logs tab in SigNoz has advanced features
0 commit comments