Skip to content

Add magic method between TelemetryRegistry.get_events/1 and Module.get_attribute/3 #8

@garthk

Description

@garthk

I'd love to make TelemetryDecorator event names easier to discover (amplifiedai/telemetry_decorator#2). Assuming I can figure out a way to emit module-level AST chunks (arjan/decorator#42), the next trick will be making the dependency on TelemetryRegistry optional. Strikes me registering the attribute myself is rude, which might introduce a race. Bah!

If your macro defined a José-style magic method eg. __telemetry_registry_details__/0 in the module exposing the results of Module.get_attribute/3, though, I could do the same in an API-compatible way using my own attribute. We'd each have to check Module.defines?(__MODULE__, {: __telemetry_registry_details__, 0}) and defoverridable __telemetry_registry_details__: 0 if so, bu— this is getting silly; maybe I should just invoke your macro. Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions