Class DropwizardExports

    • Constructor Detail

      • DropwizardExports

        public DropwizardExports​(com.codahale.metrics.MetricRegistry registry)
        Creates a new DropwizardExports with a DefaultSampleBuilder and MetricFilter.ALL.
        Parameters:
        registry - a metric registry to export in prometheus.
      • DropwizardExports

        public DropwizardExports​(com.codahale.metrics.MetricRegistry registry,
                                 com.codahale.metrics.MetricFilter metricFilter)
        Creates a new DropwizardExports with a DefaultSampleBuilder and custom MetricFilter.
        Parameters:
        registry - a metric registry to export in prometheus.
        metricFilter - a custom metric filter.
      • DropwizardExports

        public DropwizardExports​(com.codahale.metrics.MetricRegistry registry,
                                 SampleBuilder sampleBuilder)
        Parameters:
        registry - a metric registry to export in prometheus.
        sampleBuilder - sampleBuilder to use to create prometheus samples.
      • DropwizardExports

        public DropwizardExports​(com.codahale.metrics.MetricRegistry registry,
                                 com.codahale.metrics.MetricFilter metricFilter,
                                 SampleBuilder sampleBuilder)
        Parameters:
        registry - a metric registry to export in prometheus.
        metricFilter - a custom metric filter.
        sampleBuilder - sampleBuilder to use to create prometheus samples.
    • Method Detail

      • describe

        public List<Collector.MetricFamilySamplesdescribe()
        Description copied from interface: Collector.Describable
        Provide a list of metric families this Collector is expected to return. These should exclude the samples. This is used by the registry to detect collisions and duplicate registrations. Usually custom collectors do not have to implement Describable. If Describable is not implemented and the CollectorRegistry was created with auto describe enabled (which is the case for the default registry) then Collector.collect() will be called at registration time instead of describe. If this could cause problems, either implement a proper describe, or if that's not practical have describe return an empty list.
        Specified by:
        describe in interface Collector.Describable