@Override
    public void accept(MeterEntity entity, Long value) {
        decorate(entity);
        setEntityId(entity.id());
        setServiceId(entity.serviceId());
        if (this.value < value) {
            setValue(value);
        }
    }
Service ID is required for sort query.
oap-server/server-core/src/main/java/org/apache/skywalking/oap/server/core/analysis/meter/function/max/MaxFunction.java