public MetricsValues readMetricsValues(MetricsCondition condition, Duration duration) throws IOException {
        DebuggingTraceContext traceContext = TRACE_CONTEXT.get();
        DebuggingSpan span = null;
        try {
            if (traceContext != null) {
                span = traceContext.createSpan("Query Service: readMetricsValues");
                span.setMsg("MetricsCondition: " + condition + ", Duration: " + duration);
            }
            return invokeReadMetricsValues(condition, duration);
        } finally {
            if (traceContext != null && span != null) {
                traceContext.stopSpan(span);
            }
        }
    }
Read time-series values in the duration of required metrics
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/query/MetricsQueryService.java