Otelcol (otelcol v0.1.2) View Source

Otelcol is an installer and runner for OpenTelemetry Collector.

Profiles

You can define multiple otelcol profiles. By default, there is a profile called :default which you can configure its args, current directory and environment:

config :otelcol,
  version: "0.46.0",
  default: [
    args: ~w(
      --config=config/otel-collector.yml
    )
  ]

Otelcol configuration

There is one global configuration for the otelcol application:

  • :version - the expected otecol-contrib version

Installation

The first time this package is installed, two things will happen:

  • a default otelcol configuration will be placed in a new config/otel-collector.yml file, if it doesn't already exist. See the otel-collector documentation on configuration options.

  • a "zombie process" wrapper script will be written along-side the otelcol-contrib binary. This wrapper requires bash and is needed to shut down otelcol properly when the local server exits. This is not meant for production use.

Link to this section Summary

Functions

Returns the path to the executable.

Returns the version of the otelcol executable.

Returns the configuration for the given profile.

Returns the configured otelcol version.

Installs otelcol with configured_version/0.

Installs, if not available, and then runs otelcol.

Runs the given command with args.

Link to this section Functions

Returns the path to the executable.

The executable may not be available if it was not yet installed.

Returns the version of the otelcol executable.

Returns {:ok, version_string} on success or :error when the executable is not available.

Returns the configuration for the given profile.

Returns nil if the profile does not exist.

Returns the configured otelcol version.

Installs otelcol with configured_version/0.

Link to this function

install_and_run(profile, args)

View Source

Installs, if not available, and then runs otelcol.

Returns the same as run/2.

Link to this function

run(profile, extra_args)

View Source

Runs the given command with args.

The given args will be appended to the configured args. The task output will be streamed directly to stdio. It returns the status of the underlying call.