All Projects → opencensus-beam → opencensus_elixir

opencensus-beam / opencensus_elixir

Licence: Apache-2.0 license
No description or website provided.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to opencensus elixir

gateway
A proxy to buffer and forward metrics, events, and traces.
Stars: ✭ 94 (+147.37%)
Mutual labels:  apm, tracing, opencensus
Apm Agent Rum Js
Elastic APM Real User Monitoring JavaScript agent
Stars: ✭ 166 (+336.84%)
Mutual labels:  apm, tracing
Pinpoint
APM, (Application Performance Management) tool for large-scale distributed systems.
Stars: ✭ 11,883 (+31171.05%)
Mutual labels:  apm, tracing
datadog-trace-agent
Datadog Trace Agent archive (pre-6.10.0)
Stars: ✭ 70 (+84.21%)
Mutual labels:  apm, tracing
Dd Trace Dotnet
.NET Tracer for Datadog APM
Stars: ✭ 125 (+228.95%)
Mutual labels:  apm, tracing
Apm Agent Php
Elastic APM PHP Agent
Stars: ✭ 129 (+239.47%)
Mutual labels:  apm, tracing
Dd Trace Js
JavaScript APM Tracer
Stars: ✭ 212 (+457.89%)
Mutual labels:  apm, tracing
Dd Opentracing Cpp
Datadog Opentracing C++ Client
Stars: ✭ 22 (-42.11%)
Mutual labels:  apm, tracing
Dd Trace Java
Datadog APM client for Java
Stars: ✭ 228 (+500%)
Mutual labels:  apm, tracing
Dd Trace Go
A Go tracing package for Datadog APM
Stars: ✭ 244 (+542.11%)
Mutual labels:  apm, tracing
Cat
CAT 作为服务端项目基础组件,提供了 Java, C/C++, Node.js, Python, Go 等多语言客户端,已经在美团点评的基础架构中间件框架(MVC框架,RPC框架,数据库框架,缓存框架等,消息队列,配置系统等)深度集成,为美团点评各业务线提供系统丰富的性能指标、健康状况、实时告警等。
Stars: ✭ 16,236 (+42626.32%)
Mutual labels:  apm, tracing
Skyapm Nodejs
The NodeJS server side agent for Apache SkyWalking
Stars: ✭ 124 (+226.32%)
Mutual labels:  apm, tracing
Dd Trace Rb
Datadog Tracing Ruby Client
Stars: ✭ 118 (+210.53%)
Mutual labels:  apm, tracing
Stagemonitor
an open source solution to application performance monitoring for java server applications
Stars: ✭ 1,664 (+4278.95%)
Mutual labels:  apm, tracing
Spm Agent Nodejs
NodeJS Monitoring Agent
Stars: ✭ 51 (+34.21%)
Mutual labels:  apm, tracing
Dd Trace Php
Datadog Tracing PHP Client
Stars: ✭ 203 (+434.21%)
Mutual labels:  apm, tracing
pm2-io-apm
PM2.io APM for Node.JS
Stars: ✭ 131 (+244.74%)
Mutual labels:  apm, tracing
Jaeger Ui
Web UI for Jaeger
Stars: ✭ 639 (+1581.58%)
Mutual labels:  apm, tracing
Molten
php probe for zipkin and opentracing
Stars: ✭ 740 (+1847.37%)
Mutual labels:  apm, tracing
Dd Trace Py
Datadog Python APM Client
Stars: ✭ 220 (+478.95%)
Mutual labels:  apm, tracing

Opencensus

CircleCI Hex version badge

Wraps some :opencensus capabilities for Elixir users so they don't have to learn them some Erlang in order to get OpenCensus distributed tracing.

Installation

Add opencensus_elixir to your deps in mix.exs:

def deps do
  [
    {:opencensus, "~> 0.9"},
    {:opencensus_elixir, "~> 0.3.0"}
  ]
end

Usage

Wrap your code with the Opencensus.Trace.with_child_span/3 macro to execute it in a fresh span:

import Opencensus.Trace

def traced_fn(arg) do
  with_child_span "traced" do
    :YOUR_CODE_HERE
  end
end

Alternatives

If you prefer driving Erlang packages directly (see also :telemetry), copy what you need from lib/opencensus/trace.ex and call Logger.set_logger_metadata/0 if there's any chance of Logger use within the span.

def traced_fn() do
  try do
    :ocp.with_child_span("name", %{fn: :traced_fn, mod: __MODULE__})
    Logger.set_logger_metadata()

    :YOUR_CODE_HERE
  after
    :ocp.finish_span()
    Logger.set_logger_metadata()
  end
end

If try .. after .. end feels too bulky and you're sure you won't need Logger, try :ocp.with_child_span/3:

def traced_fn() do
  :ocp.with_child_span("traced", %{fn: :traced_fn, mod: __MODULE__}, fn () ->
    :YOUR_CODE_HERE
  end)
end

Troubleshooting

To see your spans, use the :oc_reporter_stdout reporter, either in config:

config :opencensus, reporters: [{:oc_reporter_stdout, []}]

... or at the iex prompt:

iex> :oc_reporter.register(:oc_reporter_stdout)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].