@@ -15,6 +15,12 @@ import (
1515
1616var defaultDurationBuckets = []float64 {.01 , .025 , .05 , .1 , .25 , .5 , 1 , 2.5 , 5 , 10 , 30 }
1717
18+ // defaultNativeHistogramBucketFactor sets the resolution for native histogram
19+ // buckets (schema=3, ~9% growth between boundaries). Setting this alongside
20+ // classic Buckets enables dual-mode emission: old scrapers see classic buckets,
21+ // new scrapers get the higher-resolution native histogram data.
22+ const defaultNativeHistogramBucketFactor = 1.1
23+
1824var (
1925 spKey = reflect .TypeOf ((* Metrics )(nil ))
2026
@@ -34,22 +40,28 @@ var (
3440 LabelNames : []string {"network" , "channel" , "namespace" },
3541 }
3642 endorsementDuration = metrics.HistogramOpts {
37- Name : "endorsement_duration_seconds" ,
38- Help : "Duration of the full endorsement collection phase including signatures, audit, and chaincode approval." ,
39- LabelNames : []string {"network" , "channel" , "namespace" },
40- Buckets : defaultDurationBuckets ,
43+ Name : "endorsement_duration_seconds" ,
44+ Help : "Duration of the full endorsement collection phase including signatures, audit, and chaincode approval." ,
45+ LabelNames : []string {"network" , "channel" , "namespace" },
46+ Buckets : defaultDurationBuckets ,
47+ NativeHistogramBucketFactor : defaultNativeHistogramBucketFactor ,
48+ NativeHistogramMaxBucketNumber : 100 ,
4149 }
4250 auditApprovalDuration = metrics.HistogramOpts {
43- Name : "audit_approval_duration_seconds" ,
44- Help : "Duration of the auditor approval phase including validation, append, and signing." ,
45- LabelNames : []string {"network" , "channel" , "namespace" },
46- Buckets : defaultDurationBuckets ,
51+ Name : "audit_approval_duration_seconds" ,
52+ Help : "Duration of the auditor approval phase including validation, append, and signing." ,
53+ LabelNames : []string {"network" , "channel" , "namespace" },
54+ Buckets : defaultDurationBuckets ,
55+ NativeHistogramBucketFactor : defaultNativeHistogramBucketFactor ,
56+ NativeHistogramMaxBucketNumber : 100 ,
4757 }
4858 orderingDuration = metrics.HistogramOpts {
49- Name : "ordering_duration_seconds" ,
50- Help : "Duration of the transaction broadcast to the ordering service." ,
51- LabelNames : []string {"network" , "channel" , "namespace" },
52- Buckets : defaultDurationBuckets ,
59+ Name : "ordering_duration_seconds" ,
60+ Help : "Duration of the transaction broadcast to the ordering service." ,
61+ LabelNames : []string {"network" , "channel" , "namespace" },
62+ Buckets : defaultDurationBuckets ,
63+ NativeHistogramBucketFactor : defaultNativeHistogramBucketFactor ,
64+ NativeHistogramMaxBucketNumber : 100 ,
5365 }
5466)
5567
0 commit comments