MCPcopy
hub / github.com/prometheus/client_js / formatLabels

Function formatLabels

lib/registry.js:205–214  ·  view source on GitHub ↗
(labels, exclude)

Source from the content-addressed store, hash-verified

203}
204
205function formatLabels(labels, exclude) {
206 const { hasOwnProperty } = Object.prototype;
207 const formatted = [];
208 for (const [name, value] of Object.entries(labels)) {
209 if (!exclude || !hasOwnProperty.call(exclude, name)) {
210 formatted.push(`${name}="${escapeLabelValue(value)}"`);
211 }
212 }
213 return formatted;
214}
215
216const sharedLabelCache = new WeakMap();
217function flattenSharedLabels(labels) {

Callers 2

getMetricsAsStringMethod · 0.85
flattenSharedLabelsFunction · 0.85

Calls 2

escapeLabelValueFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected