入门
如果您不熟悉适用于收集器的部署模型、组件和存储库,请首先查看数据收集和开发方法页面。
演示¶
部署负载生成器、代理和网关以及 Jaeger、Zipkin 和 Prometheus 后端。更多信息可以在 演示README.md中找到。
Docker¶
提取 docker 映像并在容器中运行收集器。将{{% param collectorVersion %}}
替换为要
运行的收集器的版本。
要从当前工作目录加载自定义配置 config.yaml
,将该文件挂载为卷:
Docker Compose¶
你可以像下面这样添加 OpenTelemetry 收集器到你现有的docker-compose.yaml
中:
Kubernetes¶
将代理部署为守护进程和单个网关实例。
上面的示例旨在作为一个起点,在实际生产使用之前进行扩展和定制。对于生产就绪的定制 和安装,请参见OpenTelemetry Helm Charts。
OpenTelemetry Operator也可用于提供和维护 OpenTelemetry Collector 实例,具有 自动升级处理、基于 OpenTelemetry 配置的“服务”配置、自动侧车注入部署等功能。
Nomad¶
将 Collector 部署为代理、网关和完整演示的参考作业文件可以在Getting Started with OpenTelemetry on HashiCorp Nomad中找到。
Linux 包¶
每个 Collector 版本都包含 Linux amd64/arm64/i386 系统的 APK、DEB 和 RPM 包。包中 包含一个默认配置,可以在“/etc/otelcol/config”中找到。yaml 的安装后。
Note: 自动服务配置需要
systemd
。
APK 安装¶
要在 alpine 系统上开始运行,请运行以下命令,将 v{{% param collectorVersion %}}
替换为您希望运行的 Collector 版本。
DEB 安装¶
To get started on Debian systems run the following replacing
v{{% param collectorVersion %}}
with the version of the Collector you wish to
run and amd64
with the appropriate architecture.
RPM 安装¶
To get started on Red Hat systems run the following replacing
v{{% param collectorVersion %}}
with the version of the Collector you wish to
run and x86_64
with the appropriate architecture.
手动安装¶
Linux releases are available for various architectures. It's possible to download the archive containing the binary and install it on your machine manually:
{{< tabpane lang=shell persistLang=false >}} {{< tab AMD64 >}}
业务自动配置¶
By default, the otelcol
systemd service will be started with the
--config=/etc/otelcol/config.yaml
option after installation. To customize
these options, modify the OTELCOL_OPTIONS
variable in the
/etc/otelcol/otelcol.conf
systemd environment file with the appropriate
command-line options (run /usr/bin/otelcol --help
to see all available
options). Additional environment variables can also be passed to the otelcol
service by adding them to this file.
If either the Collector configuration file or /etc/otelcol/otelcol.conf
are
modified, restart the otelcol
service to apply the changes by running:
To check the output from the otelcol
service, run:
MacOS 包¶
MacOS releases are available for Intel- & ARM-based systems. They are
packaged as gzipped tarballs (.tar.gz
) and will need to be unpacked with a
tool that supports this compression format:
Every Collector release includes an otelcol
executable that you can run after
unpacking.
Windows 包¶
Windows releases are packaged as gzipped tarballs (.tar.gz
) and will need
to be unpacked with a tool that supports this compression format.
Every Collector release includes an otelcol.exe
executable that you can run
after unpacking.
本地¶
Builds the latest version of the collector based on the local operating system, runs the binary with all receivers enabled and exports all the data it receives locally to a file. Data is sent to the container and the container scrapes its own Prometheus metrics. The following example uses two terminal windows to better illustrate the collector. In the first terminal window run the following:
In a second terminal window, you can test the newly built collector by doing the following:
To stop the client, use type Ctrl-C. To stop the server, use the
kill $pid1
command. To stop the collector, type Ctrl-C in its
terminal window as well.
Note
上面显示的命令在bash shell中演示了这个过程。 对于其他shell,这些命令可能略有不同。