25 Nisan 2023 Salı

OpenTelemetry Collector

Deployment
İki yöntem var
1. Sidecar
2. A Central (Gateway) OpenTelemetry Collector

1. Sidecar
Açıklaması şöyle
In this scenario, the OpenTelemetry instrumented application sends the data to a (collector) agent that resides together with the application. This agent will then offload responsibility and handle all the trace data from the instrumented application.

The collector can be deployed as an agent via a sidecar which can be configured to send data directly to the storage backend.
Şeklen şöyle
2. A Central (Gateway) OpenTelemetry Collector
Açıklaması şöyle
You can also decide to send the data to another OpenTelemetry collector and from the (central) collector send the data further to the storage backend. In this configuration, we have a central OpenTelemetry collector that is deployed using the deployment mode, which comes with many advantages like auto scaling.
Collector Bileşenleri
Şeklen şöyle

OpenTelemetry Collector üzerinde 3 tane bileşen var. Bunlar
1. Receivers
2. Processors
3. Exporters

OpenTelemetry Protocol
Açıklaması şöyle
OpenTelemetry Protocol (OTLP) specification describes the encoding, transport, and delivery mechanism of telemetry data between telemetry sources, intermediate nodes such as collectors and telemetry backends. 

Each language SDK provides an OTLP exporter you can configure to export data over OTLP. The OpenTelemetry SDK then transforms events into OTLP data.
1. Receivers
Açıklaması şöyle
A receiver, which can be push or pull based, is how data gets into the collector. The OpenTelemetry collector can receive telemetry data in multiple formats.
Örnek - gRPC
Şöyle yaparız
otlp:
  protocols:
    grpc:
      endpoint: "0.0.0.0:4317"
Örnek - gRPC + Http
Şöyle yaparız
otlp:
protocols: grpc: http:
2. Processors
Açıklaması şöyle
Processors are run on data between being received and being exported. Processors are optional though some are recommended
batch Processor
Açıklaması şöyle
The batch processor accepts spans, metrics, or logs and places them into batches. Batching helps better compress the data and reduce the number of outgoing connections required to transmit the data. This processor supports both size and time based batching.
Örnek
Açıklaması şöyle
Configuring a processor does not enable it. Processors are enabled via pipelines within the service section.
Şöyle yaparız
service:
  traces:
    receivers: [opencensus, jaeger]
    processors: [batch]
    exporters: [opencensus, zipkin]
  ...
processors:
  batch:
3. Exporters
Açıklaması şöyle
In order to visualise and analyse the telemetry you will need to use an exporter. An exporter is a component of OpenTelemetry and is how data gets sent to different systems/back-ends.
Açıklaması şöyle. Yani OpenTelemetry protocol (OTLP) formatındaki veriyi başka bir formata çevirir.
Generally, an exporter translates the internal format into another defined format, so you can send different types of data to different backends. For example, you can send metrics (i.e Prometheus) to one backend and traces to another.
Açıklaması şöyle
- The Jaeger exporter is used to send data to Jaeger.

The Logging exporter is very useful when troubleshooting as it exports data to the console

Console Exporter
Açıklaması şöyle
A common exporter to start with and that is very useful for development and debugging tasks is the console exporter.
Örnek
Açıklaması şöyle
In the exporters section, you can add more destinations. For example, if you would also like to send trace data to Grafana Tempo, just add these lines to the central_collector.yaml file.
Şöyle yaparız
pipelines:
  traces:
    receivers: [otlp]
    processors: []
    exporters: [logging, otlp]

exporters:
  logging:
  otlp:
   endpoint: "<tempo_endpoint>"
   headers:
     authorization: Basic <api_token>
4. Extensions
Açıklaması şöyle
Extensions are available primarily for tasks that do not involve processing telemetry data. Examples of extensions include health monitoring, service discovery, and data forwarding. Extensions are optional.
Örnek
Şöyle yaparız
extensions:
  health_check:
  pprof:
  zpages:
  memory_ballast:
    size_mib: 512



Hiç yorum yok:

Yorum Gönder