This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule ExChain.BlockChain.Block do | |
@moduledoc """ | |
This module is the single block struct in a blockchain | |
""" | |
defstruct ~w(timestamp last_hash hash data)a | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Alpha do | |
@moduledoc """ | |
Documentation for `Alpha`. | |
""" | |
require OpenTelemetry.Tracer | |
def start_call() do | |
OpenTelemetry.Tracer.with_span "alpha-span" do | |
delay = 100 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Alpha.Application do | |
... | |
def start(_type, _start) do | |
_ = OpenTelemetry.register_application_tracer(:alpha) | |
children = [ | |
# Starts a worker by calling: Alpha.Worker.start_link(arg) | |
# {Alpha.Worker, arg} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Config | |
config :opentelemetry, | |
:processors, | |
ot_batch_processor: %{ | |
exporter: | |
{:opentelemetry_zipkin, | |
%{ | |
address: 'http://localhost:9411/api/v2/spans', | |
local_endpoint: %{service_name: "alpha"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Alpha.MixProject do | |
... | |
defp deps do | |
[ | |
{:opentelemetry, "~> 0.4.0"}, | |
{:opentelemetry_api, "~> 0.3.2"}, | |
{:opentelemetry_zipkin, "~> 0.2.0"} | |
] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule OpenTelemetryDemo.Application do | |
# See https://hexdocs.pm/elixir/Application.html | |
# for more information on OTP Applications | |
@moduledoc """ | |
OpenTelemetryDemo entry point | |
""" | |
use Application | |
@impl true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Mix.Config | |
config :opentelemetry, | |
:processors, | |
ot_batch_processor: %{ | |
exporter: | |
{:opentelemetry_zipkin, | |
%{ | |
address: 'http://localhost:9411/api/v2/spans', | |
local_endpoint: %{service_name: "open_telemetry_demo"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule OpenTelemetryDemo do | |
@moduledoc """ | |
Documentation for `OpenTelemetryDemo`. | |
""" | |
require OpenTelemetry.Tracer | |
require OpenTelemetry.Span | |
@doc """ | |
random function just to show the open-telemetry demo, | |
this function will mimic some working of the modules. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def application do | |
[ | |
extra_applications: [:lager, :logger, :inets, :opentelemetry] | |
mod: {OpenTelemetryDemo.Application, []} | |
] | |
end | |
def deps do | |
[ | |
# opentelemetry |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
beats { | |
type => beats | |
port => 5060 | |
} | |
} | |
filter { | |
dissect { | |
mapping => { |