Implementation will be stored in metrics.plugins.otlp script, similar to other export plugins. Module API has two handles.
otlp.collect() returns a Lua table with current metrics data. It performs metrics.invoke_callbacks() (similar to other plugins), iterates through registry and collects relevant values. It is expected that json.encode(otlp.collect()) is a valid OTLP JSON Mapping content. See [1] for Prometheus collectors to OpenTelemetry Instruments mapping. otlp.collect{default_only = true} collects only default Tarantool metrics, same as with metrics.collect{invoke_callbacks = true, default_only = true}.
otlp.init(opts) works the same as graphite.init by starting a background fiber which pushes OTLP JSON Mapping content obtained from otlp.collect to OpenTelemetry collector or backend with HTTP client. opts includes host, port, send_interval (same as graphite) and default_only (to be consistent with collect).
It is not expected that tarantool/metrics will support OTLP to Prometheus transformation, since one may use OpenTelemetry collectors for it.
See Notion RFC (private) for more detailed info. See implementation raw draft here.
Implementation will be stored in
metrics.plugins.otlp
script, similar to other export plugins. Module API has two handles.otlp.collect()
returns a Lua table with current metrics data. It performsmetrics.invoke_callbacks()
(similar to other plugins), iterates through registry and collects relevant values. It is expected thatjson.encode(otlp.collect())
is a valid OTLP JSON Mapping content. See [1] for Prometheus collectors to OpenTelemetry Instruments mapping.otlp.collect{default_only = true}
collects only default Tarantool metrics, same as withmetrics.collect{invoke_callbacks = true, default_only = true}
.otlp.init(opts)
works the same asgraphite.init
by starting a background fiber which pushes OTLP JSON Mapping content obtained fromotlp.collect
to OpenTelemetry collector or backend with HTTP client.opts
includeshost
,port
,send_interval
(same asgraphite
) anddefault_only
(to be consistent withcollect
).It is not expected that
tarantool/metrics
will support OTLP to Prometheus transformation, since one may use OpenTelemetry collectors for it.