Được TopGit lập chỉ mục từ metadata GitHub: derailed/ex_ray có 57 sao, viết chủ yếu bằng Elixir. An Elixir OpenTracing library based on Otter
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
ExRay defines an annotation construct that wraps regular functions and enable
them to be traced using a simple affordance @trace to interact with an
OpenTracing compliant collector.
OpenTracing defines the concept of spans that
track the call stack and record timing information and various call artifacts
that can be used for application runtime inspection.
This is a really cool piece of technology that compliments your monitoring
solution as you now have x-ray vision of your application at runtime once
a monitoring metric gets off the chart.
However in practice, your code gets quickly cluttered by your tracing efforts.
ExRay alleviates the clutter by injecting cross-cutting tracing concern into
your application code. By using @trace annotation, you can trap the essence of
the calls without introducing tracing code mixed-in with your business logic.
ExRay leverages Otter Erlang
OpenTracing lib from the fine folks of BlueHouse Technology.
Documentation
ExRay
Installation
Tracing information needs to be collected by a tracing backend of your choice. You can run
ExRay using any trace collector that Otter supports. In the following example we will use
Jaeger from the self-driven folks at Uber!
Start Jaeger
Providing you have docker running on you box, you can use the all-in-one Jaeger
image to get you started. If you are a Kubernetes fan, you can use the
Jaeger chart
Alternatively, you could use the echo server otter_srv
for testing your installation but I find it more fun to have a cool UI to look at your tracing outcomes.
Setup Dependencies
Add the following dependencies to your project (Elixir or Phoenix)
NOTE: You can use Httpc(default), Hackney or IBrowse for your http client.
We opt for Ibrowse here.
def deps do
[
...
{:ex_ray , "~> 0.1.2"},
{:ibrowse, "~> 4.4.0"}
]
end
Configure Otter
In your config file, you need to tell Otter where to find your Zipkin collector.
Note: This thru me for a loop! The uri is indeed a char list and not a string!
Configure Your Application
ExRay uses ETS to track the span chains. Each request will create a new chain that
will grow and collapse with your function call stack. As such you will need to track a unique
call ID either by generating a custom ID for each request. If you are using Phoenix, the
framework does this for you by using the request_id in the response headers.
The ETS table is used to locate the parent span for which to attach to when
navigating the call stack.
NOTE: One cool aspect of OpenTracing is the tracing does not stop at the process boundaries
as you can continue the chain to other processes and external services. Please see
the examples directory for further info.
In your application initialization, you need to make sure the ExRay ETS table is created by calling
# application.ex
...
ExRay.Store.create()
...
Let's Trace!
Here is a simples tracing example. Please take a look at the examples in the Repo and
ExRay Tracers for Phoenix sample use cases.
defmodule TraceMe do
use ExRay, pre: :before_fun, post: :after_fun
alias ExRay.Span
# Generates a request id
@req_id :os.system_time(:milli_seconds) |> Integer.to_string |> IO.inspect
@trace kind: :critical
def fred(a, b), do: a+b
defp before_fun(ctx) do
ctx.target
|> Span.open(@req_id)
|> :otter.tag(:kind, ctx.meta[:kind])
|> :otter.log(">>> #{ctx.target} with #{ctx.args |> inspect}")
end
defp after_fun(ctx, span, res) do
span
|> :otter.log("<<< #{ctx.target} returned #{res}")
|> Span.close(@req_id)
end
end
See it!
That's great, but how do you see the tracing information?
open http://localhost:16686
Under Service open up our TraceMe service, click Find Traces and you should
now see your span in all its glory ie timing, tag and log info
GitHub topics của derailed/ex_ray: "elixir", "opentracing", "otter". TopGit xếp repo vào nhóm mã nguồn mở.
derailed/ex_ray có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho derailed/ex_ray. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
derailed/ex_ray có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho derailed/ex_ray. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
derailed/ex_ray còn đang phát triển không?
Commit gần nhất trên derailed/ex_ray là 7.8 năm trước (theo timestamp GitHub). Repo có 12 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc thêm về derailed/ex_ray ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/derailed/ex_ray là nguồn chính thức.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về ex_ray?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về ex_ray.