Skip to content

Commit 6c242e3

Browse files
committed
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.
1 parent 21c8c85 commit 6c242e3

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ This release marks our first release under the Prometheus umbrella.
4141
- chore: Add copyright license headers and test
4242
- Make cluster and worker-thread metric aggregation order deterministic
4343
- Export `MetricObject`, `MetricObjectWithValues`, `MetricValue` and `MetricValueWithName` from the TypeScript definitions
44+
- chore: Old label processing code marked as deprecated
4445

4546
### Added
4647

lib/util.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ exports.getValueAsString = function getValueString(value) {
3232

3333
/**
3434
* @function removeLabels
35+
* @deprecated please use LabelMap
3536
* @param {Map} hashMap
3637
* @param {string[]} labels
3738
* @param {string[]} sortedLabelNames
@@ -46,6 +47,7 @@ exports.removeLabels = function removeLabels(
4647

4748
/**
4849
* @function setValue
50+
* @deprecated please use LabelMap
4951
* @param {Map} hashMap
5052
* @param {*} value
5153
* @param {object} labels
@@ -61,6 +63,7 @@ exports.setValue = function setValue(hashMap, value, labels) {
6163

6264
/**
6365
* @function setValueDelta
66+
* @deprecated please use LabelMap
6467
* @param {Map} hashMap
6568
* @param {*} deltaValue
6669
* @param {object} labels
@@ -142,6 +145,11 @@ function hashObject(labels, labelNames) {
142145

143146
return fastHashObject(keys, labels);
144147
}
148+
149+
/**
150+
* @deprecated please use LabelMap
151+
* @type {(function(*, *): (string))|*}
152+
*/
145153
exports.hashObject = hashObject;
146154

147155
exports.isObject = function isObject(obj) {

0 commit comments

Comments
 (0)