View output and see that bucket sizes are the default bucket sizes rather than the ones I've provided in the setup.
Expected behavior
Bucket sizes should be those which I provided to the factory
Actual behavior
Bucket sizes are instead the defaulted bucket sizes hard coded into the library
Environment
OS version: 12.4
Swift version: 5.6
Serverside Swift Framework: Vapor
Framework version: 4
Solution
The root cause appears to be that the makeHistogram function calls createHistogram which has a variable called buckets: Buckets = .defaultBuckets. This defaults to defaultBuckets which is incorrect, it should instead be set to configuration.defaultRecorderBuckets (which itself defaults to defaultBuckets but can be overridden by the user, me, as above).
Steps to reproduce
Setup Prometheus and Swift Metrics:
Create a Recorder and record a value:
View output and see that bucket sizes are the default bucket sizes rather than the ones I've provided in the setup.
Expected behavior
Bucket sizes should be those which I provided to the factory
Actual behavior
Bucket sizes are instead the defaulted bucket sizes hard coded into the library
Environment
Solution
The root cause appears to be that the
makeHistogram
function callscreateHistogram
which has a variable calledbuckets: Buckets = .defaultBuckets
. This defaults to defaultBuckets which is incorrect, it should instead be set toconfiguration.defaultRecorderBuckets
(which itself defaults todefaultBuckets
but can be overridden by the user, me, as above).