metrics method
Returns the metrics for the engine.
Implementation
@override
Future metrics({
Map<String, String>? globalLabels,
required MetricsFormat format,
}) async {
await start();
final response = await fetch(
_endpoint.replace(
path: '/metrics',
queryParameters: {'format': format.name},
),
method: 'POST',
body: globalLabels,
);
return switch (format) {
MetricsFormat.json => response.json(),
MetricsFormat.prometheus => response.text(),
};
}