Skip to content

Conversation

@tsloughter
Copy link
Member

Still needs some cleanup, like indentation, but wanted to open this before calling it a day.

I also do not like what I had to do on line 70 of oc_telemetry_SUITE but I don't know what else to do there :(

@tsloughter tsloughter requested a review from hauleth June 12, 2019 23:56
case telemetry:attach(Name, EventName, fun handle_event/4, Options) of
ok -> {ok, Measure};
Error -> Error
attach(Name, EventName, Measurement, Description, Unit, TagValues) ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add attach/5 which would set TagValues to identity function by default. IMHO it would provide nicer API for most common use-case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh right, wanted to ask about that. I don't get why there are exported attach functions? Wouldn't this only be used for track?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to support "manually" adding new listeners without Telemetry.Metrics.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, duh, ok.

@tsloughter
Copy link
Member Author

Updated. But I'm still not 100% on the API and whether we shouldn't simplify it by removing track.

@hauleth
Copy link
Collaborator

hauleth commented Jun 14, 2019

@tsloughter AFAIK not all libraries that support telemetry exports metrics via telemetry_metrics. But I am not sure as well. Maybe @arkgil could help us there with some suggestions.

@tsloughter
Copy link
Member Author

@hauleth oh, I don't think they do. I misspoke. I meant not having the track that takes a Metric. Instead only having track accept the mapping of event to measurement and using Metric only for creating views.

@tsloughter tsloughter force-pushed the telemetry-0.4 branch 3 times, most recently from 0be154b to 18ed2e1 Compare June 17, 2019 22:09
aggregation('Elixir.Telemetry.Metrics.Distribution', #{buckets := Buckets}) ->
{oc_stat_aggregation_distribution, [{buckets, Buckets}]}.
{oc_stat_aggregation_distribution, [{buckets, Buckets}]}.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to handle the new Summary type being passed even if to just log that it's unsupported and continue on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants