Code Monkey home page Code Monkey logo

otelcol's Introduction

Otelcol (OpenTelemetry Collector)

CI

Mix tasks for installing and invoking otelcol-contrib. Copied from tailwind, with the intent of easily running an OpenTelemetry Collector next to the server, in development. It uses the contrib version to have as many options for export as possible.

Installation

Otelcol is intended as a development-only tool. Make sure to specify only: :dev in your mix.exs:

def deps do
  [
    {:otelcol, "~> 0.1", only: :dev}
  ]
end

Once installed, change your config/config.exs to pick your otelcol version of choice:

config :otelcol, version: "0.45.0"

Now you can install otelcol-contrib by running:

$ mix otelcol.install

And invoke otelcol with:

$ mix otelcol default

The executable is kept at _build/otelcol-contrib.

Profiles

The first argument to otelcol is the execution profile. You can define multiple execution profiles with the current directory, the OS environment, and default arguments to the otelcol task:

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

When mix otelcol default is invoked, the task arguments will be appended to the ones configured above. Note profiles must be configured in your config/config.exs, as otelcol runs without starting your application (and therefore it won't pick settings in config/runtime.exs).

Adding to Phoenix

To add otelcol to an application using Phoenix, you need one more step. Installation requires that Phoenix watchers can accept module-function-args tuples which is not built into Phoenix 1.5.9.

For development, we want to use "watch" mode, even though we're not really watching any files. So find the watchers configuration in your config/dev.exs and add:

  otelcol: {Otelcol, :install_and_run, [:default, []]}

Otelcol Configuration

The first time this package is installed, a default otelcol configuration will be placed in a new config/otel-collector.yml file. See the otelcol documentation on configuration options.

License

Copyright (c) 2022 Kenichi Nakamura. copied/modded from https://github.com/phoenixframework/tailwind Copyright (c) 2021 Wojtek Mach, José Valim.

otelcol source code is licensed under the MIT License.

otelcol's People

Contributors

kenichi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.