opentelemetry-erlang
opentelemetry-erlang copied to clipboard
Normalize metric labelsets
There is no longer a "labelset" part of the API, so the SDK takes the raw label and value in a tuple list. At some point in the metrics pipeline these need to be "normalized" in order to not have duplicate metrics for the same labels.
Example:
ot_meter:record(mycounter, 5, [{key1, <<"value1">>}]),
ot_meter:record(mycounter, 8, [{<<"key1">>, <<"value1">>}]),
I think the labels should be able to be atoms, strings or binaries to make it easier on the user, so those 2 recordings should go to the same metric.
The normalizing can be done either at the time of the recording in ot_meter_default.erl
or at the time of "integration" in ot_metric_integrator.erl
. I'm not sure which is best.