opencensus-erlang icon indicating copy to clipboard operation
opencensus-erlang copied to clipboard

Use gen_event for metrics and traces sending

Open hauleth opened this issue 6 years ago • 9 comments

hauleth avatar Feb 08 '19 08:02 hauleth

why?

deadtrickster avatar Feb 08 '19 09:02 deadtrickster

@deadtrickster because right now we are writing something similar on our own, and gen_event has some nice features that can help with management of the reporters/exporters, for example it provides support for deregistration or swapping listeners. Also this would provide interface similar to the 3rd pilar of observability - logs, which are using gen_event as logging dispatcher (both Elixir's Logger and Erlang's logger use that).

hauleth avatar Feb 08 '19 09:02 hauleth

I don't think logger uses gen_event.

tsloughter avatar Feb 08 '19 14:02 tsloughter

@tsloughter yeah, my bad.

hauleth avatar Feb 08 '19 15:02 hauleth

can you throw some code? I still don't quite get the idea

deadtrickster avatar Feb 09 '19 12:02 deadtrickster

@deadtrickster what do you mean by the code? You want PR with the migration to the gen_event?

hauleth avatar Feb 10 '19 22:02 hauleth

I think he just meant some code that'd show how it'd work.

I don't think it helps because as far as I know we'd still need the process for notifying the manager to kick off the events.

tsloughter avatar Feb 10 '19 22:02 tsloughter

@tsloughter yes, we would need, but it could be shared one, I am in the process of writing something that will show what I have in mind for that.

hauleth avatar Feb 10 '19 22:02 hauleth

Very rough and very WIP migration #136. However it shows the base idea how I would organise the code.

hauleth avatar Feb 10 '19 23:02 hauleth