From 7f633490f1b6dd222518c3b51796eaf8724fbd91 Mon Sep 17 00:00:00 2001 From: Jason Marshall Date: Sat, 1 Aug 2026 15:06:53 -0700 Subject: [PATCH] Deprecate functions that were replaced by LabelMap These functions are exposed by the public API and are likely to be used by third party custom Metrics, so cannot simply be deleted. Signed-off-by: Jason Marshall --- CHANGELOG.md | 1 + lib/util.js | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11be4a31..900e661d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ This release marks our first release under the Prometheus umbrella. - chore: Add copyright license headers and test - Make cluster and worker-thread metric aggregation order deterministic - Export `MetricObject`, `MetricObjectWithValues`, `MetricValue` and `MetricValueWithName` from the TypeScript definitions +- chore: Old label processing code marked as deprecated ### Added diff --git a/lib/util.js b/lib/util.js index 18dca108..58ccef12 100644 --- a/lib/util.js +++ b/lib/util.js @@ -32,6 +32,7 @@ exports.getValueAsString = function getValueString(value) { /** * @function removeLabels + * @deprecated please use LabelMap * @param {Map} hashMap * @param {string[]} labels * @param {string[]} sortedLabelNames @@ -46,6 +47,7 @@ exports.removeLabels = function removeLabels( /** * @function setValue + * @deprecated please use LabelMap * @param {Map} hashMap * @param {*} value * @param {object} labels @@ -61,6 +63,7 @@ exports.setValue = function setValue(hashMap, value, labels) { /** * @function setValueDelta + * @deprecated please use LabelMap * @param {Map} hashMap * @param {*} deltaValue * @param {object} labels @@ -142,6 +145,11 @@ function hashObject(labels, labelNames) { return fastHashObject(keys, labels); } + +/** + * @deprecated please use LabelMap + * @type {(function(*, *): (string))|*} + */ exports.hashObject = hashObject; exports.isObject = function isObject(obj) {