iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
💭

A Review of OpenTelemetry Collector Deployment Patterns

に公開

This article is for Day 5 of the OpenTelemetry Advent Calendar 2025.
https://qiita.com/advent-calendar/2025/otel

It is written based on information as of December 2025.

Introduction

In this article, I will review the deployment patterns for collecting signals using the OpenTelemetry Collector.

All basic patterns are summarized in the official OpenTelemetry documentation below, so please refer to that as well.

https://opentelemetry.io/docs/collector/deployment/

Based on my experience trying all the patterns introduced above, I will present them with supplemental notes on points to consider in actual operations.

Deployment Patterns

1. No Collector Pattern

https://opentelemetry.io/docs/collector/deployment/no-collector/

In this pattern, you do not use the OpenTelemetry Collector or other components. Instead, you instrument your application and send data directly to the observability backend.

The Pros & Cons listed on the official website are as follows:

Pros:

  • Straightforward to use, especially in development and test environments
  • No additional moving parts to deploy or operate

Cons:

  • Requires code changes if collection, processing, or ingestion needs change
  • Strong coupling between application code and backend storage or visualization
  • Each language implementation supports only a limited number of exporters

In this pattern, you often use the SDK provided by each observability backend or the OpenTelemetry SDK.

This is often the first pattern used when introducing observability.

It is easy to use just by instrumenting the application.

Notes on Instrumentation

On the other hand, because data is sent directly from the application, you must manage authentication information within the application. Even when using managed services from cloud vendors, you need to set up IAM or Service Accounts for each application. When using SaaS, you must hold authentication information on the application side.

Also, if you want to use a different observability backend, you need to change the instrumented code in your application. Note: If you are using the OpenTelemetry SDK, you might be able to handle this just by replacing the exporter.

Notes on Operations

In this pattern, you basically need to send the data generated by the application as-is to the observability backend, which can lead to cost-related challenges.

While probabilistic sampling (head-based sampling) is supported by observability backends and the OpenTelemetry SDK, you generally send all generated data and must configure sampling or filtering on the observability backend side.

Depending on the pricing model of each observability backend, many adopt a billing system based on the amount of data sent. With this pattern, as the amount of sent data increases, costs may also increase.

When to Switch to Other Patterns

This pattern is the simplest and easiest to start with when introducing observability. You should consider switching to the patterns described later when challenges arise, such as wanting to try various observability backends or being concerned about costs.

2. Agent Pattern

In this pattern, instead of sending data directly from the application to the observability backend, an agent is placed in between.

The Pros & Cons listed on the official website are as follows:

Pros:

  • Straightforward to get started
  • Clear one-to-one mapping between application and Collector

Cons:

  • Limited scalability for teams and infrastructure resources
  • Inflexible for complex or evolving deployments

Unlike the Gateway pattern described later, which uses a load balancer, this pattern sends data from the application to a specific agent.

While the OpenTelemetry documentation uses OTLP, some SaaS providers like New Relic or Datadog may offer their own proprietary protocols.

You can deploy the target agent in various formats, such as on the same host, as a sidecar, or as an independent service.

You should follow the methods recommended by each tool to decide which format to deploy.

When using the OpenTelemetry Collector in a Kubernetes environment, it is recommended to consider the order of Deployment > DaemonSet > Sidecar.

Deploying as a Deployment offers the following benefits:

  • Centrally managed configuration
  • Easy to modify resources

Of course, this also depends on the characteristics of the service you are operating.

As the service scales up, the load on the agent side increases. Since a Deployment concentrates the load, using a DaemonSet to distribute the load across agents is another option.

When using a sidecar, an agent is launched for each Pod. While this helps reduce load, it consumes significant resources, so you need to be careful about costs. Additionally, using sidecars increases the operational burden, such as managing configuration file changes and version upgrades.

In this pattern, by using an agent, you can perform sampling and filtering not only on the observability backend but also on the agent side. Note: Generally, only head-based sampling or filtering per span is possible in this pattern.

It is also possible to have the agent collect various pieces of information and attach them to trace data as attributes. For example, with an agent deployed as a DaemonSet, you can attach information like the Kubernetes node version or cloud zone where the application is running.

This allows you to attach necessary infrastructure information to trace data collectively during investigations without requiring the application to perform instrumentation to collect such information.

Notes on Instrumentation

In this pattern, you do not need to consider authentication information on the application side, allowing for a separation of responsibilities between instrumentation and operations. On the other hand, similar to the No Collector pattern, depending on the instrumentation method, you may need to change the code for each observability backend.

Notes on Operations

One operational consideration is that the number of components to manage increases compared to the No Collector pattern. Generally, if this agent becomes unable to process data, all trace data will be lost, hindering investigations. It defeats the purpose if you cannot perform investigations during application/service outages, so higher reliability than the application/service itself is required.

Even if you are using an agent provided by an observability backend, handling version upgrades for that agent is mandatory. Also, since the agent consumes infrastructure resources, the cost to the user will increase.

When to Switch to Other Patterns

As for the timing to switch from this pattern to the Gateway pattern described later, it is recommended to consider it when more complex requirements arise, such as "wanting to introduce tail-based sampling."

3. Gateway Pattern

In this pattern, instead of sending data directly from the application to the collector, a load balancer is placed in between to distribute data across multiple collectors.

The Pros & Cons listed on the official website are as follows:

Pros:

  • Separation of concerns such as centrally managed credentials
  • Centralized policy management (for example, filtering certain logs or sampling)

Cons:

  • It’s one more thing to maintain and that can fail (complexity)
  • Added latency in case of cascaded collectors
  • Higher overall resource usage (costs)

In addition to the benefits of the Agent pattern, this pattern allows for load balancing at the collector layer and more flexible sampling and filtering.

As for the configuration on the application side, since it is the same as the Agent pattern (setting the destination), no additional action is required.

Notes on Instrumentation

Notes on instrumentation are the same as those for the Agent pattern.

Notes on Operations

Compared to the Agent pattern, this pattern introduces an additional load balancer layer, increasing the number of components to manage.

You can reduce operational costs by using managed services from cloud providers or Kubernetes Services.

If you want more flexible load balancing using span information, you can achieve this by using the loadbalancingexporter of the OpenTelemetry Collector.

https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/exporter/loadbalancingexporter

By using loadbalancingexporter, you can perform load balancing related to trace data, such as sending all spans associated with a specific trace to the same collector, in addition to general request-based load balancing.

Bonus: Agent + Gateway Pattern

The patterns introduced above can be combined as needed.

For example, if you want to introduce large-scale tail-based sampling, you can achieve this by combining the Agent and Gateway patterns as follows:

You can deploy the agent on the same host as the application using a DaemonSet to receive data from the application first. In this process, the agent can attach host information to the trace data.

Then, data is sent from the agent to the collectors configured in the Gateway pattern to perform tail-based sampling.

In this pattern, by separating the responsibilities—using the front-end agent for attaching information and the back-end agent for processing such as sampling and filtering—you can achieve a better separation of concerns and load distribution.

Conclusion

In this article, I reviewed the deployment patterns for the OpenTelemetry Collector. Since each pattern has its own pros and cons, it is important to select the optimal pattern based on the characteristics and requirements of the service you are operating.

For knowledge regarding actual services and operations that could not be fully covered in this article, please take a look at the following reference presentations.

Reference Presentations

https://speakerdeck.com/tetsuya28/abema-trace-sampling-observability-cost-optimization-f4d43a88-8257-4bc1-be03-5c9b2333c8da

https://speakerdeck.com/tetsuya28/datadog-distribution-of-opentelemetry-collector-intro

https://speakerdeck.com/nagapad/bu-que-shi-xing-nibei-eru-abema-noxin-lai-xing-she-ji-toobuzababiriteiji-pan

Reference Repository

I found a repository that summarizes OpenTelemetry Collector configuration files for various deployment patterns, including those introduced in this article, so I am sharing it here.

https://github.com/jpkrohling/opentelemetry-collector-deployment-patterns/

Discussion