mudasobwa

mudasobwa

Creator of Cure

I am glad to announce the first Telemetria release. telemetria v0.25.0 — 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.

Showing Posts 23 to 14

mudasobwa

mudasobwa OP

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.

tcoopman

tcoopman

Hi @mudasobwa

I was just checking out Telemetria and it looks nice. But browsing through the documentation, I can’t seem to find how to configure open telemetry endpoints on where to send the data to?

Any changes of an example for this?

mudasobwa

mudasobwa OP

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 OP

Creator of Cure

It’s been a while. Three features and several bugfixes:

  • 0.14.0 —
    • [ENH] Allow if: runtime_function in @telemetria attribute in the form &Mod.fun/1,
      which will receive the result and emit the telemetry event if it returns true
  • 0.13.0 —
    • [ENH] Allow if: compile_time_boolean in @telemetria attribute
  • 0.12.0 —
    • [ENH] Allow [transform: [args: M.f/1, result: {M, :f}]] coercers in @telemetria attribute

The above means @telemetria hooks can be optional both in compile time (purged from the resulting code) and runtime (no event if the condition is not met.)

@telemetria level: :info, if: Application.compile_env(:foo, :bar, true)
def foo, do: 42
mudasobwa

mudasobwa OP

Creator of Cure

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

mudasobwa

mudasobwa OP

Creator of Cure

UPD

  • 0.5.0 —
    • [ENH] annotation @telemetria true as a synonym to deft/2
    • [FIX] polling is off by default
  • 0.4.0 —
    • [ENH] default polling of system / vm states for free
    • [ENH] starting in phases ensuring proper instrumenter setup
  • 0.3.0 —
    • [ENH] no need for any config in any environment
    • [BUG] proper handling of guards in compiler, correct event names

The module attribute @telemetria accepts true only ATM, but it will be extended to accept additional context, levels and specific handler.

mudasobwa

mudasobwa OP

Creator of Cure

Thanks!

I thought about allowing to declare telemetry aspects through module attributes, but I frankly don’t see any reason to include decorators in the library itself. Whether one wants to use a decorator, or any other implementation of AOP, t/2 is already there, exported, and nothing can prevent from doing somewhat like

@decorator telemetria()
def my_fun, do: my_code

with a decorator delegating to t/2. SRP :slight_smile:

OTOH, maybe you are right and I should think about optional support when decorators are already used in the target application.

mudasobwa

mudasobwa OP

Creator of Cure

Thank you, merged. Appreciate it.

Please feel free to open issues as they arise.

derekbrown

derekbrown

This is pretty cool, @mudasobwa! Thanks for sharing.

Thoughts on the decorator pattern for something like this?

@decorator telemetria # the decorator could be anything. t, track, emit, report, etc.
def my_function() do
  my code |> my other code
end

It’s a pattern I use regularly and makes code pretty easy-to-read. Spandex uses it too.

Code & docs.

bglusman

bglusman

Looks neat! Just submitted a PR to fix a couple typos, look forward to trying out!

Where Next? Top

Trending in Announcing Top

type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
woylie
I released Doggo, a collection of unstyled Phoenix components. https://github.com/woylie/doggo Features Unstyled Phoenix components....
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
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
kip
I’ll shortly be launching Text, a nascent text analysis library. Current functionality In this early version (not ready for prime time) ...
New
kip
Following on from my CLDR lbraries I started work on Unicode transforms. But like everything related to CLDR there is a lot of yak-shavin...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews