Skip to content
/ gelato Public

Telemetry + Elastic Search Helper

Notifications You must be signed in to change notification settings

kantox/gelato

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gelato Gelato

An opinionated logger backend helper library to log events with telemetry attached.

Installation

def deps do
  [
    {:gelato, "~> 0.2"}
  ]
end

Usage

# sends the single event with attached process info to Elastic server
Logger.info "users", name: "John", reference: "U-123456789"

# sends the “in” and “out” events to Elastic server, with some collected
#   stats in “out” events; discards process info
Gelato.bench :info, "users", name: "John", reference: "U-123456789", process_info: "N/A"

Besides Gelato.bench/4, this library provides Gelato.defdelegatelog/2 macro that might be used for mastering interfaces to internal codepieces featured by telemetry log.

Once delegated, the function is being wrapped into Gelato.bench/4 call. The following example is taken from tests.

defmodule Gelato.Test.DDL.Helper do
  @moduledoc false
  def yo(arg), do: {:ok, arg}
end

defmodule Gelato.Test.DDL.Test do
  @moduledoc false
  use Gelato

  defdelegatelog yo_test(arg),
                 to: Gelato.Test.DDL.Helper,
                 as: :yo,
                 level: :warn,
                 tag: "app",
                 entity: :ddl
end

About

Telemetry + Elastic Search Helper

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages