mudasobwa

mudasobwa

Creator of Cure

Telemetría - telemetry convenient wrapper

I am glad to announce the first Telemetria release. telemetria v0.22.1 — Documentation

It takes care of event registration (through compilation manifest), runtime and release configs (through config provider), and basically allows to wrap any expressions and/or functions to “telemetryized” calls.

If you hesitated to add telemetry to your project, it’s a great time. Example from docs:

defmodule MyMod do
  import Telemetria

  defpt pi, do: 3.14
  deft answer, do: 42 - pi()

  def inner do
    short_result = t(42 * 42)
    result =
      t do
        # long calculations
        :ok
      end
  end
end

Enjoy. Mode details are in the linked above docs. Feedback is very welcome, as always.

Most Liked

mudasobwa

mudasobwa

Creator of Cure

Just blogged on why Telemetría, what is it, what is it not, how to use etc.

mudasobwa

mudasobwa

Creator of Cure

It’s been another while.

Telemetría became a backend agnostic (telemetry and opentelemetry are supported out of the box, custom backends might be added.) It also supports sending a desired events to “messengers” like slack. Also, local variables can now be effortlessly propagated to the emitted events.

  • 0.22.0
    • [UPD] support for external messengers (slack)
    • [UPD] support for nested spans in open telemetry
    • [UPD] reshape/1 everywhere to make a result transformable
    • [UPD] OpenTelemetry support through backend abstraction
    • [UPD] locals: [:foo, :bar] to export local vars from functions
    • [UPD] Configurable throttling groups
mudasobwa

mudasobwa

Creator of Cure

Being a wrapper, telemetría itself has nothing to do with OTel, there is an example within the project, and it’s config is here: telemetria/examples/otel/config/config.exs at v0.24.0 · am-kantox/telemetria · GitHub

Once you have OTel configured, telemetría should just work.

Please let me know if that helped and don’t hesitate to create issues directly on GH if in doubt.

mudasobwa

mudasobwa

Creator of Cure

OK, I will try.

deft/2 and defpt/2 are simply wrappers for Kernel.def/2 and Kernel.defp/2 respectively. They are somewhat similar to AOP around aspect, mesauring the time spent in the function itself and sending the telemetry event.

t/2 does the same for anonymous functions and expressions. The latter also allows to pass context as the second parameter to be attached to the event.

Events automatically get the names based on modules / functions (configurable) and the events are registered within :telemetry automagically by a compiler.

In general, it allows to have zero boilerplate when working with complicated/huge set of :telemetry events.

I hope it became a bit clearer.

mudasobwa

mudasobwa

Creator of Cure

Thanks, fixed!

Sounds reasonable. I’d love to collect more opinions, but atm I think that’s the way to go.

Basically one might configure functions that would be excluded from wrapping into :telemetry despite they are still declared with deft/defpt with zero overhead (compile-time purge.)

I honestly thought :telemetry is something like Jason nowadays, everyone should have at least read about; Phoenix docs mention it, Ecto docs do, etc.

I will try to add a couple of sentences, but I definitely want to avoid being DHH here. If one have never heard about :telemetry, they probably should have started with :telemetry itself to understand how it works in a nutshell, and only then come for libraries hiding the boilerplate.

:telemetry is a side effect. Both would behave exactly as def/2 and defp/2 from the consumer point of view. Only side effect of sending :telemetry events would happen under the hood.

Where Next?

Popular in Libraries Top

sabiwara
Dune is a sandbox for Elixir and aims to safely evaluate user-provided code. You can try it out using this basic Elixir playground made ...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. Features Unstyled Phoenix components. Storybook that can be added to...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
mbuhot
EctoJob A transactional job queue built with Ecto, PostgreSQL and GenStage Available on Hex.pm: ecto_job | Hex Docs: API Reference — ec...
New
zorbash
I created Kitto a framework for dashboards inspired by Dashing. [demo] The distributed characteristics of Elixir and the low memory foo...
New
ahamez
Hi everyone, I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
wmnnd
Hi there, for my project DBLSQD, I needed a file storage solution that is a bit more flexible than Arc. Because I thought others might f...
New
Qqwy
While not as prevalent as in imperative languages, arrays (collections with efficient random element access) are still very useful in Eli...
New
Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Th...
New
mattludwigs
Grizzly is a library for working with Z-Wave devices. Z-Wave is a low-frequency radio protocol for controlling smart home devices on a me...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 35421 110
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
aesmail
Hello guys, I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New

Sub Categories:

We're in Beta

About us Mission Statement