File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,16 @@ const metricTypes = {
2121 SUMMARY : "summary" ,
2222} ;
2323
24- function deprecateMetaForLabels ( ) {
24+ function deprecateMetaForLabels ( metric , label ) {
2525 if ( ! deprecateMetaForLabels . warned ) {
2626 deprecateMetaForLabels . warned = true ;
2727 process . emitWarning (
28- `
28+ `Got label ${ label } for metric ${ metric } using the meta property.
29+
2930Using metric meta property for labels (eg. metric({ meta: { label: "value" } })) is now deprecated and will be removed in a future version.
30- Please use the " labels" key instead.
31- See https://github.com/metrics-js/client for up to date usage.
32- `,
31+ Please use the labels key instead (eg metric({ labels: { label: "value" } })) .
32+
33+ See https://github.com/metrics-js/client for up to date usage. `,
3334 "DeprecationWarning" ,
3435 ) ;
3536 }
@@ -90,7 +91,7 @@ module.exports = class PrometheusMetricsConsumer extends Writable {
9091 if ( key === "buckets" ) return ;
9192 if ( key === "quantiles" ) return ;
9293
93- deprecateMetaForLabels ( ) ;
94+ deprecateMetaForLabels ( metric . name , key ) ;
9495
9596 labelNames . push ( key ) ;
9697 labelValues . push ( metric . meta [ key ] ) ;
You can’t perform that action at this time.
0 commit comments