class PrometheusMetric implements Metric {

    private Collector createOrGetCollector(String metricName, SimpleCollector.Builder<?, ?> builder) {
        String key = metricName;
        ConcurrentMap<String, Collector> map = this.namesToCollectors;
        Collector collector = map.get(key);

        // double checked locking
        if (collector == null) {
            synchronized (map) {
                if (!map.containsKey(key)) {
                    // create
                    builder = builder
                        .namespace(this.namespace)
                        .name(metricName)
                        .help(metricName)
                        .labelNames(REQUEST_DOMAIN_LABEL_NAME, PRINCIPAL_DOMAIN_LABEL_NAME, REQUEST_HTTP_METHOD_LABEL_NAME, REQUEST_HTTP_STATUS_LABEL_NAME, REQUEST_API_LABEL_NAME);
                    collector = builder.register(this.registry);
                    // put
                    map.put(key, collector);
                } else {
                    // get
                    collector = map.get(key);
                }
            }
        };

        return collector;
    }

    public  PrometheusMetric(CollectorRegistry registry, ConcurrentMap<String, Collector> namesToCollectors, PrometheusExporter exporter, String namespace);
    public  PrometheusMetric(CollectorRegistry registry,
                            ConcurrentMap<String, Collector> namesToCollectors,
                            PrometheusExporter exporter,
                            String namespace,
                            boolean isLabelRequestDomainNameEnable,
                            boolean isLabelPrincipalDomainNameEnable,
                            boolean isLabelHttpMethodNameEnable,
                            boolean isLabelHttpStatusNameEnable,
                            boolean isLabelApiNameEnable);

}