protected C getMetric() {
        if (metricsInstance == null) {
            if (isIDReady()) {
                lock.lock();
                try {
                    if (metricsInstance == null) {
                        String[] labelNames = new String[labels.getKeys().length + 1];
                        labelNames[0] = "sw_backend_instance";
                        for (int i = 0; i < labels.getKeys().length; i++) {
                            labelNames[i + 1] = labels.getKeys()[i];
                        }

                        String[] labelValues = new String[values.getValues().length + 1];
                        labelValues[0] = TelemetryRelatedContext.INSTANCE.getId();
                        for (int i = 0; i < values.getValues().length; i++) {
                            labelValues[i + 1] = values.getValues()[i];
                        }

                        if (!ALL_METRICS.containsKey(name)) {
                            synchronized (ALL_METRICS) {
                                if (!ALL_METRICS.containsKey(name)) {
                                    ALL_METRICS.put(name, create(labelNames));
                                }
                            }
                        }

                        T metrics = (T) ALL_METRICS.get(name);

                        metricsInstance = (C) metrics.labels(labelValues);
                    }
                } finally {
                    lock.unlock();
                }
            }
        }

        return metricsInstance;
    }
Create real prometheus metrics with SkyWalking native labels, and provide to all metrics implementation. Metrics
name should be unique.

@return metric reference if the service instance id has been initialized. Or NULL.
oap-server/server-telemetry/telemetry-prometheus/src/main/java/org/apache/skywalking/oap/server/telemetry/prometheus/BaseMetrics.java